An error is frequently (0-9 times/day) occurring in logstash. It might be exposing a bug that we are not aware of, and is making it harder to see other bugs in our error logs so we should aim to investigate it and squash it!
[[ https://logstash.wikimedia.org/app/kibana#/discover?_g=(refreshInterval:(display:Off,pause:!f,value:0),time:(from:now-7d,mode:quick,to:now))&_a=(columns:!(_source),index:'logstash-*',interval:auto,query:(query_string:(analyze_wildcard:!t,query:'message:%22PHP%20Warning:%20array_intersect_key()%20expects%20parameter%201%20to%20be%20an%20array%20or%20collection%22')),sort:!('@timestamp',desc)) | Logstash ]]
Stack trace:
```
0 /srv/mediawiki/php-1.29.0-wmf.16/extensions/MobileFrontend/includes/api/ApiMobileView.php(129): MWExceptionHandler::handleError(integer, string, string, integer, array, array)
#1 /srv/mediawiki/php-1.29.0-wmf.16/includes/api/ApiMain.php(1543): ApiMobileView->execute()
#2 /srv/mediawiki/php-1.29.0-wmf.16/includes/api/ApiMain.php(544): ApiMain->executeAction()
#3 /srv/mediawiki/php-1.29.0-wmf.16/includes/api/ApiMain.php(515): ApiMain->executeActionWithErrorHandling()
#4 /srv/mediawiki/php-1.29.0-wmf.16/api.php(83): ApiMain->execute()
#5 /srv/mediawiki/w/api.php(3): include(string)
#6 {main}
```
Troublesome line appears to be:
```
$pageProps = array_intersect_key( $data['pageprops'], array_flip( $propNames ) );
```
Throwing
```
ErrorException from line 129 of /srv/mediawiki/php-1.29.0-wmf.21/extensions/MobileFrontend/includes/api/ApiMobileView.php: PHP Warning: array_intersect_key() expects parameter 1 to be an array or collection
```
It is documented that [[ http://php.net/manual/en/function.array-flip.php | array_flip will return NULL on failure ]] but it's not clear what results in a failure.