The message "Error creating thumbnail: File missing" is misleading in cases where it is shown for all files e.g. via "Brows Files". More often than not the reason then is not that the File is missing but that the relevant configuration variables in LocalSettings.php point to the wrong directory or have not been set correctly.
To improve the situation it would be good if the error would include "probably there is a misconfiguration - please contact your administrator" if the message occurs too often and has a link to the appropriate FAQ section in the Manual (which might habe to be added since the link in the support desk reply did not have information about the needed $wg variables.
In my concrete scenario the solution was to add
global $wgWikiFarmSite; global $wgUploadDirectory; global $wgUploadPath; global $wgScriptPath; $wgUploadDirectory = "/var/www/wikifarm/sites/$wgWikiFarmSite/images"; $wgUploadPath = "$wgScriptPath/images/$wgWikiFarmSite";
to LocalSettings.php or to be more precsise to one of the include files being picked up by the WikiFarm configuration.
Situation
Need for migrating a wiki farm from MediaWiki 1.27.3 to 1.33.4
Action
- Copy SQL database
- Copy Image directory
- Create new code directory with untar of mediawiki-1.33.4.tar.gz
- Create new LocalSettings.php with installation procedure
- Split LocalSettings.php with Farm approach so that MyFarmSettings.php is holding the common settings for the farm.
- Try getting the wiki to run step by step by copying LocalSettings.php code e.g. for extensions from the old MediaWiki 1.27.3 farm
Expected Result
Even if misconfigured e.g. forgetting to set the $wgUploadDirectory or $wgUploadPath properly error messages should indicate where the problem is.
Seen Result
"File Missing" message for each and every file shown in "Browse Files"
LocalSettings.php
<?php /** * MediaWiki wikifarm handling code * * Taken from Drupal code to tap multisite configuration. */ // returns true if $needle is a substring of $haystack function contains($needle, $haystack) { return strpos($haystack, $needle) !== false; } /** * Find the appropriate configuration directory for the current request */ function findConfiguration($confdir,$domain) { if (isset($_SERVER['SERVER_PORT'])) { $port = $_SERVER['SERVER_PORT']; switch ($port) { case 8900: return "wiki1"; case 8901: return "wiki2"; case 8902: return "wiki3"; } } global $wgServer; $host=parse_url($wgServer,PHP_URL_HOST); if ($host) return $host; else return NULL; } /** * optionally add the given settings */ function optionalRequireSettings($settings) { if (file_exists($settings)) { require_once($settings); } } # the main configuration directory in which all wiki farm member sites are configured $confdir = '/var/www/wikifarm/sites'; # The Prefix to use for local/specialized configuration files $prefix="MyFarm"; # find the configuration for the current request $domain="my-domain.org"; $conf=findConfiguration($confdir,$domain); #$conf=NULL; # if we found a configuration then use it if ($conf) { # make sure all farm members use the same .smw.json file # https://www.semantic-mediawiki.org/wiki/Help:$smwgConfigFileDir global $smwgConfigFileDir; global $wgWikiFarmSite; $wgWikiFarmSite=$conf; $wgShowExceptionDetails=true; $smwgConfigFileDir = $confdir; # # first use the specific LocalSettings for the site require_once( "$confdir/$conf/LocalSettings.php" ); # then use the global settings for the farm optionalRequireSettings("$confdir/{$prefix}Settings.php"); # if there are further specific settings for the site use them optionalRequireSettings("$confdir/$conf/{$prefix}Settings.php"); } else { $IP = '.'; require_once( './includes/DefaultSettings.php' ); # used for printing the version require_once( './includes/NoLocalSettings.php' ); die("wikifarm could not find configuration for $wgServer"); } ?>