Page MenuHomePhabricator

ERROR: "Content model must be stored in the database for multi content revision migration"
Closed, InvalidPublic

Description

At this wiki, I'm getting the following error message:

MWException from line 264 of /opt/mediawiki/1.33.0/includes/Revision/RevisionStore.php: Content model must be stored in the database for multi content revision migration.

when trying to run update.php for a MediaWiki 1.33 upgrade. The SQL in the database is from a 1.15.1 mediawiki

How can I upgrade this wiki properly or get update.php to run?

Event Timeline

Answering myself:
It comes from this line of code in RevisionStore.php where the hasMcrSchemaFlags concept is connected. Is there a COMPAT flag I can use?

I'm going to try

$wgActorTableSchemaMigrationStage = SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_OLD

What're the previous lines output of update.php?

Creating uploadstash table ...done.
Creating user_former_groups table ...done.
Adding rev_sha1 field to table revision ...done.
...batch conversion of user_options: [8c1d711dfd82a2a456414ac5] [no req]   MWException from line 264 of /opt/mediawiki/1.33.0/includes/Revision/RevisionStore.php: Content model must be stored in the database for multi content revision migration.
Backtrace:
#0 /opt/mediawiki/1.33.0/includes/Revision/RevisionStoreFactory.php(140): MediaWiki\Revision\RevisionStore->setContentHandlerUseDB(boolean)
#1 /opt/mediawiki/1.33.0/includes/ServiceWiring.php(471): MediaWiki\Revision\RevisionStoreFactory->getRevisionStore()
#2 /opt/mediawiki/1.33.0/includes/libs/services/ServiceContainer.php(430): Wikimedia\Services\ServiceContainer->{closure}(MediaWiki\MediaWikiServices)
#3 /opt/mediawiki/1.33.0/includes/libs/services/ServiceContainer.php(414): Wikimedia\Services\ServiceContainer->createService(string)
#4 /opt/mediawiki/1.33.0/includes/MediaWikiServices.php(803): Wikimedia\Services\ServiceContainer->getService(string)
#5 /opt/mediawiki/1.33.0/includes/ServiceWiring.php(457): MediaWiki\MediaWikiServices->getRevisionStore()
#6 /opt/mediawiki/1.33.0/includes/libs/services/ServiceContainer.php(430): Wikimedia\Services\ServiceContainer->{closure}(MediaWiki\MediaWikiServices)
#7 /opt/mediawiki/1.33.0/includes/libs/services/ServiceContainer.php(414): Wikimedia\Services\ServiceContainer->createService(string)
#8 /opt/mediawiki/1.33.0/includes/MediaWikiServices.php(787): Wikimedia\Services\ServiceContainer->getService(string)
#9 /opt/mediawiki/1.33.0/includes/Revision.php(76): MediaWiki\MediaWikiServices->getRevisionLookup()
#10 /opt/mediawiki/1.33.0/includes/Revision.php(138): Revision::getRevisionLookup()
#11 /opt/mediawiki/1.33.0/extensions/Gadgets/includes/MediaWikiGadgetsDefinitionRepo.php(139): Revision::newFromTitle(Title)
#12 /opt/mediawiki/1.33.0/extensions/Gadgets/includes/MediaWikiGadgetsDefinitionRepo.php(108): MediaWikiGadgetsDefinitionRepo->fetchStructuredList()
#13 /opt/mediawiki/1.33.0/includes/libs/objectcache/WANObjectCache.php(1414): MediaWikiGadgetsDefinitionRepo->{closure}(boolean, integer, array, NULL)
#14 /opt/mediawiki/1.33.0/includes/libs/objectcache/WANObjectCache.php(1275): WANObjectCache->doGetWithSetCallback(string, integer, Closure, array)
#15 /opt/mediawiki/1.33.0/extensions/Gadgets/includes/MediaWikiGadgetsDefinitionRepo.php(115): WANObjectCache->getWithSetCallback(string, integer, Closure, array)
#16 /opt/mediawiki/1.33.0/extensions/Gadgets/includes/MediaWikiGadgetsDefinitionRepo.php(31): MediaWikiGadgetsDefinitionRepo->loadGadgets()
#17 /opt/mediawiki/1.33.0/extensions/Gadgets/includes/GadgetRepo.php(71): MediaWikiGadgetsDefinitionRepo->getGadgetIds()
#18 /opt/mediawiki/1.33.0/extensions/Gadgets/includes/GadgetHooks.php(47): GadgetRepo->getStructuredList()
#19 /opt/mediawiki/1.33.0/includes/Hooks.php(174): GadgetHooks::userGetDefaultOptions(array)
#20 /opt/mediawiki/1.33.0/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
#21 /opt/mediawiki/1.33.0/includes/user/User.php(1807): Hooks::run(string, array)
#22 /opt/mediawiki/1.33.0/includes/user/User.php(1819): User::getDefaultOptions()
#23 /opt/mediawiki/1.33.0/maintenance/convertUserOptions.php(96): User::getDefaultOption(string)
#24 /opt/mediawiki/1.33.0/maintenance/convertUserOptions.php(67): ConvertUserOptions->convertOptionBatch(Wikimedia\Rdbms\ResultWrapper, Wikimedia\Rdbms\DatabaseMysqli)
#25 /opt/mediawiki/1.33.0/includes/installer/DatabaseUpdater.php(1195): ConvertUserOptions->execute()
#26 /opt/mediawiki/1.33.0/includes/installer/DatabaseUpdater.php(489): DatabaseUpdater->doMigrateUserOptions()
#27 /opt/mediawiki/1.33.0/includes/installer/DatabaseUpdater.php(453): DatabaseUpdater->runUpdates(array, boolean)
#28 /opt/mediawiki/1.33.0/maintenance/update.php(203): DatabaseUpdater->doUpdates(array)
#29 /opt/mediawiki/1.33.0/maintenance/doMaintenance.php(96): UpdateMediaWiki->execute()
#30 /opt/mediawiki/1.33.0/maintenance/update.php(266): require_once(string)
#31 {main}

I'm going to try

$wgActorTableSchemaMigrationStage = SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_OLD

That had no effect (same error message).

OK, so I made the mistake of not disabling all extensions prior to running update.php.

My humble apologies.

Changing to invalid since I did not turn off all extensions prior to update.php (I was attempting to upgrade the database while simultaneously enabling a bunch of extensions.)