Topic on Project:Support desk

[RESOLVED] Upgraded old MW site to 1.23.3 and thumbnails stopped working

16
AtariDal (talkcontribs)

I have migrated a MW site onto a new VPS and noticed the version was old (1.16.1). So I updated it to 1.23.3 and after the upgrade, the thumbnails stopped working. Each thumbnail is now replaced by the message "Error creating thumbnail: File missing"

The thumbnails worked perfectly before the upgrade.

I switched on all the debugging by adding the following lines to LocalSettings.php:

# Debug mode on
$wgShowExceptionDetails = true;
$wgDebugToolbar = true;
$wgShowDebug = true;
$wgDevelopmentWarnings = true;

Nothing particularly useful is shown in the debug information that helps me identify the cause.

Today I decided to roll in the latest minor releases one by one and here are my results:

  • 1.16.1 - 1.17.5 = OK
  • 1.17.5 - 1.18.6 = OK
  • 1.18.6 - 1.19.18 = BANG!

I looked at the release notes for 1.19 and also found some posts that I thought might be related to thumbnails and MW 1.19 but none of the solutions offered seem to help me at all.

  • Imagemagick version: 6.7.7.10
  • php5-imagick is installed
  • php version: 5.4.4-14+deb7u14 (apache2handler)
  • MySQL version: 5.5.38-0+wheezy1

It's beaten me... Anyone have any ideas? I'm hoping for something simple!

Ciencia Al Poder (talkcontribs)

Well, in the debug log you should see the paths of the files it's trying to generate.

I'd suggest you to try loading thumb.php on your wiki to generate a thumbnail (specifying the correct parameters) and see if it throws the same error. Then go to the debug log and look at what's trying to do.

Pay special attention to all file paths it's accessing, to see if any file path is missing, or the directory structure it expects is different. Check also file permission issues.

Also look if in the debug log it attempts to run imagemagick, and if the error comes after the call to it. If that's what happens, try running the command directly (the debug log prints the command as it's being executed by MediaWiki). You may need to increase $wgMaxShellFileSize, $wgMaxShellMemory and Manual:$wgMaxShellTime.

81.130.14.204 (talkcontribs)

I seem to be having exactly the same issue. Tried to turn debug on, but not and expert on mediawiki, so not certain where I might find what the issue is, if I at least could figure out where to look:)

Here is the debug log:

151.225.159.96 (talkcontribs)

Even if someone could just give me an idea where to start to figure out if it is the database, the location of the files or one of the scripts. As it is now all I can tell is that it is trying to find a pdf (for example) in a specific location, but for one reason or another it can not find it.

I do admit that I am quite new to mediawiki (which clearly does not help), so even obvious things to check I might have missed. Tried to follow the manual, and as far as I can tell I did not miss any steps. I.E. I ran updateall, I ran reguildImages (had one unspecified issue with one image), tried rebuildAll as well, and it seems like it is finding what it wants, think it says 53 files rebuilt, the rest of the mediawiki works, its just the pictures that aren't there.


/Ben

Ciencia Al Poder (talkcontribs)

That debug log is not helpful at all, because it's for the "/mediawiki/index.php/BO_Overview" page request, but it should be for /mediawiki/thumb.php (as I suggested on the previous message).

81.130.14.204 (talkcontribs)

Thank you very much for that Ciencia, could I ask, is there somewhere I can see what the thumb.php call looks like or an example of one. Looked at ti but could not quite figure out how to make a call to do the debug on.

81.130.14.204 (talkcontribs)

OK, manage to find something, and one step forward (one step back?)

Ran it with a resolution that is to high, got Error generating thumbnail

Error creating thumbnail: Image was not scaled, is the requested width bigger than the source?


Took it down to a lower resolution, then I got Error generating thumbnail

Error creating thumbnail: File missing

Also, have set the following in LocalSettings, but not seeing any debug information $wgShowExceptionDetails = true; $wgDebugToolbar = true; $wgShowDebug = true; $wgDevelopmentWarnings = true;

Ciencia Al Poder (talkcontribs)

Manual:Thumb.php has an example call. You have to adapt it to your URL scheme (thumb.php is at the same location as index.php), and provide a valid filename from your wiki.

Did you manage to test that from your last error?

81.130.14.204 (talkcontribs)

Hello Ciencia

Do you mean the section that goes

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/?w/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/[^/]+/[^/]+$ /w/thumb_handler.php [L,QSA]
# If your $wgHashedUploadDirectory is false, remove the first two steps after thumb/
 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/?w/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/[^/]+/[^/]+$ /w/thumb_handler.php [L,QSA]

If so, where would I put that, just as a new php file called test or?. I have tried running the following 192.168.0.51/mediawiki/thumb.php?f=Chicago_bot.jpg&w=60&p=50 And I get the errors above. I also logged in as apache and tried changing files in that directory, and it definitely have full access.

Ciencia Al Poder (talkcontribs)

The correct URL should be 192.168.0.51/mediawiki/thumb.php?f=Chicago_bot.jpg&w=60

Look at the debug log when accessing that URL. You must set $wgDebugLogFile to a writable file path on the server.

81.130.115.56 (talkcontribs)

Sorry for not replying earlier

Tried to set up debugging by just setting the Debug log to /tmp/mediawiki.dbg (file not in existence)

I did this by adding it to LocalSettings.php as follows


$wgDebugLogFile = "/tmp/mediawiki.dbg"

That made media wiki stop working completely.

Ciencia Al Poder (talkcontribs)

apparently, you're missing a semicolon at the end of the line you added.

81.130.115.56 (talkcontribs)

Thank you so very very much

After much fumbling about (much due to my own lack of knowledge) I found the issue. SELINUX will not let apache (the process) write to the directory. As a temporary fix I ended up turning of SELINUX completely and the application could generate the necessary thumbnails.


Thank you all for time and effort.

Ciencia Al Poder (talkcontribs)

That's strange. Maybe the temp directory where intermediate thumbnail images are generated was changed in recent versions.

130.154.11.10 (talkcontribs)

This is happening to me too. I found that editing the wiki page and saving it, regenerates the thumbnail. Not really resolved, but a work-around if you have a small site.

Ciencia Al Poder (talkcontribs)

Thumbnails should still work if you migrated your server from one host to another, but only if you kept your old LocalSettings.php configuration about image paths, etc and you also moved all your thumbnail images to the new server, because MediaWiki will try to get them from the same location and thumbnails will be already there. Another reason may be if you changed the URL, cached pages would still point to the old URL where the image is not available anymore. Changing $wgCacheEpoch may help in this case.