Page MenuHomePhabricator

PHP Notice: Undefined index: path - SpecialVersion.php:520 - getExternalLibraries
Closed, ResolvedPublicPRODUCTION ERROR

Description

Code throwing the exception - https://github.com/wikimedia/mediawiki/blob/f5b78e9c313d8c54cffe61cc24fe82367b023d31/includes/specials/SpecialVersion.php#L520

Exception:

[2019-11-13 12:02:30] error.ERROR: [b0954d8f54817c2e00cf1017] /w/index.php?title=Special:Version   ErrorException from line 520 of /srv/mediawiki/tags/2019-11-06_14:07:42/includes/specials/SpecialVersion.php: PHP Notice: Undefined index: path {"exception":"[object] (ErrorException(code: 0): PHP Notice: Undefined index: path at /srv/mediawiki/tags/2019-11-06_14:07:42/includes/specials/SpecialVersion.php:520)

Details

Request ID
b0954d8f54817c2e00cf1017
Request URL
https://translatewiki.net/wiki/Special:Version
Stack Trace
#0 /srv/mediawiki/tags/2019-11-06_14:07:42/includes/specials/SpecialVersion.php(520): MWExceptionHandler::handleError(8, 'Undefined index...', '/srv/mediawiki/...', 520, Array)
#1 /srv/mediawiki/tags/2019-11-06_14:07:42/includes/specials/SpecialVersion.php(156): SpecialVersion->getExternalLibraries()
#2 /srv/mediawiki/tags/2019-11-06_14:07:42/includes/specialpage/SpecialPage.php(575): SpecialVersion->execute(NULL)
#3 /srv/mediawiki/tags/2019-11-06_14:07:42/includes/specialpage/SpecialPageFactory.php(607): SpecialPage->run(NULL)
#4 /srv/mediawiki/tags/2019-11-06_14:07:42/includes/MediaWiki.php(298): MediaWiki\\Special\\SpecialPageFactory->executePath(Object(Title), Object(RequestContext))
#5 /srv/mediawiki/tags/2019-11-06_14:07:42/includes/MediaWiki.php(967): MediaWiki->performRequest()
#6 /srv/mediawiki/tags/2019-11-06_14:07:42/includes/MediaWiki.php(530): MediaWiki->main()
#7 /srv/mediawiki/tags/2019-11-06_14:07:42/index.php(46): MediaWiki->run()
#8 {main}

Event Timeline

abi_ triaged this task as Medium priority.Nov 13 2019, 1:29 PM
abi_ created this task.
abi_ created this object with edit policy "All Users".

Ran the following command to see if there were any extension credits declared without the path defined but did not find anything,

grep -rn '/www/translatewiki.net/' -e 'ExtensionCredits' -A 6

At the same time, found this, in ApiBase.php

if ( !isset( $ext['path'] ) || !isset( $ext['name'] ) ) {
    // This shouldn't happen, but does anyway.
    continue;
}

While we debug this further on Translatewiki, maybe this check should also also have been done in this patch https://gerrit.wikimedia.org/r/c/541364?

Ping @Reedy

Change 550836 had a related patch set uploaded (by Abijeet Patro; owner: Abijeet Patro):
[translatewiki@master] Add path for Translatewiki.net Magic extension

https://gerrit.wikimedia.org/r/550836

Change 550836 merged by jenkins-bot:
[translatewiki@master] Add path for Translatewiki.net Magic extension

https://gerrit.wikimedia.org/r/550836

abi_ claimed this task.

We found the extension that was missing the path declaration. Fixed and deployed on Translatewiki.net.

Change 550900 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/core@master] Skip extensions that don't have a path attribute set in SpecialVersion::getExternalLibraries()

https://gerrit.wikimedia.org/r/550900

Change 550836 had a related patch set uploaded (by Abijeet Patro; owner: Abijeet Patro):
[translatewiki@master] Add path for Translatewiki.net Magic extension

https://gerrit.wikimedia.org/r/550836

Convert to extension registration ;)

Change 550900 merged by jenkins-bot:
[mediawiki/core@master] Skip extensions that don't have a path attribute set in SpecialVersion::getExternalLibraries()

https://gerrit.wikimedia.org/r/550900