I had a problem after duplicating a site for development purposes. I used a staging.domain.com sub domain for the copy of the site. I updated my config files and used a copy of my original database that had a different user name and password from the original site. The site worked OK and I was able to edit contant and install/upgrade extras. But when I tried to upgrade MODX from version 2.6.5 to 2.7.0, or re-run the 2.6.5 Setup the site would fail with a 503 error.
I have resolved the problem by changing the databse password but I am documenting it in case anyone else experiences it.
I believe the problem was with the password for the MySQL database. The line for the password (which has since been changed) read:
$database_password = 'g$p:V9W \"v2+';
The password was automatically generated by the hosting control pane and it worked fine for editing the MODX site via the manager and installing/upgrading extras.
When I ran UpgradeMODX 2.1.2-pl the updater reported that the connection to the database was successful and that all other requirments were in place. On clicking through to the update the site went into 503 a error.
The php error log reported:
(ERROR in xPDOConnection::connect @ /path/to/core/xpdo/xpdo.class.php : 3119) SQLSTATE[HY000]  Access denied for user 'dbusername'@'localhost' (using password: YES)
Changing the password to one that did not contain any colons, backslashes, double quotes or spaces resolved the problem and allowed me to upgrade. I don’t know which of the characters in the password caused the problem as I have not had time to test, but I suspect either the space or the back slash.
@bobray I hope you don’t mind me tagging you in this as it may be something that interests you.
It is possible that you are all ‘face palming’ and asking who in their right mind would ever use a password containing those characters! If you are then this post is not for you but just for the idiots like me who didn’t know it would cause a problem.
PHP Version 7.2.29