We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20197
    • 9 Posts
    Hi,

    I made an upgrade from 2.1 to 2.3 and I can't login into the manager anymore.
    It seems like that the mgr context can't be loaded if an anonymous user wants to open the page. So, I get the following msg: Principal 0 does not have permission to load object of class modContext with primary key: mgr

    How can I set mgr load rights for anonymous users in MySQL? For my page I haven't a login for the frontend.

    Thx for help!

    Thomas

      • 38850
      • 110 Posts
      The table you might be looking for is "modx_access_context".
      Mine looks like the attached image and I only have my admin user and one front-end user.

      This may not help but it's a start.

      I looked all through my database for "anonymous" user group/context settings but can't find them. It's not treated like a normal user group.
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Did you clear your browser cache and cookies for the domain when you upgraded? A stale cookie, or a cached old .js file can cause all kinds of problems with an upgraded site.
          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
          That's a weird error, since an anonymous user would never get past the Manager Login. I'm not sure what that means, but if Susan's suggestion doesn't work (and you should manually delete all files in the core/cache directory after you try it and before logging in), I suspect that you made too big a jump in versions and one of the upgrade steps was missed.
            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
            • 38850
            • 110 Posts
            Maybe this won't help, but Bob said
            an anonymous user would never get past the Manager Login

            I once created a protected area of the site, and sent redirects to non-logged in users. But anonymous users were not being redirected because MODX didn't have "load" capability on the protect pages. In other words, since the anonymous user could never "load" the page, it could not process the redirect. Instead, anonymous users got 404 errors.

            What I'm getting at this, anonymous users would be blocked from the actual manager login page, if they did not have "load" capability on it, instead they would get a 404 as if the page didn't exist.

            It sounds like something with anonymous permissions is what got screwed up.
              • 3749
              • 24,544 Posts
              That's a good point. The Anonymous user group has a default Context Access ACL for the web context with a policy of "Load Only" and a minimum role of member. If that got deleted it might cause the OP's problem.
                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
                • 20197
                • 9 Posts
                Hi, thanks for your answers!

                It seems like that is it a problem since version 2.3.1. I used this tutorial to update Modx by using GIT.


                So, I did the following to update from 2.1 to 2.3:
                Changed from 'v2.2.1-pl' -> 'v2.2.9-pl' -> v2.2.16-pl // All is OK
                Changed from 'v2.2.16-pl' -> 'v2.3.0-pl' // All is OK

                After I updated successfully, I went into the next step to install the latest version (2.3.2):
                Changed from 'v2.3.0-pl' -> 'v2.3.2-pl' // Can't Access Manager
                Changed from 'v2.3.2-pl' -> 'v2.3.1-pl' // Can't Access Manager
                Changed from 'v2.3.1-pl' -> 'v2.3.0-pl' // 2.3.0 is working again

                It seems like that the reason why I can't access the manager is a change in 2.3.1.

                My WebServer configuration:
                HAPROXY (only SSL) -> Apache2 (non SSL)

                So I have to set always '$isSecureRequest = true;' in the config manually. But this is not the problem in this case.

                There are any ideas, which change it could be in 2.3.1?


                Thanks for help!

                Thomas [ed. note: MoonMaker last edited this post 11 years, 10 months ago.]
                  • 38850
                  • 110 Posts
                  I can only say that the error should hopefully be found in some kind of log somewhere.

                  1) The MODX log? Since you can't get in manager, I wonder if you can read the log out of the database directly or filesystem to look. I don't know how to access the MODX log this way offhand.

                  2) PHP log. If you can access the PHP log, do it. If you can, turn on ALL PHP errors just to help you see if anything at all might be the case. You can even edit the main index.php file and use the the code
                  error_reporting(-1);
                  to see if you can get a response.

                  3) Apache error log, just in case something shows up there.

                  4) Browser log. Open development tools and look at the response codes of the page, is it a 200 or something else? Maybe only specific parts are failing to load?

                  5) Server logs. You may have a clue somewhere in access logs, or there is a "higher up" error that is caught by the server before it gets any farther down the chain.


                  Can you create a subdomain or subfolder of your hosting site and install a new fresh copy just to see if it works well? If so, you might look for differences in the database for anonymous access or group access, ACLs etc.

                  If even a fresh install doesn't work, I would be suspecting server configuration at that point, something not right in apache or PHP configs. Does your environment fully support requirements of that version of MODX?

                  I'm sure there is a solution here, probably a simple one.
                  If installing a fresh version works fine, I would suggest finding a MODX migration tool (they do exist) where you can use a fresh install, but migrate over your specific data and other settings.

                  Sorry you're having troubles!