Page MenuHomePhabricator

Thumbnails fail: "timeout" not installed, required in ulimit5.sh
Closed, ResolvedPublic

Description

Author: dasch

Description:
I have a somehow strange error. I updated mediawiki to the latest git version.
Now when uploading a new image creating thumbnails fails.
But for old images creating thumbnails with sizes that are not in thumbnails folder works.
I already checked the folder permissions and set them to 777.

It seams to me that creating the folders fails and then the images cannot be added. Where there any changes there?


Version: 1.21.x
Severity: critical
URL: http://www.wecowi.de/images/thumb/6/66/Yosemite_Half_Dome.jpg/120px-Yosemite_Half_Dome.jpg

Details

Reference
bz44044

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:19 AM
bzimport set Reference to bz44044.

dasch wrote:

I made some test and it's a problem with ImageMagick because setting
$wgUseImageMagick = false;
makes it work again.

Do you get error messages when trying to create a thumbnail? (With php warnings enabled).

There were a bunch of changes with how files were handled, but I think that was in 1.19. Off the top of my head im not sure if there have been recent changes

dasch wrote:

I had PHP Warning enabled and there were not errors displayed. The only error was that instead of the thumbnail there is the text that creating thumbnails failed.

Bug 42730 and bug 32387 came to my mind, but they both have error messages.

