[wikitech rather than mediawiki as it concerns a wikimedia installation; also, not sure if this is really a bug, thus no bugzilla]
One of my tools on the toolserver has been happily transferring images from http://www.geograph.org.uk/ for many month. It does so by copying the file to /tmp on toolserver, then upload it.
Now, a problem has come up: Most of the time (but apparently, not always), the upload is rejected because of some mime type issue. The problem occurs for both fake-upload-page POST via Perl, as well as the API-based PHP Peachy extension. This happens for many different images, so probably not a bad toolserver cache.
Now the killer: When I download the image to my desktop and manually upload it, it works fine.
Test image : http://s0.geograph.org.uk/photos/49/27/492794_cc629fb2.jpg
Any ideas?
Magnus
Magnus Manske wrote:
[wikitech rather than mediawiki as it concerns a wikimedia installation; also, not sure if this is really a bug, thus no bugzilla]
One of my tools on the toolserver has been happily transferring images from http://www.geograph.org.uk/ for many month. It does so by copying the file to /tmp on toolserver, then upload it.
Now, a problem has come up: Most of the time (but apparently, not always), the upload is rejected because of some mime type issue. The problem occurs for both fake-upload-page POST via Perl, as well as the API-based PHP Peachy extension. This happens for many different images, so probably not a bad toolserver cache.
Now the killer: When I download the image to my desktop and manually upload it, it works fine.
Test image : http://s0.geograph.org.uk/photos/49/27/492794_cc629fb2.jpg
Any ideas?
Magnus
Is the file downloaded right at the toolserver? It may be that it downloads a 0-byte file, then upload fails, whereas when you download it manually you get the right file. (Similarly, it may be the upload what gets truncated, although that probably wouldn't give a mime error as it would fail earlier)
On Wed, Oct 6, 2010 at 10:16 PM, Platonides Platonides@gmail.com wrote:
Magnus Manske wrote:
[wikitech rather than mediawiki as it concerns a wikimedia installation; also, not sure if this is really a bug, thus no bugzilla]
One of my tools on the toolserver has been happily transferring images from http://www.geograph.org.uk/ for many month. It does so by copying the file to /tmp on toolserver, then upload it.
Now, a problem has come up: Most of the time (but apparently, not always), the upload is rejected because of some mime type issue. The problem occurs for both fake-upload-page POST via Perl, as well as the API-based PHP Peachy extension. This happens for many different images, so probably not a bad toolserver cache.
Now the killer: When I download the image to my desktop and manually upload it, it works fine.
Test image : http://s0.geograph.org.uk/photos/49/27/492794_cc629fb2.jpg
Any ideas?
Magnus
Is the file downloaded right at the toolserver? It may be that it downloads a 0-byte file, then upload fails, whereas when you download it manually you get the right file. (Similarly, it may be the upload what gets truncated, although that probably wouldn't give a mime error as it would fail earlier)
I checked, the file on the toolserver has exactly the same size as the one I downloaded manually. Also, the file is downloaded anew on each attempt, and several files are affected.
The original reporter of the bug told me that for one image, it actually succeeded on his ninth attempt. Talk about persistence :-)
Addendum: API error message is: "Code: verification-error Text: This file did not pass file verification"
Cheers, Magnus
wikitech-l@lists.wikimedia.org