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 raised the priority of this task from to Medium.
Nemo_bis updated the task description. (Show Details)
Nemo_bis added a project: MediaWiki-General.
Nemo_bis added a subscriber: Nemo_bis.

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.

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

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.

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