We have several MODX instances which have been running perfectly for several years and are administered via the CLI for certain operations.
After installing PDOTools, the web display works perfectly while CLI calls give errors:
Fatal error: Uncaught Error: Call to a member function parseProperties() on null in /{path}/core/model/modx/modelement.class.php:567
Stack trace: #0 /{path}/core/model/modx/modx.class.php(1672): modElement->getProperties() #1 /{path}/core/model/modx/modx.class.php(570): modX->invokeEvent() #2
/app/web/projects/webtest/ug-stg/my.php(11): modX->initialize() #3 {main} thrown in /{path}/core/model/modx/modelement.class.php on line 567
I tried to install a clean version of MODX: same result.
I tried a simulation on my development server with an identical version of PHP: it works.
With a restore on my development server: it works.
Thank you for your help. Do you have any suggestion to adapt my code or settings? It’s strange: before installing PdoTools, it work fine.
Stranger is that problem occured only in cli mode and not in the browser…
Maybe try resetting the system settings parser_class and parser_class_path to their original values (if you don’t need the parser from pdoTools; e.g. for Fenom) and test if that fixes the issue.
We use a NFS mount point to share MODX-data on several server behind a load balancer.
We use an admin-server to launch some command in CLI-mode.
Path on PROD server are not the same as on ADMIN server.
Some variables are stored on MODX cache, this include path to the parser.
If I called MODX on web side, this corrupt the cache for CLI and if I launched CLI, it corrupted the cache for the web side.
Solution: after initializing MODX, setup $conf var to the right value in CLI-mode.
Thank you to Fabian (pixmill.ch) and Vassily (bezumkin2)
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”.