Page MenuHomePhabricator

CI failures in php70: Undefined constant 'Wikibase\Client\Store\NS_MAIN'
Closed, ResolvedPublicPRODUCTION ERROR

Description

On several Gerrit changes, @WMDE-leszek, @Ladsgroup and @Lucas_Werkmeister_WMDE have gotten errors like the following:

14:51:14 11) Wikibase\Client\Tests\Usage\SiteLinkUsageLookupTest::testGetPagesUsing
14:51:14 Error: Undefined constant 'Wikibase\Client\Store\NS_MAIN'
14:51:14 
14:51:14 /home/jenkins/workspace/mediawiki-extensions-php70-jessie/src/extensions/Wikibase/client/includes/Usage/SiteLinkUsageLookup.php:129
14:51:14 /home/jenkins/workspace/mediawiki-extensions-php70-jessie/src/extensions/Wikibase/client/includes/Usage/SiteLinkUsageLookup.php:148
14:51:14 /home/jenkins/workspace/mediawiki-extensions-php70-jessie/src/extensions/Wikibase/client/includes/Usage/SiteLinkUsageLookup.php:94
14:51:14 /home/jenkins/workspace/mediawiki-extensions-php70-jessie/src/extensions/Wikibase/client/tests/phpunit/includes/Usage/SiteLinkUsageLookupTest.php:126
14:51:14 /home/jenkins/workspace/mediawiki-extensions-php70-jessie/src/tests/phpunit/MediaWikiTestCase.php:423
14:51:14 /home/jenkins/workspace/mediawiki-extensions-php70-jessie/src/maintenance/doMaintenance.php:94

Example job: console

This only happens in the mediawiki-extensions-php70-jessie job, which is only part of the “gate-and-submit” and “php5” queues, so these errors typically don’t become visible until merge.

Any ideas what might cause this?

Event Timeline

Change 436035 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@master] Don’t use NS_MAIN as default function argument

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

@Smalyshev do you have an idea what's going on here? asking you as the token php guy ;)

Change 436045 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@master] Fully qualify NS_MAIN when used as function default argument

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

Change 436035 abandoned by Lucas Werkmeister (WMDE):
Don’t use NS_MAIN as default function argument

Reason:
superseded by Ia01bdaa465

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

According to @Aleksey_WMDE on IRC, this seems to be a bug in PHP 7.0.30 (can’t reproduce in 7.0.22 or 7.1.17) where constants must be fully qualified when used in a function default argument.

Also failing for me with PHP 7.0.27.

Change 436045 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Fully qualify NS_MAIN when used as function default argument

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

Fix is merged, should work now after a recheck. (Since php70 is only in gate-and-submit, IIUC no rebase should be necessary.)

By the way, we have not yet been able to reproduce this bug in a smaller code sample (my attempt) :/

Change 436067 had a related patch set uploaded (by Jforrester; owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@wmf/1.32.0-wmf.5] Don’t use NS_MAIN as default function argument

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

Interestingly enough, it works for me (pre-patch) just fine on local Vagrant with PHP 7.0.27-0+deb9u1. I'll try to upgrade to 7.0.30 and see what's the diff.

Debian Stretch doesn't seem to have 7.0.30 package. CI is running 7.0.30-1+0~20180505045929.18+jessie~1.gbpcfecb9. I wonder where that package is coming from... It is possible in theory that some bug crept in between .27 and .30, though I do not see any substantial patches that could have caused it. But having the actual binary would probably help.

Change 436069 had a related patch set uploaded (by Jforrester; owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@wmf/1.32.0-wmf.5] Fully qualify NS_MAIN when used as function default argument

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

Change 436067 abandoned by Jforrester:
Don’t use NS_MAIN as default function argument

Reason:
Wrong one.

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

OK, I updated local Vagrant to 7.0.30-1+0~20180505045735.18+stretch~1.gbpcfecb9 and it still works just fine. Now it's officially weird.

The only major difference I can think of then is that the nodepool images are using Debian Jessie, not Stretch.

Stashbot subscribed.

Mentioned in SAL (#wikimedia-operations) [2018-05-29T19:16:40Z] <thcipriani> cutting branch for wmf.6, will not deploy wmf.6 as wmf.5 is not currently on group2 as the train is blocked on T195514 which is blocked on T195868 which is blocked on T195906

Change 436069 merged by Thcipriani:
[mediawiki/extensions/Wikibase@wmf/1.32.0-wmf.5] Fully qualify NS_MAIN when used as function default argument

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

Jdforrester-WMF lowered the priority of this task from Unbreak Now! to High.May 29 2018, 8:51 PM

No longer blocking merges, AFAICT.

Ladsgroup assigned this task to Lucas_Werkmeister_WMDE.

This is done and it's not happening anymore.

Vvjjkkii renamed this task from CI failures in php70: Undefined constant 'Wikibase\Client\Store\NS_MAIN' to j2baaaaaaa.Jul 1 2018, 1:07 AM
Vvjjkkii reopened this task as Open.
Vvjjkkii removed Lucas_Werkmeister_WMDE as the assignee of this task.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed subscribers: gerritbot, Aklapper.
thcipriani renamed this task from j2baaaaaaa to CI failures in php70: Undefined constant 'Wikibase\Client\Store\NS_MAIN'.Jul 1 2018, 7:34 PM
thcipriani closed this task as Resolved.
thcipriani assigned this task to Lucas_Werkmeister_WMDE.
thcipriani updated the task description. (Show Details)
mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:09 PM