MODX Manager resource tree empty on half of sites on the same server

Summary

MODX Manager tree resource tree is empty on half of MODX sites on the same server.
Even with full admin rights.
Elements- and Files-trees, CMP of extras, Media Browser, Manage- and Settingsmenu and frontends are working correct.
But creating, editing of resources and logout e.g. not!

Dev Tools errors

Uncaught SyntaxError: expected expression, got '<'
    ExtJS 2
    onLoad https://www.domain.tld/rs/assets/modext/widgets/core/tree/modx.tree.js:153
    ExtJS 4
    f https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    m https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    createCallback https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    setInterval handler*n https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    i https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    request https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    ExtJS 9
    _initExpand https://www.domain.tld/rs/assets/modext/widgets/resource/modx.tree.resource.js:63
    ExtJS 6
    createDelegate https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    ExtJS 4
    f https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    m https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    createCallback https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    setInterval handler*n https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    i https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    request https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    ExtJS 4
    fn https://www.domain.tld/rs/assets/modext/widgets/core/tree/modx.tree.js:175
    ExtJS 31
    S https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    S https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    S https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    Layout https://www.domain.tld/rs/assets/modext/core/modx.layout.js:37
    Default https://www.domain.tld/rs/templates/default/js/layout.js:6
    create ExtJS
    load https://www.domain.tld/rs/assets/modext/core/modx.js?v=08390b82:85
    <anonymous> https://www.domain.tld/rs/?a=system/event:52
    ExtJS 10
ext-all.js:1:2
Uncaught SyntaxError: expected expression, got '<'
    ExtJS 2
    onLoad https://www.domain.tld/rs/assets/modext/widgets/core/tree/modx.tree.js:153
    ExtJS 4
    f https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    m https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    createCallback https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    setInterval handler*n https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    i https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    request https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    ExtJS 9
    _initExpand https://www.domain.tld/rs/assets/modext/widgets/resource/modx.tree.resource.js:63
    ExtJS 6
    createDelegate https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    ExtJS 4
    f https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    m https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    createCallback https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    setInterval handler*n https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    i https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    request https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    ExtJS 4
    fn https://www.domain.tld/rs/assets/modext/widgets/core/tree/modx.tree.js:175
    ExtJS 31
    S https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    S https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    S https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    Layout https://www.domain.tld/rs/assets/modext/core/modx.layout.js:37
    Default https://www.domain.tld/rs/templates/default/js/layout.js:6
    create ExtJS
    load https://www.domain.tld/rs/assets/modext/core/modx.js?v=08390b82:85
    <anonymous> https://www.domain.tld/rs/?a=system/event:52
    ExtJS 10
ext-all.js:1:2
    ExtJS 2
    onLoad https://www.domain.tld/rs/assets/modext/widgets/core/tree/modx.tree.js:153
    ExtJS 4
    f https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    m https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    createCallback https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    (Async: setInterval handler)
    n https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    i https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    request https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    ExtJS 9
    _initExpand https://www.domain.tld/rs/assets/modext/widgets/resource/modx.tree.resource.js:63
    ExtJS 6
    createDelegate https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    ExtJS 4
    f https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    m https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    createCallback https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    (Async: setInterval handler)
    n https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    i https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    request https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    ExtJS 4
    fn https://www.domain.tld/rs/assets/modext/widgets/core/tree/modx.tree.js:175
    ExtJS 31
    S https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    S https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    S https://www.domain.tld/rs/assets/ext3/adapter/ext/ext-base.js:21
    Layout https://www.domain.tld/rs/assets/modext/core/modx.layout.js:37
    Default https://www.domain.tld/rs/templates/default/js/layout.js:6
    create ExtJS
    load https://www.domain.tld/rs/assets/modext/core/modx.js?v=08390b82:85
    <anonymous> https://www.domain.tld/rs/?a=system/event:52
    ExtJS 10

PHP errors

