Topic on Project:Support desk

Resolving "ComposerInstalled.php" error

15
Summary by TiltedCerebellum

User pulled the latest updates for 1.35.1 and got things working again.

Minoa (talkcontribs)

This morning we began testing for the upgrade from MediaWiki 1.34.0 MediaWiki 1.35.0, but after upgrading, the Special:Version special page complains about not being able to modify header information, as well as trying but assumedly failing to access values in "ComposerInstalled.php".

Here is the whole log:

  • MySQL 5.7.26
  • PHP 7.4.2

I am keen to resolve this error so that it does not overwhelm the PHP error logs. Just to clarify, I have updated all the extensions to be compatible with 1.35: the extra extensions are: Disambiguator, GeoData, LabeledSectionTransclusion, MobileFrontend, TemplateStyles, TimedMediaHandler, AbuseFilter, AntiSpoof, CheckUser, ConfirmAccount, DismissableSiteNotice, Echo, SandboxLink, UploadsLink, UserMerge.

Ammarpad (talkcontribs)

On the Special:Version under the "Installed libraries" section what do you see? I guess there are some rows with empty content under the "library" column? If that's true, please post the remaining content of such rows here.

Also you can try to first delete the entire content of the vendor directory and get new one by issuing composer update --no-dev command, because probably the libraries metadata has been tempered with though I am not sure what could have caused this.

Minoa (talkcontribs)

I also made sure that I used composer under PHP 7.4.2.

AdamPloof (talkcontribs)

I came across what I believe to be a similar problem today. When I navigate to the Special:Version page I get multiple notices about unidentified indexes in:

...\libs\composer\ComposerInstalled.php (on lines 30, 31, & 32)


Under "Installed Libraries" of the Special:Version page there is nothing listed. I did try deleting the contents of the vendor directory and reinstalling with composer, but the problem did not go away. I did recently upgrade to Composer 2.0.8 which makes me suspicious that there is some incompatibility there.

TiltedCerebellum (talkcontribs)

I'm getting the same errors with Composer version 2.0.11, I'll try disabling extensions one by one and following the advice above. I had to install composer for a friend and came across this right after install and fixing Widgets extension which wouldn't install via its zip method for the friend doing it. Actually, no empty things under the library column.

Product Version
MediaWiki 1.35.0
PHP 7.4.12 (cgi-fcgi)
MySQL 5.7.28-log
ICU 57.1
Lua 5.1.5

In our case it was Extension:Widgets (Not to be confused with Gadgets which comes with MW. I had just finished filing another bug report for Article::getTouched was deprecated, so I don't think Widgets is fully 1.35 compatible... have folks here checked if they have Widgets installed?). I eliminated Disambiguator, LabeledSectionTransclusion, AbuseFilter, AntiSpoof, CheckUser, Echo and UserMerge first from our wiki by disabling one by one and retesting.

Cavila (talkcontribs)

@Minoa, did you by any chance use Composer 2 to install extensions? MediaWiki doesn't officially support it yet (maybe the merge plugin does).

TiltedCerebellum (talkcontribs)

Thank you for that. That's information I didn't see since it was only used to update an extension https://phabricator.wikimedia.org/T266417 Composer.

Funny I see a patch merged for this back in 2020 but received no message about it at all. I should have checked though.

Cavila (talkcontribs)

I'm in the same boat I'm afraid. Stuck in the middle of configuring MediaWiki because the Composer version that ships with Plesk is 2.0.7 (Plesk users are a little disgruntled about the situation). It really is unfortunate.

Widgets was a different story for me. No luck adding the extension and Smarty folder manually, but running Composer was what did it.

TiltedCerebellum (talkcontribs)

Yeah, composer install for my friend's server worked too when the zip version with manually added smarty (various versions) wouldn't work. I could use SSH to manually install an older composer version... but we had other errors from Widgets too https://phabricator.wikimedia.org/T276021 and extension conflicts in the past again emerging, so decided to just remove it for now. We were using it to embed youtube videos, screenshots linking off-site can replace that . We used it for a Sitenotice ad, replaced with theme edit. A FB widget also replaced with static image linking to FB too. Upgrade has been a bumpy process.

Admittedly, these are off-topic for this question, but, some other unanticipated stuff folks might run into during upgrade (to help prevent the goose chase we had):

Cavila (talkcontribs)

Maybe that's too many issues for one topic :) Yes, upgrading MediaWiki and its extensions can be a right pain. I hope fixes will be available soon.

@Minoa, the vital bit in your post that I missed at first is "I also made sure that I used composer under PHP 7.4.2." Unfortunately for you, "MediaWiki is not compatible with PHP 7.4.0 to 7.4.2 due to an upstream bug. Use PHP 7.4.3 or later instead." (see also https://phabricator.wikimedia.org/T246594). If you can upgrade (or downgrade) to any of the recommended versions, that might work.

So use Composer 1.* and either PHP 7.4.3 or higher, or PHP 7.3.19 or higher.

TiltedCerebellum (talkcontribs)

Yeah, sorry was just summarizing with resolutions as to some of the other stuff we ran into on upgrade in case anyone else that might run into the same issues (we had quite a goose chase finding the resolutions for these) along side composer stuff. Admittedly, I should have gone searching for individual posts about each and posted each one there... but would have been really nice for us to find a post like that all in one place while attempting to upgrade.

Cavila (talkcontribs)

I understand. There's no central place for this, which is the sort of community effort you'd expect mediawiki.org could facilitate I guess. Information is available but it is little scattered across the mediawiki and phabricator platforms.

As for the Composer issue, I can see that patches are available. Maybe we should just wait for 1.35.2 to come out.

TiltedCerebellum (talkcontribs)

Yeah, I'm considering this too. My concern is that our host is bugging us to upgrade now, and 1.35.1 is incompatible with our host setup due to T235554. So, our wiki might be forced to use 1.35.0. We have pointed our host to that phab ticket to show we'd upgrade to current version if we could... they seem to think we should jump to 1.35.0 regardless. It's a lot of work to do that then to probably be expected to upgrade again shortly after though. I saw a patch merged for composer a while ago I thought, we pulled the updated branch and thinking this wouldn't be an issue.

Cavila (talkcontribs)

Good news! I pulled the latest updates for 1.35.1 and got things working again. The warning is still there, but is of no real consequence (except that you can't use the --no-plugins parameter while updating Composer - not that it is necessarily a good idea). Thanks to the developers who've been quick to jump into it.

TiltedCerebellum (talkcontribs)

Right on. Glad you can use that one. Wish we could.