401 error - Manager does not load completely (MODX 2.8.4)

there is a strange issue with a MODX 2.8.4 on PHP 7.4 installation. There has been no server moving.

After logging in into /manager the page remains blank. When calling an action, such as

the top div #modx-header is visible, but the rest of the page is blank.

The web context is working, the mgr context does not. Not sure what has gone wrong …

I checked config settings and htaccess, everything seems fine. In the browser console, I’m getting "Uncaught SyntaxError: unexpected token: ‘:’ " in modx.config.js.php:1:10


Uncaught TypeError: MODx.config.upload_files is undefined

In the error log (cache/logs) I’m getting:
[2023-06-29 21:04:46] (ERROR @ /xyz/core/model/modx/modmanagercontrollerdeprecated.class.php : 152) Could not find action file at: /kunden/102604_85625/dw/modx/modx-2.2.8-pl/manager/controllers/default/login

But … there should not be a file named login in the first place ??

I’m stuck here, would be very glad and thankful if somebody can give me hints here. Thanks!


Did you take a look at the connectors/modx.config.js.php file? (Maybe compare it to the one of a working installation.)

I believe this is the system setting upload_files. Does such a setting exist?
(SELECT * FROM `modx_system_settings` WHERE `key` = 'upload_files';)

Yes, upload_files contains a comma-separated list of files you can upload. It also affects the saving of files. Maybe a Manager widget or plugin is trying to save a file that’s not on the list. For example, I don’t think .log files are on the list. I don’t think .php files are either.

If you try reload the Manager page with dev. tools on in Chrome or Firefox (Ctrl-shift-i) , and look at the network tab, you should see the 401 error. If you click on it you can see the details of the request, which might tell you more about what the problem is.

You can also try incognito or Private mode in the browser to see if it might be a cache or cookie issue.

Please check wether the content of the output of connectors/modx.config.js.php is a valid JSON. It looks like a setting value contains a not escaped quote sign.

This is the output, calling manager/?a=security/user:
{“success”:false,“message”:“Zugriff verweigert.”,“total”:0,“data”:,“object”:{“code”:401}}

Would the setting value probably be in system settings? So I can check in the database?
Thanks again!

The system settings are in the database table modx_system_settings (and maybe cached in core/cache/system_settings/config.cache.php).

Open the “Network” tab of the developer tools in the browser and make a request to the manager. Then filter the requests for modx.config.js.php. Is the response of this request (what gets assigned to the variable MODx.config = { ... }) valid JSON?

I assume this is the JSON you were mentioning:
{“success”:false,“message”:“Zugriff verweigert.”,“total”:0,“data”:,“object”:{“code”:401}}

Seems valid, or no?

The path of the System Settings Url is

Maybe there is something missing after HTTP_MODAUTH=

Then try to clear your session cookie and/or the session db table.

In the Network Tab of browser DevTools now:

Uncaught SyntaxError: Unexpected token ‘:’ (at modx.config.js.php?a…&HTTP_MODAUTH=:1:11)

Is that : before 1:11 in HTTP_MODAUTH=:1:11 correct?

Thanks again …

The unexpected token error occurs inside of the loaded modx.config.js.php and not outside in the url.

If HTTP_MODAUTH is not set (or filled with :1) in the payload, the user is not logged in right. If this is the case, there can be something wrong with the session cookie or with the session db table of MODX.

If HTTP_MODAUTH is set with something like modx1234567890abc_1234567890abc, the user is logged in right and there is some value issue in the modx config array, that leads to a damaged modx config JSON retrieved with the connector.

This message should be obvious. For whatever reason the value of data is wrong in the forum post. If it is also wrong in the resulting JSON, this can cause the unknown token error.

The error log indicates a problem finding a file named “login” at an unexpected location. You’re unsure why this file should exist. Troubleshooting steps you’ve taken so far include checking file permissions, clearing the MODX cache, disabling conflicting plugins, and enabling error reporting. If these steps don’t resolve the issues, you may need to restore or reinstall certain files, consider updating MODX, or seek assistance from the MODX community or support.