Last modified: 2014-02-07 16:41:17 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T62477, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 60477 - Invalid argument supplied for foreach() in SwiftFileBackend
Invalid argument supplied for foreach() in SwiftFileBackend
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
1.23.0
All All
: Normal normal (vote)
: ---
Assigned To: Bryan Davis
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-27 17:21 UTC by Bryan Davis
Modified: 2014-02-07 16:41 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Bryan Davis 2014-01-27 17:21:26 UTC
These errors seem to come in pairs and recur quite often in the fatalmonitor/apache2 logs:

PHP Warning:  Invalid argument supplied for foreach() in /usr/local/apache/common-local/php-1.23wmf10/includes/filebackend/SwiftFileBackend.php on line 180

PHP Warning:  Invalid argument supplied for foreach() in /usr/local/apache/common-local/php-1.23wmf10/includes/filebackend/SwiftFileBackend.php on line 648


    $ fgrep "SwiftFileBackend.php on line 180" /a/mw-log/apache2.log |wc -l
    927

    $ fgrep "SwiftFileBackend.php on line 648" /a/mw-log/apache2.log |wc -l
    927
Comment 1 Bryan Davis 2014-01-27 17:24:48 UTC
I think this is caused by SwitftFileBackend::addMissingMetadata(). This method is documented to return an array and used as though it will always return an array but the current implementation will only return an array in the "happy path" use case where the header collection passed to it already contains the 'x-object-meta-sha1base36' header. In all other execution paths it returns a boolean rather than an array.
Comment 2 Gerrit Notification Bot 2014-01-27 17:37:30 UTC
Change 109690 had a related patch set uploaded by BryanDavis:
Always return an array from SwiftFileBackend::addMissingMetadata

https://gerrit.wikimedia.org/r/109690
Comment 3 Gerrit Notification Bot 2014-01-27 17:59:50 UTC
Change 109690 merged by jenkins-bot:
Always return an array from SwiftFileBackend::addMissingMetadata

https://gerrit.wikimedia.org/r/109690
Comment 4 Umherirrender 2014-01-31 18:40:48 UTC
was successfully merged
Comment 5 Bryan Davis 2014-02-07 16:41:17 UTC
The log messages from the original report are no longer being seen in the fatal log monitor now that all wikis are on 1.23wmf12 or newer.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links