Last modified: 2012-08-15 20:02:48 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 27452 - array_map() callback error
array_map() callback error
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
OpenSearchXml (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Brion Vibber
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-16 12:46 UTC by Sam Reed (reedy)
Modified: 2012-08-15 20:02 UTC (History)
1 user (show)

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


Attachments

Description Sam Reed (reedy) 2011-02-16 12:46:19 UTC
Feb 16 12:38:53 10.0.8.1 apache2[11835]: PHP Warning:  array_map() [<a href='function.array-map'>function.array-map</a>]: An error occurred while invoking the map callback in /usr/local/apache/common-local/php-1.17/extensions/OpenSearchXml/ApiOpenSearchXml.php on line 85


Logging as a TODO if we can find out how to replicate....
Comment 1 Brion Vibber 2011-02-22 21:04:09 UTC
The PHP warning message here indicates an exception (or possibly some other error, but I can definitely reproduce it with an exception) in the callback function to array_map() -- this seems to happen even if the exception is caught, which is pretty lame.

The only array_map() call here is to $this->formatItem(), so most likely something in there or in the many things called from there had an error.

There should have been a separate log line for errors or exceptions in there, which might make it rather easier to track down the specific issue.

Without that there may be nothing too specific to look at if nothing pops out; if this is a frequent error rather than a one-off, consider adding some debug logging around it, possibly a try/catch which can add logging if an exception is indeed being thrown in there.
Comment 2 Brion Vibber 2011-05-25 00:03:48 UTC
Reedy, does this still happen in logs?
Comment 3 Sam Reed (reedy) 2011-05-25 12:20:22 UTC
I can't see anything obvious.

IIRC this was something Tim noticed was happening fairly regularly around/just after the 1.17 deploy



reedy@fenari:/home/wikipedia/l$ grep OpenSearchXml *.log
reedy@fenari:/home/wikipedia/l$ grep OpenSearch *.log
runJobs.log:2011-05-25 09:36:55 srv232 enwiki: enotifNotify OpenSearch editor=217.195.212.206 editorID=0 timestamp=20110525093652 summary=/* Search engines and software that support OpenSearch */  minorEdit=0 oldid=420659461 watchers=Array t=1 good
slow-parse.log:2011-05-25 08:06:08 srv175 enwiki: 4.72  OpenSearch
xff.log:Wed, 25 May 2011 09:36:48 +0000 http://en.wikipedia.org/w/index.php?title=OpenSearch&action=submit      217.195.212.206, 91.198.174.37, 91.198.174.40, 208.80.152.72    save


I'll mark it was resolved wfm
Comment 4 Sam Reed (reedy) 2011-10-05 01:57:53 UTC
Update for completeness...

During the 1.18wmf1 migration this seemed to have batches of it occurring again.

Did do some hacking

		$srchres = PrefixSearch::titleSearch( $search, $limit, $namespaces );

		if ( !is_array( $srchres ) ) {
			wfDebug( 'PrefixSearch::titleSearch returned a non array', true );
			$srchres = array();
		}
		$mapped = array_map( array( $this, 'formatItem' ), $srchres );
		$items = array_filter( $mapped );


But not sure if it actually did anything, or the issue was just transient
Comment 5 Sam Reed (reedy) 2011-10-05 23:33:15 UTC
Reopening due to the current error spammage
Comment 6 Sam Reed (reedy) 2011-10-05 23:45:25 UTC
Oct  5 23:44:54 10.0.2.187 apache2[6888]: PHP Warning:  array_map() [<a href='function.array-map'>function.array-map</a>]: An error occurred while invoking the map callback in /usr/local/apache/common-local/php-1.18/extensions/OpenSearchXml/ApiOpenSearchXml.php on line 88
Oct  5 23:44:54 10.0.8.47 apache2[17441]: PHP Warning:  array_map() [<a href='function.array-map'>function.array-map</a>]: An error occurred while invoking the map callback in /usr/local/apache/common-local/php-1.18/extensions/OpenSearchXml/ApiOpenSearchXml.php on line 88
Oct  5 23:44:54 10.0.8.43 apache2[12300]: PHP Warning:  array_map() [<a href='function.array-map'>function.array-map</a>]: An error occurred while invoking the map callback in /usr/local/apache/common-local/php-1.18/extensions/OpenSearchXml/ApiOpenSearchXml.php on line 88
Oct  5 23:44:54 10.0.2.218 apache2[7722]: PHP Warning:  array_map() [<a href='function.array-map'>function.array-map</a>]: An error occurred while invoking the map callback in /usr/local/apache/common-local/php-1.18/extensions/OpenSearchXml/ApiOpenSearchXml.php on line 88
Comment 7 Brion Vibber 2011-10-05 23:54:56 UTC
This error indicates that the formatItem method used as the callback to array_map threw an exception -- you would get a different error if a non-array had been returned.

ApiMain::execute() seems to wrap things in a try/catch by default, so whatever the exception was may have been separately logged to wfDebugLog('exception') (or apparently not logged at all if it wasn't a MWException).
Comment 8 Roan Kattouw 2011-10-06 11:52:41 UTC
(In reply to comment #7)
> This error indicates that the formatItem method used as the callback to
> array_map threw an exception -- you would get a different error if a non-array
> had been returned.
> 
FYI, this is https://bugs.php.net/bug.php?id=55416
Comment 9 Sam Reed (reedy) 2012-04-27 19:01:38 UTC
1 Warning:  array_map() [<a href='function.array-map'>function.array-map</a>]: An error occurred while invoking the map callback in /usr/local/apache/common-local
/php-1.20wmf1/extensions/OpenSearchXml/ApiOpenSearchXml.php on line 0

Still happening. I guess it's moar PHP fail
Comment 10 Sam Reed (reedy) 2012-08-15 20:02:48 UTC
https://gerrit.wikimedia.org/r/19928

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


Navigation
Links