Page MenuHomePhabricator

PHP Fatal error running update.php: "Class 'Pimple\Container' not found"
Closed, ResolvedPublic

Description

When I run the update script(update.php) in PuTTY I get the following error(https://i.gyazo.com/3ca3435b84c34b0c748cff41ee8902a9.png) at the bottom of the report:

PHP Fatal error:  Class 'Pimple\Container' not found in /var/www/html/extensions/Flow/includes/Container.php on line 5

My MediaWiki version is: 1.29.0-alpha (42194c9) 19:46, 2017 January 19
My Flow version is: 1.1 (eebd7a1) 22:33, 2017 February 14

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Aklapper renamed this task from PHP Fatal error running update.php to PHP Fatal error running update.php: "Class 'Pimple\Container' not found".Feb 15 2017, 9:47 AM

You have to run:

composer update

in the Flow directory.

If you use the release branch downloads rather than git master, it will handle these libraries for you.

I did the composer update and now I'm getting the following errors at the bottom of my update script report:
https://i.gyazo.com/b46df8917fd95f84a38a3697af04cf50.png
https://i.gyazo.com/a86e4f302fabc5c5facfab761e1a6be1.png

(Please post text as text so search engine can index that text and others can find it. You can use three backticks for a block of output; see the preview below. Thanks!)

Oh sorry. This is the error message I'm getting at the end of the update script:

[e3dd62cafd4ae7c9fe87c1a8] [no req]   MWContentSerializationException from line 73 of /var/www/html/extensions/Flow/includes/Content/BoardContentHandler.php: Failed to decode blob.  It should be JSON representing valid Flow metadata.
Backtrace:
#0 /var/www/html/includes/Revision.php(1095): Flow\Content\BoardContentHandler->unserializeContent(string, string)
#1 /var/www/html/includes/Revision.php(1058): Revision->getContentInternal()
#2 /var/www/html/extensions/Flow/maintenance/FlowFixInconsistentBoards.php(110): Revision->getContent(integer)
#3 /var/www/html/maintenance/Maintenance.php(1577): FlowFixInconsistentBoards->doDBUpdates()
#4 /var/www/html/maintenance/update.php(184): LoggedUpdateMaintenance->execute()
#5 /var/www/html/maintenance/doMaintenance.php(111): UpdateMediaWiki->execute()
#6 /var/www/html/maintenance/update.php(217): require_once(string)
#7 {main}

Did you already have Flow before running update.php, or are you installing for the first time?

It looks like you have pages and/or revisions that are wrongly marked as Flow content model.

If it's a new install (there are no actual Flow boards), you may have done https://www.mediawiki.org/wiki/Extension:Flow#Enabling_or_disabling_Flow in an incorrect order.

Only if there are no Flow boards:

UPDATE page SET page_content_model = null WHERE page_content_model = 'flow-board';
UPDATE revision SET rev_content_model = null WHERE rev_content_model = 'flow-board';
UPDATE archive SET ar_content_model = null WHERE ar_content_model = 'flow-board';

Next, make sure $wgNamespaceContentModels does not set flow-board anywhere.

Next, run:

php maintenance/populateContentModel.php --wiki=somewiki --ns=all --table=revision
php maintenance/populateContentModel.php --wiki=somewiki --ns=all --table=archive
php maintenance/populateContentModel.php --wiki=somewiki --ns=all --table=page

where 'somewiki' is your wiki name.

That should set it back to normal. Then to enable Flow on particular namespaces, follow https://www.mediawiki.org/wiki/Extension:Flow#Enabling_or_disabling_Flow in the given order.

This is not a new install. I had Flow installed before.

Okay, you have a page that is wrongly marked as Flow, or corrupt.

For now, you can just comment out the two lines about FlowFixInconsistentBoards in Hooks.php: https://phabricator.wikimedia.org/diffusion/EFLW/browse/master/Hooks.php;dfa0fa8aa4886b6257e469a4c2bde36409e773cd$308 . After that update.php should work.

Sorry for the inconvenience, currently it is not able to fix that issue. We should at least tell you what is (filed as T158354).

I see. Thanks for the help.

The strange thing is that at first after the composer update my Flow pages(like for example the user talk pages) weren't working and I got a 500 error on those pages, but the next morning everything was working fine, even though I was still getting the the error message I described above in the update script.

Anyways, I commented out the two lines now in the Hooks.php and I'll be looking forward a future fix.

Catrope claimed this task.
Catrope subscribed.

Closing this task because the remainder of it is filed as T158354 already.

I am getting the same issue and even run composer update and also commented the two lines hooks.php but it is not getting solved when I run update script it triggers following errors:

PHP Fatal error: Class 'Pimple\Container' not found in /var/www/html/core/extensions/Flow/includes/Container.php on line 5
Fatal error: Class 'Pimple\Container' not found in /var/www/html/core/extensions/Flow/includes/Container.php on line 5

and when I clicked on Talk option in my localhost it gives following error

Fatal error: Class 'Pimple\Container' not found in /var/www/html/core/extensions/Flow/includes/Container.php on line 5

before installing flow extension talk link worked fine by displaying some page but now it is triggering an error can anyone say how to fix it?

I think the Flow composer settings should be inserted in composer.local.json, with something like this:

	"extra": {
		"merge-plugin": {
			"include": [
				"extensions/Flow/composer.json"
			]
		}
	}

Then, run composer update from the wiki root.