Page MenuHomePhabricator

Invalid operand type was used: array_flip expects an array or collection in ApiResult
Closed, ResolvedPublicPRODUCTION ERROR

Description

Invalid operand type was used: array_flip expects an array or collection
in /srv/mediawiki/php-1.28.0-wmf.22/includes/api/ApiResult.php on line 844

Event Timeline

Without a backtrace or an API request that reproduces the warning, the only option would be for someone to grep through all deployed code to try to find what might be setting META_BC_BOOLS to something that's not an array.

Change 318297 had a related patch set uploaded (by Anomie):
Value for ApiResult::META_BC_BOOLS must be an array

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

Should we have ApiResult throw an UnexpectedValueException or something in this case? Or silently fail here?

Change 318297 merged by jenkins-bot:
Value for ApiResult::META_BC_BOOLS must be an array

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

Should we have ApiResult throw an UnexpectedValueException or something in this case? Or silently fail here?

It's a tradeoff between adding more code complexity checking types to guard against people making mistakes, and just trusting people not to make mistakes. If we do anything, UnexpectedValueException would probably be best.

Change 318341 had a related patch set uploaded (by Legoktm):
Value for ApiResult::META_BC_BOOLS must be an array

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

Change 318341 merged by jenkins-bot:
Value for ApiResult::META_BC_BOOLS must be an array

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

Legoktm claimed this task.

Okay, I'll mark as resolved for now.

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:10 PM