We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Working on a website that got hacked and I'm upgrading the website with latest install of Revo. All the files are transferred correctly and I've updated the config files to ensure it's pointing to the right place.

    When I go through the /setup and Upgrade Existing Install or Advanced, I keep getting a "can not connect to database".

    Help, please.

    Server Info
    Apache Version 2.4.23
    PHP Version 5.6.29
    MySQL Version 5.6.38

    Update 1
    Just deleted the contents of /core/cache and redid the /setup

    Now I get the following error:

    Connecting to database server:
    Could not connect to the database server. Check the connection properties and try again.

    [2017-12-21 20:15:29] (ERROR in xPDOConnection::connect @ /home/catalystps/public_html/core/xpdo/xpdo.class.php : 3116) SQLSTATE[HY000] [2019] Unknown character set

    [2017-12-21 20:15:29] (ERROR in xPDOConnection::connect @ /home/catalystps/public_html/core/xpdo/xpdo.class.php : 3116) SQLSTATE[HY000] [2019] Unknown character set

    Update 2
    I can see that the character isn't set in the warning, yet it's set in my config.inc.php file in /core/config/. When I checked cache, I see there's a settings.cache.php file which is does NOT contain that information. Not sure where to do from here.

    Update 3
    Created a new db user with full permissions (even though the original one was correct). Connection made. YES! Got to the "install" and then this:
    Fatal error: Call to a member function checkPolicy() on null in /home/catalystps/public_html/core/model/modx/modx.class.php on line 1882
    [ed. note: mayhemchaos last edited this post 6 years, 4 months ago.]
      Sal Baldovinos
      SEO & DIGITAL MARKETING

      ARIEL DIGITAL | Maximize Your Potential
      www.arieldigitalmarketing.com
    • From what version are you updating? The checkPolicy error could perhaps be an indication that you upgraded from way back, while it's generally recommended to take it one minor version (2.2.x, 2.3.x, 2.4.x etc) at a time.

      It could also be an indication that something's up with your contexts. If it can't load the context, it can't check the policy (permission) on said context. There's been a few added fields to contexts over the years, so depending on how far behind you were on updates, that could be related to making too big of a jump at once.
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
      • Unfortunately, no one knows the version it was previously on. Is there a way to see that in the site files or db? Their host suspended the site, so I can even log into the manager.
          Sal Baldovinos
          SEO & DIGITAL MARKETING

          ARIEL DIGITAL | Maximize Your Potential
          www.arieldigitalmarketing.com
          • 38783
          • 571 Posts
          When upgrading some sites from 2.2.x to 2.4 or 2.5 I encountered this error.

          The solution for me was to add "name" row in table "modx_context" as a VARCHAR 255 and try running the setup again. I later deleted this row, but I can't remember if this step was necessary.

          The issue is discussed here: https://github.com/modxcms/revolution/issues/12764

          As for the version number I think if you search a backup of the db .sql file for the word 'version' in the manager_log you should find lines that read something like 'Upgrade MODX','modWorkspace','Version 2.5.5-pl'. The highest of these should be your version number. Although there may be a more obvious way of finding it!
            If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

            email: [email protected] | website: https://andytough.com
          • core/docs/version.inc.php, core/docs/changelog.txt, and the settings_version setting (in the database, that's modx_system_settings where the key is settings_version) are some places where you might be able of finding the version, but it's possible those have already been updated since you tried an update.
              Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

              Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
            • I tried adding a new row to the modx_context table. That got me further. I was actually thinking it was working. Hit "install" and then I got the same Fatal error: Call to a member function checkPolicy()
                Sal Baldovinos
                SEO & DIGITAL MARKETING

                ARIEL DIGITAL | Maximize Your Potential
                www.arieldigitalmarketing.com
              • Update: I actually did not create a new row in mod_context the first time. I did, however, manage to add the new name row. I ran the install again and got a NEW error sad

                Warning: array_merge(): Argument #2 is not an array in /home/catalystps/public_html/core/xpdo/xpdo.class.php on line 341

                Fatal error: Class 'xPDODriver_' not found in /home/catalystps/public_html/core/xpdo/xpdo.class.php on line 1884
                  Sal Baldovinos
                  SEO & DIGITAL MARKETING

                  ARIEL DIGITAL | Maximize Your Potential
                  www.arieldigitalmarketing.com
                • Happy Update

                  Thanks to Mark! I figured out the site was on 2.2.4. Upgraded the site to 2.2.5 and the site is back online!
                    Sal Baldovinos
                    SEO & DIGITAL MARKETING

                    ARIEL DIGITAL | Maximize Your Potential
                    www.arieldigitalmarketing.com
                  • Make sure not to stop at 2.2.5 unless you want to get hacked again wink
                      Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                      Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
                    • Quote from: markh at Jan 02, 2018, 02:19 PM
                      Make sure not to stop at 2.2.5 unless you want to get hacked again wink

                      I'm slowly making my way up. I'm up to 2.3.5 today. Every update still has the accesson.php file added in the assets/images/ folder :\ Hopefully these updates remove this issue. Is there a way to clean the DB too?
                        Sal Baldovinos
                        SEO & DIGITAL MARKETING

                        ARIEL DIGITAL | Maximize Your Potential
                        www.arieldigitalmarketing.com