Page MenuHomePhabricator

PHP Notice: Array to string conversion from libs/StatusValue.php (via ApiClientLogin)
Closed, ResolvedPublic

Description

Error

MediaWiki version: 1.35.0-wmf.18

message
PHP Notice: Array to string conversion

Impact

Notes

Started on Tue 2012-02-11.

Details

Request ID
XkVcBwpAIDoAAGDzjvsAAADG
Request URL
https://tr.wikipedia.org/w/api.php?format=json&formatversion=2&errorformat=plaintext&action=clientlogin&rememberMe=
Stack Trace
exception.trace
#0 [internal function]: MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.35.0-wmf.18/includes/libs/StatusValue.php(345): implode(string, array)
#2 /srv/mediawiki/php-1.35.0-wmf.18/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php(106): StatusValue->__toString()
#3 /srv/mediawiki/php-1.35.0-wmf.18/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php(88): Monolog\Formatter\NormalizerFormatter->normalize(Status, integer)
#4 /srv/mediawiki/php-1.35.0-wmf.18/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php(88): Monolog\Formatter\NormalizerFormatter->normalize(array, integer)
#5 /srv/mediawiki/php-1.35.0-wmf.18/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php(44): Monolog\Formatter\NormalizerFormatter->normalize(array)
#6 /srv/mediawiki/php-1.35.0-wmf.18/vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php(76): Monolog\Formatter\NormalizerFormatter->format(array)
#7 /srv/mediawiki/php-1.35.0-wmf.18/includes/debug/logger/monolog/CeeFormatter.php(21): Monolog\Formatter\LogstashFormatter->format(array)
#8 /srv/mediawiki/php-1.35.0-wmf.18/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(37): MediaWiki\Logger\Monolog\CeeFormatter->format(array)
#9 /srv/mediawiki/php-1.35.0-wmf.18/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php(35): Monolog\Handler\AbstractProcessingHandler->handle(array)
#10 /srv/mediawiki/php-1.35.0-wmf.18/vendor/monolog/monolog/src/Monolog/Logger.php(344): Monolog\Handler\WhatFailureGroupHandler->handle(array)
#11 /srv/mediawiki/php-1.35.0-wmf.18/vendor/monolog/monolog/src/Monolog/Logger.php(642): Monolog\Logger->addRecord(integer, string, array)
#12 /srv/mediawiki/php-1.35.0-wmf.18/includes/api/ApiAuthManagerHelper.php(251): Monolog\Logger->info(string, array)
#13 /srv/mediawiki/php-1.35.0-wmf.18/includes/api/ApiClientLogin.php(103): ApiAuthManagerHelper->logAuthenticationResult(string, MediaWiki\Auth\AuthenticationResponse)
#14 /srv/mediawiki/php-1.35.0-wmf.18/includes/api/ApiMain.php(1603): ApiClientLogin->execute()
#15 /srv/mediawiki/php-1.35.0-wmf.18/includes/api/ApiMain.php(539): ApiMain->executeAction()
#16 /srv/mediawiki/php-1.35.0-wmf.18/includes/api/ApiMain.php(510): ApiMain->executeActionWithErrorHandling()
#17 /srv/mediawiki/php-1.35.0-wmf.18/api.php(78): ApiMain->execute()
#18 /srv/mediawiki/w/api.php(3): require(string)
#19 {main}

Event Timeline

Krinkle created this task.Feb 13 2020, 2:32 PM
Restricted Application added a project: Core Platform Team. · View Herald TranscriptFeb 13 2020, 2:32 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Krinkle updated the task description. (Show Details)Feb 13 2020, 2:35 PM

Presumably this is being caused when $error['message'] isn't a MessageSpecifier but $error['params'] is set, and the value of $error['params'] being passed in is somehow not an array.

Anomie added a subscriber: Anomie.

Bug is in StatusValue, it's assuming all message parameters are simple scalars and choking on something that's not (e.g. Message::plaintextParam(), Message::numParam(), or something like that).

Change 572342 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/core@master] StatusValue: Fix __toString() to not choke on special parameters

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

Change 572342 merged by jenkins-bot:
[mediawiki/core@master] StatusValue: Fix __toString() to not choke on special parameters

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

Change 572930 had a related patch set uploaded (by Jforrester; owner: Anomie):
[mediawiki/core@wmf/1.35.0-wmf.19] StatusValue: Fix __toString() to not choke on special parameters

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

Change 572930 merged by jenkins-bot:
[mediawiki/core@wmf/1.35.0-wmf.19] StatusValue: Fix __toString() to not choke on special parameters

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

Mentioned in SAL (#wikimedia-operations) [2020-02-18T20:06:25Z] <jforrester@deploy1001> Synchronized php-1.35.0-wmf.19/includes/libs/StatusValue.php: T245155 StatusValue: Fix __toString() to not choke on special parameters (duration: 01m 04s)

Jdforrester-WMF closed this task as Resolved.Feb 18 2020, 8:11 PM
Jdforrester-WMF assigned this task to Anomie.

Thank you.