Last modified: 2011-04-14 15:12:20 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 11378 - Transwiki Special:Import via redirected interwiki URL spews PHP error about HTTP error
Transwiki Special:Import via redirected interwiki URL spews PHP error about H...
Status: NEW
Product: MediaWiki
Classification: Unclassified
Export/Import (Other open bugs)
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2007-09-17 20:55 UTC by Brion Vibber
Modified: 2011-04-14 15:12 UTC (History)
1 user (show)

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


Description Brion Vibber 2007-09-17 20:55:13 UTC
When testing a transwiki/interwiki import from Wikipedia to my local test wiki, I found i was getting this PHP error spewed out:

<b>Warning</b>:  file_get_contents( [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: HTTP request failed! HTTP/1.0 411 Length Required
 in <b>/opt/web/pages/trunk/includes/HttpFunctions.php</b> on line <b>83</b><br />

My local interwiki table was using URLs, which return an HTTP 301 redirect. Note that the local wiki doesn't have CURL set up and is using the file_get_contents() path.

A POST request is used for the import, I'm not 100% sure why. Unfortunately at least file_get_contents() doesn't seem to handle redirects properly. It follows the target URL, doing another POST, but apparently without all the headers. The Content-Length header, required for POSTs, is being lost, so the target server returns an HTTP server on the subrequest.

Proper behavior would be to use a GET in the first place, or to resubmit at the new URL with the correct headers. HTTP 1.1 spec says a user-agent MUST NOT follow through a POST across a redirect without user confirmation; for this case the system's knowledge of wikis should be enough if we actually do it right though. ;)

I'm not sure what happens in the CURL case, haven't tested.
Comment 1 Siebrand Mazeland 2008-08-18 18:55:31 UTC
Mass compoment change: <some> -> Export/Import

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