Content display problems, memory size error and undefined class constant error after update

At some point, the content on the page stopped displaying; part of the HTML code was missing. This only happened on a few pages; on others, everything displayed correctly. All pages differed only in content (the templates were the same). I contacted MODX support and received a response that the issue was likely due to an outdated version (2.7.1-pl). Attempts to update to any 3.x.x version resulted in the error:

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 17393240 bytes) in /home/h003302617/novacol.ru/docs/core/components/pdotools/model/pdotools/pdotools.class.php on line 413

I increased the RAM to 512 MB, but that didn’t help.

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 1073741832 bytes) in /home/h003302617/novacol.ru/docs/core/src/Revolution/Filters/modInputFilter.php on line 57

Why it tryes to allocate 1 more GB?

The error also appears in the MODX manager.

Undefined class constant ‘MAJOR_VERSION’
Errors:

#0 /home/h003302617/novacol.ru/docs/core/vendor/guzzlehttp/guzzle/src/functions.php(71): GuzzleHttp\Utils::defaultUserAgent()
#1 /home/h003302617/novacol.ru/docs/core/components/upgrademodx/vendor/guzzlehttp/guzzle/src/Client.php(194): GuzzleHttp\default_user_agent()
#2 /home/h003302617/novacol.ru/docs/core/components/upgrademodx/vendor/guzzlehttp/guzzle/src/Client.php(75): GuzzleHttp\Client->configureDefaults(Array)
#3 /home/h003302617/novacol.ru/docs/core/components/upgrademodx/model/upgrademodx/upgrademodx.class.php(178): GuzzleHttp\Client->__construct()
#4 /home/h003302617/novacol.ru/docs/core/cache/includes/elements/modx/revolution/modsnippet/44.include.cache.php(75): UpgradeMODX->init()
#5 /home/h003302617/novacol.ru/docs/core/src/Revolution/modScript.php(88): include(‘/home/h00330261…’)
#6 /home/h003302617/novacol.ru/docs/core/src/Revolution/modDashboardSnippetWidget.php(33): MODX\Revolution\modScript->process(NULL)
#7 /home/h003302617/novacol.ru/docs/core/src/Revolution/modDashboardWidgetInterface.php(83): MODX\Revolution\modDashboardSnippetWidget->render()
#8 /home/h003302617/novacol.ru/docs/core/src/Revolution/modDashboardWidget.php(134): MODX\Revolution\modDashboardWidgetInterface->process()
#9 /home/h003302617/novacol.ru/docs/core/src/Revolution/modDashboard.php(122): MODX\Revolution\modDashboardWidget->getContent(Object(WelcomeManagerController))
#10 /home/h003302617/novacol.ru/docs/manager/controllers/default/welcome.class.php(110): MODX\Revolution\modDashboard->render(Object(WelcomeManagerController), Object(MODX\Revolution\mysql\modUser))
#11 /home/h003302617/novacol.ru/docs/core/src/Revolution/modManagerController.php(180): WelcomeManagerController->process(Array)
#12 /home/h003302617/novacol.ru/docs/core/src/Revolution/modManagerResponse.php(114): MODX\Revolution\modManagerController->render()
#13 /home/h003302617/novacol.ru/docs/core/src/Revolution/modManagerRequest.php(173): MODX\Revolution\modManagerResponse->outputContent(Array)
#14 /home/h003302617/novacol.ru/docs/core/src/Revolution/modManagerRequest.php(143): MODX\Revolution\modManagerRequest->prepareResponse()
#15 /home/h003302617/novacol.ru/docs/manager/index.php(60): MODX\Revolution\modManagerRequest->handleRequest()
#16 {main}

I don’t understand how to fix the content display issue. If the issue is version related, how can I properly update MODX? Current php version 7.4

The problem seems to occur when you run the extra UpgradeMODX to upgrade MODX, and the code tries to download the latest MODX version using Guzzle.
Not sure why the error occurs. Maybe there are conflicting Guzzle versions between the version MODX uses and the version of the UpgradeMODX extra?

Try doing a manual upgrade, instead of using UpgradeMODX.

Also, maybe try upgrading to the latest version of MODX 2.x (2.8.8-pl) first.
(Upgrading to MODX 3 can be tricky sometimes, and some installed extras may not be compatible with MODX 3.)


I’m not sure the version of MODX is the issue here.
Although upgrading to MODX 2.8.8-pl certainly isn’t a bad idea, you should investigate what in the content of the page triggers the issue.
Also make sure that all the installed extras on your site are up-to-date.

This in in the UpgradeMODX docs:

Version 2.3.x of UpgradeMODX is fully tested in MODX 3. It can be used to upgrade from MODX 2.8.x to MODX 3.x.x.

So try upgrading to MODX 2.8.0 first (manually, if necessary).

The current version of UGM has this:

'requires' => array(
        'guzzle7' => '>=1.0.0-pl',
),

If Upgrading to 2.8.0 doesn’t help, I see that Mark Hamstra’s Guzzle7 extra is at Version 7.8.1-pl

I wonder if updating the Guzzle7 extra to that version would help (or make things worse). Sometimes I wish I had just continued using cURL.