(In reply to comment #4)

Bug 42730 and bug 32387 came to my mind, but they both have error messages.

Neither seems likely. The first would apply to all images not just new images (I think). The second only applies to exvessively large images.

(In reply to comment #5)

(In reply to comment #4)

Bug 42730 and bug 32387 came to my mind, but they both have error messages.

Neither seems likely. The first would apply to all images not just new images
(I think)

By which i mean i think that bug would apply to old images where there is no cached thumbnail

dasch wrote:

Until now I just look on the File Page, there only the error that thumbnail creation failed was shown. In gallery view I saw, that there is another message saying invalid thumbnail paramter.

So it could be a similar problem like Bug 42730?

The solution should be to set $wgTmpDirectory?

dasch wrote:

With imagemagick it even does not work with old images and there is no error message.
Without imagemagick it works for some images and fails for other with the message invalid parameters.
For this image it fails with and without imagemagick
http://www.wecowi.de/wiki/Datei:Yosemite_Half_Dome.jpg

dasch wrote:

Well, somehow even for some old images (and PDFs – I have with PDFHandler installed) the creation of thumbnails fails. But the strange thing is, that the small version work but the normal size thumbnails do not work. Here an example
http://www.wecowi.de/index.php?title=Datei:Hausarbeit-DaSch-2009.pdf

dasch wrote:

After taking a look into the temp directory I saw, that the images are named like this now
20130116203806!php6yqftK.jpg

Older images have a number and the Name of the picture and not such a cryptic name.

dasch wrote:

Something with images works totally wrong, I tried to omit the error by setting $wgUseImageResize = false; but this doesn't have any effect! Somebody broke the image handling completely!

dasch wrote:

Installing new version of ImageMagick also didn't help.

I changed $wgTmpDirectory to a directory that is accessible and nothing happens. It seams to me, that creating new hashed subfolders does not work.

https://translatewiki.net/wiki/File:Bug44044.JPG works too, you can find the config at https://gerrit.wikimedia.org/r/gitweb?p=translatewiki.git;a=tree
That PDF definitely has some other problem, MediaWiki is not finding its resolution info?

I don't think this should be high critical unless its affecting several wikis

dasch wrote:

Is this maybe a Problem with PHP? I use 5.3.2 the latest supported Version. Commons and translatewiki use 5.3.10

The point is that I didn't change anything with the configuration and with folder permissions just updated mediawiki through git

Can you confirm that all files show this error?

http://www.wecowi.de/images/thumb/6/66/Yosemite_Half_Dome.jpg/120px-Yosemite_Half_Dome.jpg
Not Found
The requested document was not found on this server.

We have something similar going on at WMF for some images (not new uploads, just recent uploads in pseudo-random timespans):
https://upload.wikimedia.org/wikipedia/commons/thumb/e/eb/John_Angelos.JPG/160px-John_Angelos.JPG
Error generating thumbnail
The source file 'John_Angelos.JPG' does not exist.

I don't know if it's the same issue, ah Aaron just said "probably not".

dasch wrote:

At the moment all files show errors and do not work. Maybe this Debug Output can help?

MimeMagic::construct: loading mime types from /var/www/vhosts/wecowi.de/httpdocs/includes/mime.types
MimeMagic::
construct: loading mime info from /var/www/vhosts/wecowi.de/httpdocs/includes/mime.info
File::transform: Doing stat for mwstore://local-backend/local-thumb/6/66/Yosemite_Half_Dome.jpg/555px-Yosemite_Half_Dome.jpg
FileBackendStore::getFileStat: File mwstore://local-backend/local-thumb/6/66/Yosemite_Half_Dome.jpg/555px-Yosemite_Half_Dome.jpg does not exist.
BitmapHandler::doTransform: creating 555x414 thumbnail at /var/www/vhosts/wecowi.de/httpdocs/images/tmp/transform_78b27c601de6-1.jpg using scaler im
BitmapHandler::doTransform: called wfMkdirParents(/var/www/vhosts/wecowi.de/httpdocs/images/tmp)
BitmapHandler::getMagickVersion: Running convert -version
wfShellExec: /bin/bash '/var/www/vhosts/wecowi.de/httpdocs/bin/ulimit5.sh' 350 302400 302400 180 ''\''/usr/local/bin/convert'\'' -version'
BitmapHandler::getMagickVersion: ImageMagick version check failed
BitmapHandler::transformImageMagick: running ImageMagick: '/usr/local/bin/convert' -quality 80 -background white '/var/www/vhosts/wecowi.de/httpdocs/images/6/66/Yosemite_Half_Dome.jpg' -thumbnail '555x414!' -set comment 'File source: http://www.wecowi.de/wiki/Datei:Yosemite_Half_Dome.jpg' -depth 8 -sharpen '0x0.4' -rotate -0 '/var/www/vhosts/wecowi.de/httpdocs/images/tmp/transform_78b27c601de6-1.jpg' 2>&1
wfShellExec: /bin/bash '/var/www/vhosts/wecowi.de/httpdocs/bin/ulimit5.sh' 350 302400 302400 180 'OMP_NUM_THREADS='\''1'\'' MAGICK_TMPDIR='\''/var/www/vhosts/wecowi.de/httpdocs/images/tmp'\'' '\''/usr/local/bin/convert'\'' -quality 80 -background white '\''/var/www/vhosts/wecowi.de/httpdocs/images/6/66/Yosemite_Half_Dome.jpg'\'' -thumbnail '\''555x414!'\'' -set comment '\''File source: http://www.wecowi.de/wiki/Datei:Yosemite_Half_Dome.jpg'\'' -depth 8 -sharpen '\''0x0.4'\'' -rotate -0 '\''/var/www/vhosts/wecowi.de/httpdocs/images/tmp/transform_78b27c601de6-1.jpg'\'' 2>&1'
File::transform: Doing stat for mwstore://local-backend/local-thumb/6/66/Yosemite_Half_Dome.jpg/833px-Yosemite_Half_Dome.jpg
FileBackendStore::getFileStat: File mwstore://local-backend/local-thumb/6/66/Yosemite_Half_Dome.jpg/833px-Yosemite_Half_Dome.jpg does not exist.
BitmapHandler::doTransform: creating 833x622 thumbnail at /var/www/vhosts/wecowi.de/httpdocs/images/tmp/transform_714af6f12892-1.jpg using scaler im
BitmapHandler::doTransform: called wfMkdirParents(/var/www/vhosts/wecowi.de/httpdocs/images/tmp)
BitmapHandler::getMagickVersion: Running convert -version
wfShellExec: /bin/bash '/var/www/vhosts/wecowi.de/httpdocs/bin/ulimit5.sh' 350 302400 302400 180 ''\''/usr/local/bin/convert'\'' -version'
BitmapHandler::getMagickVersion: ImageMagick version check failed
BitmapHandler::transformImageMagick: running ImageMagick: '/usr/local/bin/convert' -quality 80 -background white '/var/www/vhosts/wecowi.de/httpdocs/images/6/66/Yosemite_Half_Dome.jpg' -thumbnail '833x622!' -set comment 'File source: http://www.wecowi.de/wiki/Datei:Yosemite_Half_Dome.jpg' -depth 8 -sharpen '0x0.4' -rotate -0 '/var/www/vhosts/wecowi.de/httpdocs/images/tmp/transform_714af6f12892-1.jpg' 2>&1
wfShellExec: /bin/bash '/var/www/vhosts/wecowi.de/httpdocs/bin/ulimit5.sh' 350 302400 302400 180 'OMP_NUM_THREADS='\''1'\'' MAGICK_TMPDIR='\''/var/www/vhosts/wecowi.de/httpdocs/images/tmp'\'' '\''/usr/local/bin/convert'\'' -quality 80 -background white '\''/var/www/vhosts/wecowi.de/httpdocs/images/6/66/Yosemite_Half_Dome.jpg'\'' -thumbnail '\''833x622!'\'' -set comment '\''File source: http://www.wecowi.de/wiki/Datei:Yosemite_Half_Dome.jpg'\'' -depth 8 -sharpen '\''0x0.4'\'' -rotate -0 '\''/var/www/vhosts/wecowi.de/httpdocs/images/tmp/transform_714af6f12892-1.jpg'\'' 2>&1'
File::transform: Doing stat for mwstore://local-backend/local-thumb/6/66/Yosemite_Half_Dome.jpg/1110px-Yosemite_Half_Dome.jpg
FileBackendStore::getFileStat: File mwstore://local-backend/local-thumb/6/66/Yosemite_Half_Dome.jpg/1110px-Yosemite_Half_Dome.jpg does not exist.
BitmapHandler::doTransform: creating 1110x829 thumbnail at /var/www/vhosts/wecowi.de/httpdocs/images/tmp/transform_3dbdf6ca567e-1.jpg using scaler im
BitmapHandler::doTransform: called wfMkdirParents(/var/www/vhosts/wecowi.de/httpdocs/images/tmp)
BitmapHandler::getMagickVersion: Running convert -version
wfShellExec: /bin/bash '/var/www/vhosts/wecowi.de/httpdocs/bin/ulimit5.sh' 350 302400 302400 180 ''\''/usr/local/bin/convert'\'' -version'
BitmapHandler::getMagickVersion: ImageMagick version check failed
BitmapHandler::transformImageMagick: running ImageMagick: '/usr/local/bin/convert' -quality 80 -background white '/var/www/vhosts/wecowi.de/httpdocs/images/6/66/Yosemite_Half_Dome.jpg' -thumbnail '1110x829!' -set comment 'File source: http://www.wecowi.de/wiki/Datei:Yosemite_Half_Dome.jpg' -depth 8 -sharpen '0x0.4' -rotate -0 '/var/www/vhosts/wecowi.de/httpdocs/images/tmp/transform_3dbdf6ca567e-1.jpg' 2>&1
wfShellExec: /bin/bash '/var/www/vhosts/wecowi.de/httpdocs/bin/ulimit5.sh' 350 302400 302400 180 'OMP_NUM_THREADS='\''1'\'' MAGICK_TMPDIR='\''/var/www/vhosts/wecowi.de/httpdocs/images/tmp'\'' '\''/usr/local/bin/convert'\'' -quality 80 -background white '\''/var/www/vhosts/wecowi.de/httpdocs/images/6/66/Yosemite_Half_Dome.jpg'\'' -thumbnail '\''1110x829!'\'' -set comment '\''File source: http://www.wecowi.de/wiki/Datei:Yosemite_Half_Dome.jpg'\'' -depth 8 -sharpen '\''0x0.4'\'' -rotate -0 '\''/var/www/vhosts/wecowi.de/httpdocs/images/tmp/transform_3dbdf6ca567e-1.jpg'\'' 2>&1'
Pulling file metadata from cache key admin_wecowi:file:1adb9a6555187fbaf74974bea3de3183
File::transform: Doing stat for mwstore://local-backend/local-thumb/1/1a/Mono_Lake_Türmchen.jpg/555px-Mono_Lake_Türmchen.jpg
FileBackendStore::getFileStat: File mwstore://local-backend/local-thumb/1/1a/Mono_Lake_Türmchen.jpg/555px-Mono_Lake_Türmchen.jpg does not exist.
BitmapHandler::doTransform: creating 555x370 thumbnail at /var/www/vhosts/wecowi.de/httpdocs/images/tmp/transform_11159b9141a4-1.jpg using scaler im
BitmapHandler::doTransform: called wfMkdirParents(/var/www/vhosts/wecowi.de/httpdocs/images/tmp)
BitmapHandler::getMagickVersion: Running convert -version
wfShellExec: /bin/bash '/var/www/vhosts/wecowi.de/httpdocs/bin/ulimit5.sh' 350 302400 302400 180 ''\''/usr/local/bin/convert'\'' -version'
BitmapHandler::getMagickVersion: ImageMagick version check failed
BitmapHandler::transformImageMagick: running ImageMagick: '/usr/local/bin/convert' -quality 80 -background white '/var/www/vhosts/wecowi.de/httpdocs/images/1/1a/Mono_Lake_Türmchen.jpg' -thumbnail '555x370!' -set comment 'File source: http://www.wecowi.de/wiki/Datei:Mono_Lake_T%%C3%%BCrmchen.jpg' -depth 8 -sharpen '0x0.4' -rotate -0 '/var/www/vhosts/wecowi.de/httpdocs/images/tmp/transform_11159b9141a4-1.jpg' 2>&1
wfShellExec: /bin/bash '/var/www/vhosts/wecowi.de/httpdocs/bin/ulimit5.sh' 350 302400 302400 180 'OMP_NUM_THREADS='\''1'\'' MAGICK_TMPDIR='\''/var/www/vhosts/wecowi.de/httpdocs/images/tmp'\'' '\''/usr/local/bin/convert'\'' -quality 80 -background white '\''/var/www/vhosts/wecowi.de/httpdocs/images/1/1a/Mono_Lake_Türmchen.jpg'\'' -thumbnail '\''555x370!'\'' -set comment '\''File source: http://www.wecowi.de/wiki/Datei:Mono_Lake_T%%C3%%BCrmchen.jpg'\'' -depth 8 -sharpen '\''0x0.4'\'' -rotate -0 '\''/var/www/vhosts/wecowi.de/httpdocs/images/tmp/transform_11159b9141a4-1.jpg'\'' 2>&1'
File::transform: Doing stat for mwstore://local-backend/local-thumb/1/1a/Mono_Lake_Türmchen.jpg/833px-Mono_Lake_Türmchen.jpg
FileBackendStore::getFileStat: File mwstore://local-backend/local-thumb/1/1a/Mono_Lake_Türmchen.jpg/833px-Mono_Lake_Türmchen.jpg does not exist.
BitmapHandler::doTransform: creating 833x555 thumbnail at /var/www/vhosts/wecowi.de/httpdocs/images/tmp/transform_6279c17a26df-1.jpg using scaler im
BitmapHandler::doTransform: called wfMkdirParents(/var/www/vhosts/wecowi.de/httpdocs/images/tmp)
BitmapHandler::getMagickVersion: Running convert -version
wfShellExec: /bin/bash '/var/www/vhosts/wecowi.de/httpdocs/bin/ulimit5.sh' 350 302400 302400 180 ''\''/usr/local/bin/convert'\'' -version'
BitmapHandler::getMagickVersion: ImageMagick version check failed
BitmapHandler::transformImageMagick: running ImageMagick: '/usr/local/bin/convert' -quality 80 -background white '/var/www/vhosts/wecowi.de/httpdocs/images/1/1a/Mono_Lake_Türmchen.jpg' -thumbnail '833x555!' -set comment 'File source: http://www.wecowi.de/wiki/Datei:Mono_Lake_T%%C3%%BCrmchen.jpg' -depth 8 -sharpen '0x0.4' -rotate -0 '/var/www/vhosts/wecowi.de/httpdocs/images/tmp/transform_6279c17a26df-1.jpg' 2>&1
wfShellExec: /bin/bash '/var/www/vhosts/wecowi.de/httpdocs/bin/ulimit5.sh' 350 302400 302400 180 'OMP_NUM_THREADS='\''1'\'' MAGICK_TMPDIR='\''/var/www/vhosts/wecowi.de/httpdocs/images/tmp'\'' '\''/usr/local/bin/convert'\'' -quality 80 -background white '\''/var/www/vhosts/wecowi.de/httpdocs/images/1/1a/Mono_Lake_Türmchen.jpg'\'' -thumbnail '\''833x555!'\'' -set comment '\''File source: http://www.wecowi.de/wiki/Datei:Mono_Lake_T%%C3%%BCrmchen.jpg'\'' -depth 8 -sharpen '\''0x0.4'\'' -rotate -0 '\''/var/www/vhosts/wecowi.de/httpdocs/images/tmp/transform_6279c17a26df-1.jpg'\'' 2>&1'
File::transform: Doing stat for mwstore://local-backend/local-thumb/1/1a/Mono_Lake_Türmchen.jpg/1110px-Mono_Lake_Türmchen.jpg
FileBackendStore::getFileStat: File mwstore://local-backend/local-thumb/1/1a/Mono_Lake_Türmchen.jpg/1110px-Mono_Lake_Türmchen.jpg does not exist.
BitmapHandler::doTransform: creating 1110x740 thumbnail at /var/www/vhosts/wecowi.de/httpdocs/images/tmp/transform_655411fe238c-1.jpg using scaler im
BitmapHandler::doTransform: called wfMkdirParents(/var/www/vhosts/wecowi.de/httpdocs/images/tmp)
BitmapHandler::getMagickVersion: Running convert -version
wfShellExec: /bin/bash '/var/www/vhosts/wecowi.de/httpdocs/bin/ulimit5.sh' 350 302400 302400 180 ''\''/usr/local/bin/convert'\'' -version'
BitmapHandler::getMagickVersion: ImageMagick version check failed
BitmapHandler::transformImageMagick: running ImageMagick: '/usr/local/bin/convert' -quality 80 -background white '/var/www/vhosts/wecowi.de/httpdocs/images/1/1a/Mono_Lake_Türmchen.jpg' -thumbnail '1110x740!' -set comment 'File source: http://www.wecowi.de/wiki/Datei:Mono_Lake_T%%C3%%BCrmchen.jpg' -depth 8 -sharpen '0x0.4' -rotate -0 '/var/www/vhosts/wecowi.de/httpdocs/images/tmp/transform_655411fe238c-1.jpg' 2>&1
wfShellExec: /bin/bash '/var/www/vhosts/wecowi.de/httpdocs/bin/ulimit5.sh' 350 302400 302400 180 'OMP_NUM_THREADS='\''1'\'' MAGICK_TMPDIR='\''/var/www/vhosts/wecowi.de/httpdocs/images/tmp'\'' '\''/usr/local/bin/convert'\'' -quality 80 -background white '\''/var/www/vhosts/wecowi.de/httpdocs/images/1/1a/Mono_Lake_Türmchen.jpg'\'' -thumbnail '\''1110x740!'\'' -set comment '\''File source: http://www.wecowi.de/wiki/Datei:Mono_Lake_T%%C3%%BCrmchen.jpg'\'' -depth 8 -sharpen '\''0x0.4'\'' -rotate -0 '\''/var/www/vhosts/wecowi.de/httpdocs/images/tmp/transform_655411fe238c-1.jpg'\'' 2>&1'

dasch wrote:

The only point about this that I do not understand is where
"mwstore://local-backend/local-thumb/…" points cause this is the only point where an error is shown

The interesting line there imho is the convert version check failed. There were recent changes to the ulimit script if I recall. I wonder if that's related

(In reply to comment #17)

Can you confirm that all files show this error?

http://www.wecowi.de/images/thumb/6/66/Yosemite_Half_Dome.jpg/120px-
Yosemite_Half_Dome.jpg
Not Found
The requested document was not found on this server.

Note that is an apache error not a mw error. Like most non wmf setups he's not using 404 thumb generation so that error message is just a standard thumb doesnt currently exist and wouldn't have much to do with the cause (unlike the thumb errors on wmf)

dasch wrote:

(In reply to comment #20)

The interesting line there imho is the convert version check failed. There
were
recent changes to the ulimit script if I recall. I wonder if that's related

so it might be, that convert is executed in a wrong way because the version is not check correctly?
Maybe then the problem with PdfHandler is also caused by this.

(In reply to comment #21)

Note that is an apache error not a mw error. Like most non wmf setups he's
not
using 404 thumb generation so that error message is just a standard thumb
doesnt currently exist and wouldn't have much to do with the cause (unlike
the
thumb errors on wmf)

Ok, sorry.

(In reply to comment #20)

The interesting line there imho is the convert version check failed. There
were
recent changes to the ulimit script if I recall. I wonder if that's related

Indeed https://gerrit.wikimedia.org/r/#/c/43405/ broke other things (see last comment, no bug filed as far as I know).
Maybe you have to raise $wgMaxShellWallClockTime ?

dasch wrote:

This could explain this

/bin/bash '/var/www/vhosts/wecowi.de/httpdocs/bin/ulimit5.sh' 350 302400 302400 180 ''\''/usr/bin/convert'\'' -version'
/var/www/vhosts/wecowi.de/httpdocs/bin/ulimit5.sh: line 13: timeout: command not found

dasch wrote:

Okay I got it
The problem is, that the function timeout is not always installed
I don't know how it worked until now, but after installing timeout on my server it works now!

Hmm it appears (from what ive googled) timeout is a gnu specific program. (Not part of posix or whatever) we should check for its exisistence before using it for compatability with non-gnu unixes.

dasch wrote:

I have ubuntu installed on a vserver. The installations there are often very minimalistic and this could mean, that even when this is installed by ubuntu by default it must not be installed on a vserver with ubuntu. A warning / error message with instruction how to solve the problem should be added.

Gilles raised the priority of this task from High to Unbreak Now!.Dec 4 2014, 10:21 AM
Gilles moved this task from Untriaged to Done on the Multimedia board.
Gilles lowered the priority of this task from Unbreak Now! to High.Dec 4 2014, 11:21 AM