We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51563
    • 5 Posts
    When going to my site URL and "/manager" I get the following error message:
    Fatal error: Call to a member function get() on a non-object in /home/danche2/public_html/core/model/modx/modrequest.class.php on line 192 - the site itself is fine.
    I'm thinking that I probably just need to overwrite the core setup with the original files but I'm not sure what version this site was on. I actually built it for someone earlier in the year and it was my first time with Modx Revolution. I have FTP access and mySQL access. I just can't figure out which version I had originally uploaded (I did a manual install on GoDaddy and not through their one-click installer). I'm fairly good overall with web development and file management and all that, but I'm not a PHP person.
    If overwriting Modx itself doesn't seem like the right fix or more of a 'nuclear' fix for something simple, please let me know as well!

    I did also do a search on the forums (a brief one admittedly) and didn't find anything that seemed to pertain to my particular error.

    Thanks!

    This question has been answered by blastfemur. See the first response.

      • 28042 ☆ A M B ☆
      • 24,524 Posts
      GoDaddy? well... it's not surprising you have a problem. GoDaddy does not play well with MODX Revolution.

      Try deleting the core/cache/ directories (MODX will regenerate them as needed), and make sure that your browser cache and cookies are cleared.

      If that fails, try using this install.php script, it's primarily intended for new installations. BobRay's UpgradeMODX dashboard widget is a better choice for upgrading - when you can get into the Manager, anyway. But his widget uses the same core code as the install.php script, and you can use the bare script for re-installing or upgrading if necessary. https://github.com/sottwell/installer

      The version you are using can be found in the System Settings table in the database, settings_version.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 51563
        • 5 Posts
        Yeah, my first time with GoDaddy. I didn't find that doing anything there was 'simple' at all.
        Per your instructions, I tried first renaming the cache folder and/or moving it elsewhere (past experiences have made me leery of ever deleting anything outright). I got a 500 Error as soon as the directory was removed from that location. I did see that, trying to hit the site, it started to recreate the cache directory though. I moved the cache directory back and the site came back in full.

        Thank you for pointing me in the direction of the database. I am on version 2.3.5-pl.
        I'm guessing that your script does an update of the core ModX FILES, but does it do anything to the database? I am going to backup site files first, of course, (I prefer to do this myself, manually than fiddle with anything that GoDaddy has or does) but asking as well. I will also backup the database too prior to trying anything further that could, potentially, cause loss of any information or content.

        UPDATE: I notice that 2.3.5 is not an option on the installation? Should I use BobbyRay's upgrade utility? Or, you mentioned, it doesn't work unless you have access to the manager itself already?

        UPDATE 2: I edited the PHP file to add 2.3.5 Traditional from the direct download location. Do you see any issue with adding this one myself? Was there a reason it was not included (or removed) from your version?

        Thanks again!
        *********** ********* **************** ************* *********

        Quote from: sottwell at Dec 20, 2015, 10:44 AM
        GoDaddy? well... it's not surprising you have a problem. GoDaddy does not play well with MODX Revolution.

        Try deleting the core/cache/ directories (MODX will regenerate them as needed), and make sure that your browser cache and cookies are cleared.

        If that fails, try using this install.php script, it's primarily intended for new installations. BobRay's UpgradeMODX dashboard widget is a better choice for upgrading - when you can get into the Manager, anyway. But his widget uses the same core code as the install.php script, and you can use the bare script for re-installing or upgrading if necessary. https://github.com/sottwell/installer

        The version you are using can be found in the System Settings table in the database, settings_version.
        [ed. note: blastfemur last edited this post 10 years, 9 months ago.]
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Deleting the core/cache/ directory (or just its children) should most certainly not cause any errors. There is something else seriously wrong there.

          You can modify the install.php to install any version you wish, just change the version numbers.

          I removed it from my version because it's for new installations, and older versions may have security issues (as is true with any software) so it's not a good idea to run them. BobRay's dashboard widget uses a System Setting to determine what version to use.

          I would strongly recommend moving that site to more reliable hosting such as SkyToaster - they use MODX for their own site, and provide active support on the MODX forums and Slack channels as well as a very responsive support system (they'll move a site for you).
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 3749
            • 24,544 Posts
            Removing or renaming the cache folder itself could cause trouble. You should just delete the files in it (or rename it and create a new, empty cache folder if you're worried).

            Lots of people have reported trouble with MODX on GoDaddy.


            http://bobsguides.com/modx-friendly-hosts.html
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 51563
              • 5 Posts
              Getting a little further (I hope you'll agree). Aside from moving to a new hosting environment (which, right now, I'd rather not do. I'd rather do something like then when the site is functioning and there is more time). I've since discovered that there are also two pages not working as well.
              So, in the core folder I noticed there was, for some reason I can't recall, already a 'cache.bk' file. On a whim (after trying to simply delete the files from within 'cache' folder and also moving them or deleting and recreating my own folder (all of which gave me a 500 error) - I tried simply renaming the semi-working cache folder (cache.OLD) and then using the cache.bk as the current. Lo and behold, I can now pull up the manager login page (but the two main pages aren't working still - here's that error:
              Fatal error: Call to a member function fetch() on a non-object in /home/danche2/public_html/core/cache/includes/elements/modsnippet/39.include.cache.php on line 79

              After this I removed BOTH cache directories once again (causing the 500 error) and forced the recreation of a new cache folder. I checked inside it to see what could be different from the other two. There was only one log file present with this information inside:

              [2015-12-21 12:13:33] (ERROR in xPDOConnection::connect @ /home/danche2/public_html/core/xpdo/xpdo.class.php : 3046) SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known
              [2015-12-21 12:13:33] (ERROR in xPDOConnection::connect @ /home/danche2/public_html/core/xpdo/xpdo.class.php : 3046) SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known
              [2015-12-21 12:13:33] (ERROR @ /index.php) Error preparing statement for query: SELECT `modSystemSetting`.`key` AS `modSystemSetting_key`, `modSystemSetting`.`value` AS `modSystemSetting_value`, `modSystemSetting`.`xtype` AS `modSystemSetting_xtype`, `modSystemSetting`.`namespace` AS `modSystemSetting_namespace`, `modSystemSetting`.`area` AS `modSystemSetting_area`, `modSystemSetting`.`editedon` AS `modSystemSetting_editedon` FROM `thp_system_settings` AS `modSystemSetting`  - 
              [2015-12-21 12:13:33] (ERROR in xPDOConnection::connect @ /home/danche2/public_html/core/xpdo/xpdo.class.php : 3046) SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known
              [2015-12-21 12:13:33] (ERROR in xPDOConnection::connect @ /home/danche2/public_html/core/xpdo/xpdo.class.php : 3046) SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known
              [2015-12-21 12:13:33] (ERROR @ /index.php) Error preparing statement for query: SELECT `modSystemSetting`.`key` AS `modSystemSetting_key`, `modSystemSetting`.`value` AS `modSystemSetting_value`, `modSystemSetting`.`xtype` AS `modSystemSetting_xtype`, `modSystemSetting`.`namespace` AS `modSystemSetting_namespace`, `modSystemSetting`.`area` AS `modSystemSetting_area`, `modSystemSetting`.`editedon` AS `modSystemSetting_editedon` FROM `thp_system_settings` AS `modSystemSetting`  - 
              [2015-12-21 12:13:33] (FATAL) Could not load core MODX configuration!


              Again, I'm not great with PHP but I tried sifting through the 'core/xpdo.xpdo.class.php' file to see if I could figure out what was going on there or why (also did some searching online) but I am at a loss. Perhaps this means more to someone else a little closer to the ModX product? It's obviously incapable of creating the full cache directory as it is erroring trying to either query from the database or, perhaps(?), a permissions issue?

              Any further assistance would be greatly appreciated (as is the assistance thus far).

              I will also speak with the owner of the domain who originally set it up on GoDaddy and recommend to move to BlueHost (I've had good luck with them also on my own sites). Since the owner also has their email setup through GoDaddy as well, I hate to suggest moving just because I can't get into the manager interface of the chosen CMS I created the site with (this would disrupt not only their website but their email as well, unfortunately.

              Thanks again!
                • 3749
                • 24,544 Posts
                Here's something that might get you a little further.

                In PhpMyAdmin, open the modx_site_snippets table and find the snippet with the ID of 39.

                Edit the 'snippet' field and add this at very the top, including the semicolon:

                return '';


                That will disable the snippet that's causing the error message. Disabling the snippet could cause other errors, but it's not likely.
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 51563
                  • 5 Posts
                  Interesting. I see the intent but, very unfortunately, there was no change at all on the site. :-(
                  I continue to sift through the errors and code in hopes that something will jump out at me. I DID find out that there were some issues with the owners email in the last couple months. They worked directly with GoDaddy in resolving the issue (supposedly a 'full email'?) - but they ended up transferring his account and changing usernames and passwords. It APPEARS that someone has gone through all the ModX files and updated the new paths and configs (I've checked the four main configs and the include config in the manager and everything seems to be correct). I have also mentioned to the owner the possibility of simply moving to a better hosting site that plays nice with ModX. I'm hoping BlueHost since they are included in your list and I am familiar with their site and settings.

                  Thank you again and, if you have any further suggestions, please keep them coming! My face is sore from whacking it at this wall.

                  Quote from: BobRay at Dec 21, 2015, 02:55 PM
                  Here's something that might get you a little further.

                  In PhpMyAdmin, open the modx_site_snippets table and find the snippet with the ID of 39.

                  Edit the 'snippet' field and add this at very the top, including the semicolon:

                  return '';


                  That will disable the snippet that's causing the error message. Disabling the snippet could cause other errors, but it's not likely.
                  • discuss.answer
                    • 51563
                    • 5 Posts
                    Got It!
                    I used 'test_config.php' to find out that the config.inc.php had the incorrect database_dsn setup. It was set to a full URL path (which, apparently, DID work in the past). However, with whatever was done with all the moving things around, the URL for the database had changed as well. I had referenced my documentation and launched phpMyAdmin from GoDaddy and they differed. Fortunately, test_config.php not only pointed out that it was incorrect but that it was supposed to be setup to 'localhost' (which was actually, also, already set as 'database_server' further up.
                    Thank you both for all your assistance! I'm not sure where I originally had downloaded the test_config (possibly BobRay?) but it was already uploaded to the site and I stumbled across another posting of someone having used it. The lightbulb went off about that time! ;-)

                    Again, thank you so much for all the assistance and support!
                      • 3749
                      • 24,544 Posts
                      I'm glad you got it sorted. smiley
                        Did I help you? Buy me a beer
                        Get my Book: MODX:The Official Guide
                        MODX info for everyone: http://bobsguides.com/modx.html
                        My MODX Extras
                        Bob's Guides is now hosted at A2 MODX Hosting