Fatal error: Uncaught TypeError: Unsupported operand types: float + string in /var/www/vhosts/domain.tld/modx-core-123/model/modx/registry/moddbregister.class.php:128 Stack trace: #0 /var/www/vhosts/domain.tld/modx-core-123/model/modx/moduser.class.php(776): modDbRegister->read() #1 /var/www/vhosts/domain.tld/modx-core-123/model/modx/moduser.class.php(220): modUser->removeLocks() #2 /var/www/vhosts/domain.tld/modx-core-123/model/modx/moduser.class.php(427): modUser->endSession() #3 /var/www/vhosts/domain.tld/modx-core-123/model/modx/processors/security/logout.class.php(60): modUser->removeSessionContext() #4 /var/www/vhosts/domain.tld/modx-core-123/model/modx/processors/security/logout.class.php(83): modSecurityLogoutProcessor->removeSessionContexts() #5 /var/www/vhosts/domain.tld/modx-core-123/model/modx/modprocessor.class.php(185): modSecurityLogoutProcessor->process() #6 /var/www/vhosts/domain.tld/modx-core-123/model/modx/modx.class.php(1770): modProcessor->run() #7 /var/www/vhosts/domain.tld/httpdocs/rs/controllers/default/security/logout.class.php(31): modX->runProcessor() #8 /var/www/vhosts/domain.tld/modx-core-123/model/modx/modmanagercontroller.class.php(155): SecurityLogoutManagerController->process() #9 /var/www/vhosts/domain.tld/modx-core-123/model/modx/modmanagerresponse.class.php(79): modManagerController->render() #10 /var/www/vhosts/domain.tld/modx-core-123/model/modx/modmanagerrequest.class.php(187): modManagerResponse->outputContent() #11 /var/www/vhosts/domain.tld/modx-core-123/model/modx/modmanagerrequest.class.php(135): modManagerRequest->prepareResponse() #12 /var/www/vhosts/domain.tld/httpdocs/rs/index.php(59): modManagerRequest->handleRequest() #13 {main} thrown in /var/www/vhosts/domain.tld/modx-core-123/model/modx/registry/moddbregister.class.php on line 128

Environment

MODX 2.8.6
Ubuntu 18.04
Plesk 18.0.57
Apache 2.4.29
PHP 8.2.13

What I tried so far

  • Reinstalled MODX
  • compared Apache and PHP settings and installed MODX extras on working and non-working instances
  • Plesk check and repair
  • Analyzed via SiteDash
  • Searched the web for two days :nerd_face:

Would appriciate any hints or ideas! Thx!

Could you check your browsers dev tools Network tab for anything unusual when you load the Manager page?

Can you change this line in the code

to this

$expires = $startTime + intval($timeLimit);

and check if that resolves the issue?

Thanks a lot @halftrainedharry !
This solves the issue, but only for users with admin rights.
Editors now get the login message: Access denied.

Any further ideas to get it solved for editors, too? :pray:

Should I post this issues/bug on GitHub?
Will there be a patch or new MODX version soon?

Nothing ununsual here. Thanks for asking!

Yes, do that. Otherwise it won’t get fixed.


Somehow I’m not able to reproduce the issue, even with PHP 8.2.
Any idea why other of your sites work correctly? Other PHP versions, other MODX versions, other server settings?

No idea. Same MODX version, PHP version, same (or almost same) server setting due to same Plesk service plan. I compared a lot the last two days… :star_struck:

The code uses the server setting max_execution_time in the line that produces the error.
Does this setting have a different value than other sites of yours?

Thanks for the good hint!
max_execution_time was empty on all that affected instances instead of „30 (Default)“. Didn’t saw that. :see_no_evil:

But strangely this does not solve the issue on all sites:
On a view it does (even without the $expires = $startTime + intval($timeLimit); hack).
On one site it is solved only with the help of the hack.
On one site the editor can not login (message: Access denied.) even with the hack.

Interesting!

I just could bring back access for editors on the last misfunctional site.
After slightly modifying ACLs - functioning over years so far - by removing unnecessary mgr-permissions-set and setting higher minimum role for editor group, everything seems to work without the hack on this site, too.

So the last site (and only with 3 contexts/websites) I certainly will also be able to repair soon to take out the hack.

Thanks again @halftrainedharry for the help!

To sum it up: Lost max_execution_time in Plesk service plan and inheritance to all affected sites was the main issue. Didn’t know if the last MODX version brought this to an error or not.

Is it the desired behavior that the MODX manager breaks when max_execution_time is not set? I don’t think so and would report this in GitHub. Right? :raising_hand_man:

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.