Page MenuHomePhabricator

operand type was used: expects array(s) or collection(s) in /srv/mediawiki/wmf-config/flaggedrevs.php on line 182
Closed, ResolvedPublic

Description

Error

Started when group1 got promoted.

message
operand type was used:  expects array(s) or collection(s) in /srv/mediawiki/wmf-config/flaggedrevs.php on line 182
Notice: Undefined index: reviewer in /srv/mediawiki/wmf-config/flaggedrevs.php on line 179

Logstash for flaggedrevs.php: https://logstash.wikimedia.org/goto/85e59a7e13a40e11c9595c444ea90375

trace
???

Impact

Notes

wmf-config/flaggedrevs.php
174 } elseif ( $wgDBname == 'cawikinews' ) {
175     $wgFlaggedRevsNamespaces[] = 102; // T36135
176 
177     $wgGroupPermissions['editor']['autopatrol'] = true; // T95085
178 
179     $wgGroupPermissions['reviewer'] = array_merge( $wgGroupPermissions['reviewer'], [
180         'autopatrol' => true,         // T95085
181         'patrol' => true,             // T95085
182     ] );
183 
184     $wgGroupPermissions['sysop'] = array_merge( $wgGroupPermissions['sysop'], [
185         'stablesettings' => true,     // T36135
186         'review' => true,             // T95085
187         'validate' => true,           // T95085
188         'unreviewedpages' => true,    // T95085
189     ] );
190 }

And the same requests most probably cause a fatal error which I originally filled as T224118. I always get the same 3 events:

INFO [Wed May 22 13:32:06 2019] [hphp] [24412:7f84163ff700:247111:000002] []
    Warning: Invalid operand type was used:  expects array(s) or collection(s) in /srv/mediawiki/wmf-config/flaggedrevs.php on line 182
FATAL Fatal error: Invalid operand type was used: cannot perform this operation with arrays in /srv/mediawiki/php-1.34.0-wmf.6/includes/GlobalFunctions.php on line 3177
INFO [Wed May 22 13:32:06 2019] [hphp] [24412:7f84163ff700:247111:000003] []
    Fatal error: Invalid operand type was used: cannot perform this operation with arrays in /srv/mediawiki/php-1.34.0-wmf.6/includes/GlobalFunctions.php on line 3177

Event Timeline

hashar created this task.May 22 2019, 1:15 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 22 2019, 1:15 PM
hashar updated the task description. (Show Details)
hashar updated the task description. (Show Details)May 22 2019, 1:22 PM
Reedy added a subscriber: Reedy.May 22 2019, 1:22 PM

I bet it's extension registration related...

Only got it on cawikinews so far.

hashar updated the task description. (Show Details)May 22 2019, 1:27 PM
hashar triaged this task as Unbreak Now! priority.May 22 2019, 1:35 PM
hashar updated the task description. (Show Details)
Restricted Application added subscribers: Liuxinyu970226, Dereckson. · View Herald TranscriptMay 22 2019, 1:36 PM

And https://ca.wikinews.org/ get us a Wikimedia error page. Time for a rollback!

Change 511882 had a related patch set uploaded (by Hashar; owner: Hashar):
[operations/mediawiki-config@master] Rollback cawikinews to 1.34.0-wmf.5 due to FlaggedRevs

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

Change 511882 merged by jenkins-bot:
[operations/mediawiki-config@master] Rollback cawikinews to 1.34.0-wmf.5 due to FlaggedRevs

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

I have rolled back cawikinews:

[13:45:33] <logmsgbot> !log hashar@deploy1001 rebuilt and synchronized wikiversions files

The error is gone from https://logstash.wikimedia.org/goto/85e59a7e13a40e11c9595c444ea90375 and https://ca.wikinews.org/ is back up.

I do not know why only cawikinews get impacted. @Reedy suggested it is related to recent work on the extension registration which would point at:

https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/FlaggedRevs/+/511021/
https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/FlaggedRevs/+/511034/

