After upgrading from MODx 2.8.4 to 3.0.1 the site doesn’t load and I get multiple errors in the manager home page, and package manager stuck checking for package updates.
Step to reproduce
I used a similar upgrade process that worked between all 2.x versions. Copying files to a new folder, importing to a new database, running setup/upgrade, etc.
Observed behavior
#1 - The consumer facing website gives these errors.
**Warning** : Undefined array key "modUser" in **/ROOTFOLDER/core/vendor/xpdo/xpdo/src/xPDO/xPDOMap.php** on line **48**
**Notice** : Indirect modification of overloaded element of xPDO\xPDOMap has no effect in **/ROOTFOLDER/core/components/tickets/model/tickets/metadata.mysql.php** on line **26**
**Fatal error** : Allowed memory size of 134217728 bytes exhausted (tried to allocate 67612208 bytes) in **/ROOTFOLDER/core/components/pdotools/model/pdotools/pdotools.class.php** on line **415**
#2 - The manager resource tree doesn’t load, but all sections in the Elements tab loads and the Files sections will load.
#3 - The Manager homepage gives a large red error box in the big panel (normally this shows the BigBrother 2.2 plugin).
TypeError: count(): Argument #1 ($value) must be of type Countable|array, string given
**Errors:**
* /ROOTFOLDER/core/src/Revolution/Processors/Workspace/Packages/GetList.php:218
* MODX\Revolution\Processors\Workspace\Packages\GetList->checkForUpdates(object, Array ( ) ) in /ROOTFOLDER/manager/controllers/default/dashboard/widget.updates.php:78
* modDashboardWidgetUpdates->render() in /ROOTFOLDER/core/src/Revolution/modDashboardWidgetInterface.php:81
* MODX\Revolution\modDashboardWidgetInterface->process() in /ROOTFOLDER/core/src/Revolution/modDashboardWidget.php:134
* MODX\Revolution\modDashboardWidget->getContent(object) in /ROOTFOLDER/core/src/Revolution/modDashboard.php:122
* MODX\Revolution\modDashboard->render(object, object) in /ROOTFOLDER/manager/controllers/default/welcome.class.php:109
* WelcomeManagerController->process(Array ( ) ) in /ROOTFOLDER/core/src/Revolution/modManagerController.php:178
* MODX\Revolution\modManagerController->render() in /ROOTFOLDER/core/src/Revolution/modManagerResponse.php:114
* MODX\Revolution\modManagerResponse->outputContent(Array ( ) ) in /ROOTFOLDER/core/src/Revolution/modManagerRequest.php:173
* MODX\Revolution\modManagerRequest->prepareResponse() in /ROOTFOLDER/core/src/Revolution/modManagerRequest.php:143
* MODX\Revolution\modManagerRequest->handleRequest() in /ROOTFOLDER/manager/index.php:60
#4 - Then finally the package manager will not load the list of existing package and shows a spinner saying it is checking for package updates.
You might have better luck if you install UpgradeMODX in the MODX 2 site and use it to upgrade. You’ll need to change the value of the ugm_show_modx3 System Setting to “Yes” in order for UGM to show the MODX 3 upgrade. Upgrade to MODX 3.0.0 first, then 3.0.1. After the upgrade, delete all files in the core/cache directory and clear your browser cache and cookies before testing.
If you still have trouble, try disabling your dashboard widgets. Go into the database in PhpMyAdmin. In the modx_dashboard_widget_placement table, delete all the records. Be careful about the table name - the table should have only three fields: dashboard, widget, and rank.
That won’t affect the widgets themselves, but it will remove them from all dashboards. You can put them back later.
After each upgrade to 3.0 and 3.01 it has roughly the same issue.
Site won’t load
resources tree won’t load in manager
manger home page or dashboard has big red error box
package manager stuck on checking for package updates.
I deleted the dashboard widgets and the dashboard is empty with no errors. So that does sort of fix #3 temporarily. Right now only the UpgradeMODx widget is on the dashboard to make the second upgrade.
EDIT:
I did figure out which dashboard widget is causing the problem. One called: Updates Checks for available updates for core and extras.
Also figured out PHP 8.0 is keeping the package manager and resource tree from loading. Dropping down to 7.4 fixed those.
The one big remaining problem seems to be the actual site showing:
Fatal error : Allowed memory size of 134217728 bytes exhausted (tried to allocate 67612208 bytes) in /ROOTFOLDER/core/components/pdotools/model/pdotools/pdotools.class.php on line 415
Whenever an attempt to view the site is made the system logs creates a double line each time:
[2022-10-12 03:09:05] (ERROR @ /ROOTFOLDER/core/components/pdotools/model/pdotools/pdofetch.class.php : 1089) [pdoTools] Could not load collection of “modResource”: Error 23000: Column ‘id’ in field list is ambiguous
[2022-10-12 03:09:05] (ERROR @ /ROOTFOLDER/core/components/pdotools/model/pdotools/pdofetch.class.php : 1089) [pdoTools] Could not load collection of “modResource”: Error 23000: Column ‘id’ in field list is ambiguous
If returning to PHP 8.0 still leaves you with a broken package manager - in my experience, this will likely be caused by an extra which doesn’t play well with PHP 8.0 and / or MODX 3.x.
findParent and Batcher are examples of extras which have caused this behaviour in the package manager for me in 3.x. getDate has caused this issue for others. There will be other offenders.
My original solution was to remove the extra from the modx_transport_packages table - but @halftrainedharry provided a simpler solution: change the value of the column “provider” to 0 for the offending row in the database table modx_transport_packages (instead of deleting the whole row).
It may take some trial and error but you should be able to find the culprit this way.
Look out for older extras and you can also check this Sitedash list for non-modx3-compatible extras.
Are you saying the Search Driver Class needs to be set to SimpleSearchDriverBasic (which it is) or does it need the full URL of \SimpleSearch\Driver\SimpleSearchDriverBasic
It also looks like there is a Search Driver Class Path field which is empty.
One more problem related to PHP 8.0. The site gets the following message inserted above every page on the site. If I revert back to PHP 7.4 then the message goes away.
Warning : Undefined array key “modUser” in /ROOTFOLDER/core/vendor/xpdo/xpdo/src/xPDO/xPDOMap.php on line 48
Notice : Indirect modification of overloaded element of xPDO\xPDOMap has no effect in /ROOTFOLDER/core/components/tickets/model/tickets/metadata.mysql.php on line 26
Is this likely to be a problem with xPDO itself or with some pdoTools? The page does mostly render below the message with some bad formating in the top navigation area. Both pdoField and pdoMenu are used in the top nav on every page of the site.