Hi All,
Upgrading a few older sites. From 2.2.16. PHP 5.4.45. Linux/Apache. Hosted by Webfaction. MySQL 5.5.45-37.4
Tried to jump to 2.4.2 but got this error after the Install button is clicked. Note, all the tests passed.
Fatal error: Call to a member function checkPolicy() on a non-object in /...blah/core/model/modx/modx.class.php on line 1880.
The fatal lines in question.
/**
Could this mean the User Object (this) doesn't exist?
So tried an earlier version 2.3.6. Same result. Tried 2.3.0. Same, so not a "too big a jump" thing. Repeated on another website on the same server/setup also at 2.2.16. Same result. In both cases re-installing 2.2.16 works. Suggesting it isn't a "folder not writeable" kind of thing. Note when upgrading using 2.3.0 the checkpolicy call is on line 1876.
Perhaps a database issue, Users not found? But I'm thinking the hosting company setup. Webfaction are awesome (like a VPS for $9.99/month) but they are more Python experts. Perhaps PHP or MySQL has been updated since the installation a year ago.
I had deleted the cache(from the manager). Upgraded all packages (list below) and Flushed Sessions. Then manually deleted the core/cache. And deleted the Firefox Cache on some runs.
Fairly standard Packages. Breadcrumb, FormIt, GetResources, SimpleSearch, SiteAtoZ, TincyMCE, Wayfinder. A few more on the other site.
This is probably a side effect but my notes from last night state...
After deleting core/cache and browser cache - hit back from the error page and got
Warning: array_merge(): Argument #2 is not an array in /...blah/core/xpdo/xpdo.class.php on line 341
Fatal error: Class 'xPDODriver_' not found in /...blah/core/xpdo/xpdo.class.php on line 1880
Probably a side effect of a half installation.
Had a good rummage around for help. But stumped. At least the sites/manager still work at 2.2.16.
Parthian
PS Copied from the forum at Bob's request.
Here is the Re-Installation of 2.2.16 results. Looks nicer in green and red.
Installation Summary
Core installation was successful. Click next to complete the installation process.
(scroll to bottom)
Toggle Success Messages | Toggle Warnings
Config file successfully written.
Config file permissions successfully updated.
Error updating table for class transport.modTransportProvider
Array
(
[0] => 00000
[1] =>
[2] =>
)
Error updating table for class transport.modTransportProvider
Array
(
[0] => 00000
[1] =>
[2] =>
)
Error updating table for class transport.modTransportProvider
Array
(
[0] => 00000
[1] =>
[2] =>
)
Error updating table for class modCategory
Array
(
[0] => 00000
[1] =>
[2] =>
)
Error updating table for class modCategory
Array
(
[0] => 00000
[1] =>
[2] =>
)
Successfully created table for class modAccessNamespace
Successfully upgraded table for class modAccessResourceGroup
Dropped index `principal_class` on table ``modx_access_resource_groups``.
Successfully upgraded table for class modAccessResourceGroup
Added new index on `principal_class` for table ``modx_access_resource_groups``.
Error updating table for class modTemplateVarResourceGroup
Array
(
[0] => 00000
[1] =>
[2] =>
)
Error updating table for class modManagerLog
Array
(
[0] => 00000
[1] =>
[2] =>
)
0 updated
Successfully created table for class modAccessNamespace
Successfully created table for class modExtensionPackage
Successfully created table for class modUserGroupSetting
Error updating table for class modResource
Array
(
[0] => 42000
[1] => 1061
[2] => Duplicate key name 'cache_refresh_idx'
)
Successfully upgraded table for class modActionDom
Modified column `action` from `INT(11)` to `VARCHAR(255)` on table ``modx_actiondom``
Successfully upgraded table for class modFormCustomizationSet
Modified column `action` from `INT(11)` to `VARCHAR(255)` on table ``modx_fc_sets``
Successfully upgraded table for class modActionField
Modified column `action` from `INT(11)` to `VARCHAR(255)` on table ``modx_actions_fields``
Successfully upgraded table for class modMenu
Modified column `action` from `INT(11)` to `VARCHAR(255)` on table ``modx_menus``
Error updating table for class modMenu
Array
(
[0] => 00000
[1] => 1061
[2] => Duplicate key name 'cache_refresh_idx'
)
Error updating table for class modContext
Array
(
[0] => 00000
[1] => 1061
[2] => Duplicate key name 'cache_refresh_idx'
)
Error updating table for class modContext
Array
(
[0] => 00000
[1] => 1061
[2] => Duplicate key name 'cache_refresh_idx'
)
Successfully upgraded table for class transport.modTransportPackage
Modified column `version_major` from `tinyint` to `smallint` on table ``modx_transport_packages``
Successfully upgraded table for class transport.modTransportPackage
Modified column `version_minor` from `tinyint` to `smallint` on table ``modx_transport_packages``
Successfully upgraded table for class transport.modTransportPackage
Modified column `version_patch` from `tinyint` to `smallint` on table ``modx_transport_packages``
Successfully upgraded table for class transport.modTransportPackage
Modified column `release_index` from `tinyint` to `smallint` on table ``modx_transport_packages``
Successfully upgraded table for class modCategory
Successfully upgraded table for class modCategory
Added new index on `category` for table ``modx_categories``.
Error updating table for class transport.modTransportProvider
Array
(
[0] => 00000
[1] => 1061
[2] => Duplicate key name 'cache_refresh_idx'
)
Error updating table for class transport.modTransportProvider
Array
(
[0] => 00000
[1] => 1061
[2] => Duplicate key name 'cache_refresh_idx'
)
Error updating table for class transport.modTransportProvider
Array
(
[0] => 00000
[1] => 1061
[2] => Duplicate key name 'cache_refresh_idx'
)
Error updating table for class transport.modTransportProvider
Array
(
[0] => 00000
[1] => 1061
[2] => Duplicate key name 'cache_refresh_idx'
)
Error updating table for class transport.modTransportProvider
Array
(
[0] => 00000
[1] => 1061
[2] => Duplicate key name 'cache_refresh_idx'
)
Reminder, this is for a succesful installation of 2.2.16 after a failed newer version installation.
Same problems here. After some trying and debugging; the "modx_context" table is missing the "name" field..
So to fix it; try adding "name" in table "modx_context" as a VARCHAR 255 and try running the setup again.
Is this one not covered in some versions between this two @modxcms ?
Super @bertoost. Note that I tried going up in baby steps (from 2.2.16 to 2.3.0 I think it was). So and odd one that this table wasn't updated.
Good timing, had rebuilt the site on my XAMPP and was about to try a local upgrade to rule out Server oddities. Minefield averted. Thanks. Will update the forum with your notes.
Why was this closed, issue persists in 2.5.0-rc1...basically an update form 2.2.x is not possible for the average modx user without this being fixed...IMHO this is a serious issue, no??
Hi @exside, I assumed it was a near one off, as Bob and the team on the forum had no real clues to help. I may have some notes from the time, but I suspect the only real value would be in logs etc that led to the name field being missed out during a previous update. I won't have anything to help there.
I have a blog post on this here. It assumes that the DB changes all occur in the major version debut: (2.2.0, 2.3.0, 2.4.0, 2.5.0), though that could be wrong.
Google really is our friend :-) Thank goodness for this issue, as I just came across it today. All fixed by adding the name field. It's still not showing up as an error during the upgrade process, although there's probably not much point adding it to the DB checks when upgrading now.
for 2.2.0 -> 2.6.0 update I 've met the same error, moved installation two steps back and relauched process again. Everything happened successfully, so for my case name field doesn't neccessary here.
Same happened to me... upgrade from 2.2.10 to 2.6.3... With bertoost's db modification, things worked smoothly! This saved me a lot of debugging... Appreciate it!
This post saved my bacon.
If it helps anyone who isn't SQL literate, here's the query I used to fix the modx_context table:
ALTER TABLE modx_context ADD name VARCHAR(255) NOT NULL AFTER rank;
Most helpful comment
Same problems here. After some trying and debugging; the "modx_context" table is missing the "name" field..
So to fix it; try adding "name" in table "modx_context" as a VARCHAR 255 and try running the setup again.
Is this one not covered in some versions between this two @modxcms ?