Maybe includes/flaggedrevs.php is loaded BEFORE the extension had a chance to fully load via the extension registration.

Mentioned in SAL (#wikimedia-operations) [2019-05-22T14:14:35Z] <hashar> 1.34.0-wmf.6 deployed to group1 with the exception of cawikinews due to T224116

Any progress here?

greg added subscribers: Catrope, greg.

Adding Growth-Team per dev/maintainers. @Catrope can you take a look here?

@Agusbou2015: See the previous comments in this task, plus my reply to you in T224124#5205148. Not sure what your expectations are based on.

I bet it's extension registration related...

It does look like it. Is it something you can investigate now?

Mentioned in SAL (#wikimedia-operations) [2019-05-22T16:17:00Z] <hashar@deploy1001> rebuilt and synchronized wikiversions files: Revert group1 to 1.34.0-wmf.5 T224116 T224124 # T220731

The patches referenced in T224116#5204455 have changed the loading of the extension from synchronous in extensions/FlaggedRevs/FlaggedRevs.php to asynchronous (happening later when the ExtensionRegistry queue is processed).

This means the wiki-specific customization in wmf-config/flaggedrevs.php is happening first, then the defaults from the extension are applied.

This blows up for cawikinews because it is using the array_merge syntax to set permissions whereas the other wikis are using a direct assignment syntax ($wgGroupPermissions['autoconfirmed']['autoreview'] = true;). While it doesn't blow up for other wikis, the config is applied in a different order and may end up being different.

My recommendation is to revert FlaggedRevs to git revision c5158743e01e531ff74004569f141d3437d4f62a in master and wmf.6 and let the migration to extension registration effort be retried later.

I'll have a patch momentarily.

Nope, never mind. Fixing cawikinews is trivial, but other wikis like bswiki that remove groups would be broken. What @SBisson suggested about reverting the entire conversion out of master and wmf.6 seems like a good way to unblock the trian.

Change 511936 had a related patch set uploaded (by Sbisson; owner: Sbisson):
[mediawiki/extensions/FlaggedRevs@master] Revert "Partial conversion to extension.json"

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

Change 511936 merged by jenkins-bot:
[mediawiki/extensions/FlaggedRevs@master] Revert "Partial conversion to extension.json"

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

Change 511940 had a related patch set uploaded (by Jforrester; owner: Sbisson):
[mediawiki/extensions/FlaggedRevs@wmf/1.34.0-wmf.6] Revert "Partial conversion to extension.json"

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

Change 511940 merged by jenkins-bot:
[mediawiki/extensions/FlaggedRevs@wmf/1.34.0-wmf.6] Revert "Partial conversion to extension.json"

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

Mentioned in SAL (#wikimedia-operations) [2019-05-22T18:35:07Z] <jforrester@deploy1001> Synchronized php-1.34.0-wmf.6/extensions/FlaggedRevs: Hot-deploy reverting FlaggedRevs config for T224116 T224124 (duration: 00m 58s)

Theoretically fixed (but not rolled out to group1 yet).

Mentioned in SAL (#wikimedia-operations) [2019-05-22T18:53:36Z] <jforrester@deploy1001> Started scap: Re-build i18n and re-scap everything for i18n issues for T224116 T224124 T220731

Change 511953 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[operations/mediawiki-config@master] Re-apply "group1 wikis to 1.34.0-wmf.6"

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

Mentioned in SAL (#wikimedia-operations) [2019-05-22T19:26:31Z] <jforrester@deploy1001> Finished scap: Re-build i18n and re-scap everything for i18n issues for T224116 T224124 T220731 (duration: 32m 55s)

We just need to copy the config into the top of flaggedrevs.php (which already had some of it)...

Change 511953 merged by jenkins-bot:
[operations/mediawiki-config@master] Re-apply "group1 wikis to 1.34.0-wmf.6"

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

hashar closed this task as Resolved.May 23 2019, 8:50 AM
hashar assigned this task to SBisson.

Fixed by @SBisson / reverting extension.json