Upgrade to 3.0 failed with multiple problems

Summary

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.

Did you use the UpgradeMODX extra to upgrade?

Is your core folder outside the web root? That won’t work in MODX 3.

No. The core is in the default location and no special upgrade utilities.

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.

I’ll give that a try and see what happens.

See my edit above for best results.

After each upgrade to 3.0 and 3.01 it has roughly the same issue.

  1. Site won’t load
  2. resources tree won’t load in manager
  3. manger home page or dashboard has big red error box
  4. 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

Did you upgrade pdoTools to the newest?

That fixed it. Site is loading now. I guess I overlooked the PDO Tools update somehow.

I still have some updates in the package manager like Batcher that have an orange update button, but then give an error when clicked.

An error occurred while connecting to the Provider: No Package release found.

maybe, there isn’t a Batcher version, compatible with 3.x

Well, found another problem with SimpleSearch not returning any results and it has been updated to the 3.0.0-alpha version.

Check the system setting “simplesearch.driver_class”. Make sure the value is \SimpleSearch\Driver\SimpleSearchDriverBasic.

Hey @pixelstuff

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.

Hope that helps.

Some other discussions around this issue:

This pull request should fix the problem with the package manager:


There is currently no Batcher version for MODX 3. I did a rewrite but AFAIK that hasn’t been released.

2 Likes

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.

What would be triggering the orange update button if there isn’t an update.

  • I have another package called Favicons that doesn’t seem to even exist in the store anymore. It shows an update button in 3.0.1, but not in 2.8.4.

  • There is also sekFancyBox showing the same update notice and error when trying to update.

Is there something inside the package that lists the maximum version compatible, so MODx 3 is prompting to update even if it doesn’t see one?

EDIT: it appears that the Package Manager fix for PHP 8, also fixes the update buttons. Fix Package Manager handling of API error by halftrainedharry · Pull Request #16217 · modxcms/revolution · GitHub

Yes, it needs the fully qualified class name.

On update this value should get overwritten but there is a bug in the current version.

Thanks, that fixed the SimpleSearch issue.

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.