Page MenuHomePhabricator

PHP Warning: array_map(): Argument #2 should be an array
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

MediaWiki version: 1.35.0-wmf.41

message
PHP Warning: array_map(): Argument #2 should be an array

Impact

Notes

Details

Request ID
e7814eb6-f610-45aa-8f6b-e1971dfbe798
Request URL
https://meta.wikimedia.org/w/api.php
Stack Trace
exception.trace
#0 [internal function]: MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.35.0-wmf.41/extensions/UrlShortener/includes/UrlShortenerUtils.php(351): array_map(Closure, boolean)
#2 /srv/mediawiki/php-1.35.0-wmf.41/extensions/UrlShortener/includes/UrlShortenerUtils.php(387): UrlShortenerUtils::getAllowedDomainsRegex()
#3 /srv/mediawiki/php-1.35.0-wmf.41/extensions/UrlShortener/includes/ApiShortenUrl.php(26): UrlShortenerUtils::validateUrl(string)
#4 /srv/mediawiki/php-1.35.0-wmf.41/includes/api/ApiMain.php(1593): ApiShortenUrl->execute()
#5 /srv/mediawiki/php-1.35.0-wmf.41/includes/api/ApiMain.php(529): ApiMain->executeAction()
#6 /srv/mediawiki/php-1.35.0-wmf.41/includes/api/ApiMain.php(500): ApiMain->executeActionWithErrorHandling()
#7 /srv/mediawiki/php-1.35.0-wmf.41/api.php(90): ApiMain->execute()
#8 /srv/mediawiki/php-1.35.0-wmf.41/api.php(45): wfApiMain()
#9 /srv/mediawiki/w/api.php(3): require(string)
#10 {main}

Event Timeline

Blip of six of these during the group1 train roll-out (i.e., the one that affects meta); subsequently quiet, so might just be switch-over spam?

This is due to renaming of $wgUrlShortenerDomainsWhitelist. It seems the new variable $wgUrlShortenerAllowedDomains is currently boolean (default of original) because it's not yet set to array in wmf-config/CommonSettings.php and we can't do that until it's available everywhere. I will add a temporary fix for this since the warning will continue showing up as you deploy it to more wikis until when we eventually do the switch in wmf config.

Change 612867 had a related patch set uploaded (by Ammarpad; owner: Ammarpad):
[mediawiki/extensions/UrlShortener@master] Add temporary fix to ensure array is passed to array_map()

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

Change 612722 had a related patch set uploaded (by Jforrester; owner: Ammarpad):
[mediawiki/extensions/UrlShortener@wmf/1.35.0-wmf.41] Add temporary fix to ensure array is passed to array_map()

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

Change 612722 merged by jenkins-bot:
[mediawiki/extensions/UrlShortener@wmf/1.35.0-wmf.41] Add temporary fix to ensure array is passed to array_map()

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

Change 612867 merged by jenkins-bot:
[mediawiki/extensions/UrlShortener@master] Add temporary fix to ensure array is passed to array_map()

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

Mentioned in SAL (#wikimedia-operations) [2020-07-15T13:58:54Z] <jforrester@deploy1001> Synchronized php-1.35.0-wmf.41/extensions/UrlShortener/includes/UrlShortenerUtils.php: T258056 Add temporary fix to ensure array is passed to array_map() (duration: 01m 08s)