Last modified: 2014-10-30 22:49:07 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 T74274, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 72274 - Job queue not running (HTTP 411) due to missing Content-Length: header
Job queue not running (HTTP 411) due to missing Content-Length: header
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
JobQueue (Other open bugs)
1.23.2
All Linux
: Unprioritized major (vote)
: ---
Assigned To: Patrick Westerhoff
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-10-20 18:55 UTC by jclbugz
Modified: 2014-10-30 22:49 UTC (History)
7 users (show)

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


Attachments

Description jclbugz 2014-10-20 18:55:26 UTC
I recently upgraded from 1.20.8 to 1.23.2 and it now appears the job queue is not running, though manual runs of the runJobs script do work. The wiki debug log has messages saying:

[runJobs] Running 1 job(s) via '/index.php?title=Special%3ARunJobs&tasks=jobs&maxjobs=1&sigexpiry=NNN&signature=NNN'
[runJobs] Failed to start cron API: received 'HTTP/1.1 411 Length Required'

It was suggested on the IRC channel that others are seeing this too and that I should file a bug report, so here it is.
Comment 1 jclbugz 2014-10-20 18:57:09 UTC
FWIW, my servers are running Apache 2.2.22 on Ubuntu 12.04.
Comment 2 jclbugz 2014-10-20 18:57:52 UTC
Oh and PHP 5.3.10. Sorry for the comment spam.
Comment 3 Andre Klapper 2014-10-20 19:31:08 UTC
Not sure if this is the reason but there have been job queue changes in 1.22, see https://git.wikimedia.org/blob/mediawiki%2Fcore.git/REL1_22/RELEASE-NOTES-1.22 and https://gerrit.wikimedia.org/r/#/c/59797/ (and https://bugzilla.wikimedia.org/show_bug.cgi?id=46934 )

What is
   $wgJobTypeConf
set to?

You can also set:
   $wgDebugLogGroups['runJobs'] = "<some path>"
to get debug output and errors (but maybe that's already what your info in comment 0 comes from?).
Comment 4 jclbugz 2014-10-20 19:35:25 UTC
$wgJobTypeConf is not set in LocalSettings.php so it's still the default:

array( 'default' => array ( 'class' => 'JobQueueDB', 'order' => 'random' ) )

I haven't used $wgDebugLogGroups, but the output I provided is in the debug log specified by $wgDebugLogFile.

I'll look more closely at the links you've provided, though as I understand it, MW change how the job queue works in 1.22 and then reverted those changes to some degree in 1.23, so I'm not sure how applicable the 1.22 changes could be to a 1.23 wiki.
Comment 5 Jesús Martínez Novo (Ciencia Al Poder) 2014-10-20 19:51:01 UTC
The problem is that the internal HTTP request to run jobs doesn't include the Content-Length: header (as the HTTP 411 error explains), but it seems to be required[1] (although some webservers, even my apache 2.2.22 on OpenSuSE, doesn't complain about that missing header!):

Relevant code in MediaWiki.php (or Wiki.php before 1.24)

$req = "POST $url HTTP/1.1\r\nHost: {$info['host']}\r\nConnection: Close\r\n\r\n";
...
$bytes = fwrite( $sock, $req );

The solution is simple: Send a Content-Length: header.

----

[1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13
Comment 6 Patrick Westerhoff 2014-10-20 20:57:57 UTC
Do I see it correctly that a `Content-Length: 0` should be correct there since the request body is empty?
Comment 7 Gerrit Notification Bot 2014-10-20 21:40:40 UTC
Change 167707 had a related patch set uploaded by Poke:
Add Content-Length header for job queue requests

https://gerrit.wikimedia.org/r/167707
Comment 8 Gerrit Notification Bot 2014-10-20 23:26:42 UTC
Change 167707 merged by jenkins-bot:
Add Content-Length header for job queue requests

https://gerrit.wikimedia.org/r/167707
Comment 9 Patrick Westerhoff 2014-10-20 23:38:25 UTC
Fix landed and was confirmed to have solved the issue.
Comment 10 Andre Klapper 2014-10-21 07:58:20 UTC
Wondering whether that (merged in master) one-liner patch should be backported to 1.23 tarballs - setting backport flag to "?" and CC'ing Mark y Markus.
Comment 11 Gerrit Notification Bot 2014-10-29 16:35:48 UTC
Change 169734 had a related patch set uploaded by MarkAHershberger:
AuthorDate: 2014-10-20 23:40:20 +0200

https://gerrit.wikimedia.org/r/169734
Comment 12 Gerrit Notification Bot 2014-10-29 17:25:07 UTC
Change 169734 merged by Mglaser:
Add Content-Length header for job queue requests

https://gerrit.wikimedia.org/r/169734
Comment 13 Patrick Westerhoff 2014-10-29 19:51:41 UTC
Now that this has been integrated into REL1_23, should I go ahead and backport it to REL1_24 too?
Comment 14 Mark A. Hershberger 2014-10-29 20:33:52 UTC
(In reply to Patrick Westerhoff from comment #13)
> Now that this has been integrated into REL1_23, should I go ahead and
> backport it to REL1_24 too?

Please do.
Comment 15 Gerrit Notification Bot 2014-10-29 23:40:07 UTC
Change 169965 had a related patch set uploaded by Poke:
Add Content-Length header for job queue requests

https://gerrit.wikimedia.org/r/169965
Comment 16 Gerrit Notification Bot 2014-10-30 22:33:49 UTC
Change 169965 merged by jenkins-bot:
Add Content-Length header for job queue requests

https://gerrit.wikimedia.org/r/169965
Comment 17 Patrick Westerhoff 2014-10-30 22:49:07 UTC
Backported to 1.23 and 1.24.

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


Navigation
Links