Page MenuHomePhabricator

Fix "PHP Notice: Second parameter should not be a timeout"
Closed, ResolvedPublic

Description

Unhelpful notice:

PHP Notice: Second parameter should not be a timeout. [Called from Http::get in /srv/mediawiki/tags/2015-03-03_12:42:07/includes/HttpFunctions.php at line 97] in /srv/mediawiki/tags/2015-03-03_12:42:07/includes/debug/MWDebug.php on line 300

Event Timeline

Nemo_bis created this task.Mar 6 2015, 4:49 PM
Nemo_bis updated the task description. (Show Details)
Nemo_bis raised the priority of this task from to Normal.
Nemo_bis added a subscriber: Nemo_bis.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 6 2015, 4:49 PM

It would be really helpful to fix the notice to state the actual caller, because right now something is breaking silently, spamming the logs, and I am no wiser what to fix.

Change 199850 had a related patch set uploaded (by Nikerabbit):
Make wfWarn name the caller

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

Change 199850 merged by jenkins-bot:
Make wfWarn name the caller in Http::get

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

Krinkle renamed this task from PHP Notice: Second parameter should not be a timeout to Fix "PHP Notice: Second parameter should not be a timeout".Apr 17 2015, 12:27 PM
Krinkle set Security to None.
Krinkle removed a project: Patch-For-Review.
Krinkle removed a subscriber: gerritbot.

Are there new log errors now with the correct name?

Looking at Translate extension there seems to be some places:

https://github.com/wikimedia/mediawiki-extensions-Translate/blob/76e199215ef0bff46c8b4d93532a6f73135afe94/webservices/ApertiumWebService.php#L24
https://github.com/wikimedia/mediawiki-extensions-Translate/blob/76e199215ef0bff46c8b4d93532a6f73135afe94/webservices/CxserverWebService.php#L28
https://github.com/wikimedia/mediawiki-extensions-Translate/blob/76e199215ef0bff46c8b4d93532a6f73135afe94/webservices/YandexWebService.php#L37
and maybe more

$this->config['timeout'] looks not like an array and that is the situation where the warning is triggered.

TorBlock:
https://github.com/wikimedia/mediawiki-extensions-TorBlock/blob/2e1c1388f06242a167f9d6d4ab3c807727782368/includes/TorExitNodes.php#L143

Wikidata, CentralNotice, ExternalData, CodeReview, SecurePoll, PageImages and maybe more

See I834278639a3648edec7bcb57db7bb61f456d2a92 / https://gerrit.wikimedia.org/r/#/c/193384/5 for the change in core which adds the warning

I have mentally postponed the fix in Translate because the change to get/post is not backwards compatible and I need to convert those to use request.

Krinkle, can you clarify T91764#1215129 ? Is this error also seen in WMF logs?

Now the error is something like

[25-May-2015 19:30:25 UTC] PHP Notice:  Second parameter should not be a timeout. [Called from YandexWebService::doPairs in 
          /srv/mediawiki/tags/2015-05-24_16:06:21/extensions/Translate/webservices/YandexWebService.php at line 40] in 
          /srv/mediawiki/tags/2015-05-24_16:06:21/includes/debug/MWDebug.php on line 300
hashar added a subscriber: hashar.Jun 1 2015, 1:23 PM

Does not seem to have occurred over a month on wikimedia servers. I guess it is an issue within the Translate extension isn't it ?

I guess it is an issue within the Translate extension isn't it ?

Yes and WMF doesn't use Yandex. I doubt this ever happened on WMF servers, removing.

hashar removed a subscriber: hashar.Jun 1 2015, 4:13 PM

Many of the Http::get uses were removed in my recent refactoring to do web service requests in parallel.

Change 220750 had a related patch set uploaded (by Nikerabbit):
Avoid deprecation notices for Http::get

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

Change 220750 merged by jenkins-bot:
Avoid deprecation notices for Http::get

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

Nikerabbit closed this task as Resolved.Jun 27 2015, 6:56 PM