Page MenuHomePhabricator

Images are not showing when using ForeignDBRepo on MW 1.17
Closed, DeclinedPublic

Description

Author: jean.luc.henry

Description:
After update from 1.16 to 1.17, images are not showing and, I have 2 error messages in apache error log:

PHP Warning: mysql_query() expects parameter 2 to be resource, null given in .../w/includes/db/DatabaseMysql.php on line 23

PHP Warning: mysql_real_escape_string() expects parameter 2 to be resource, null given in .../w/includes/db/DatabaseMysql.php on line 316

I am using ForeignDBRepo and, it seems to be related.

  1. Images are showing on the images repository (1.17 version)
  2. Images are showing if using an MW 1.16 version connected to the 1.17 repo.
  3. Images are not showing on an 1.17 connected to the 1.17 repo.

My issue is probably the same as this one describe here: http://www.mediawiki.org/wiki/Thread:Project:Support_desk/$wgUseSharedUploads_causes_trouble

Here is my ForeignDBRepo configuration:

$wgForeignFileRepos[] = array(

'class' => 'ForeignDBRepo',
'name' => 'base',
'url' => "http://base.ekopedia.org/w/images",
'directory' => '/var/www/base.ekopedia.org/w/images',
'hashLevels' => 2,
'dbType' => 'mysql',
'dbServer' => 'localhost',
'dbUser' => 'ekopedia',
'dbPassword' => 'xxxxxxxxxxxx',
'dbFlags' => DBO_DEFAULT,
'dbName' => 'ekobase',
'tablePrefix' => '',
'hasSharedCache' => false,
'descBaseUrl' => 'http://base.ekopedia.org/Image:',
'fetchDescription' => true

);


Version: 1.17.x
Severity: normal

Details

Reference
bz31943

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:54 PM
bzimport set Reference to bz31943.
bzimport added a subscriber: Unknown Object (MLST).

jean.luc.henry wrote:

The bug is not here when using ForeignAPIRepo:

$wgForeignFileRepos[] = array(

'class'                   => 'ForeignAPIRepo',
'name'                    => 'shared',
'apibase'                 => 'http://base.ekopedia.org/w/api.php',
'fetchDescription'        => true, // Optional
'descriptionCacheExpiry'  => 43200, // 12 hours, optional (values are seconds)
'apiThumbCacheExpiry'     => 43200, // 12 hours, optional, but required for local thumb caching

);

Tested on MediaWiki 1.22alpha. Can not reproduce. Is this still an issue for you?

donxello wrote:

Hi, Mediawiki 1.21 (upgrade from 1.16). 6 WIKIs, 1 WIKI is the commons.wiki....
where the mediafiles are saved.
We use the wgForeignFileRepos which works perfect (means we see the file and we can even enlarge it!) BUT NOT getting thumbs.
No thumbnailing if a mediafile is used in the various language WIKIs (if a "local" Mediafile is used, meaning directly uploaded to the corresponding WIKI thumbnailing works).
The error we get is strange because it assumes we have an ImageMagick issue which is definetely not the case as everythings works within 1 wiki.

convert: no decode delegate for this image format `/var/tmp/magick-6505R3QorkgCQavW' @ error/constitute.c/ReadImage/550.
convert: no images defined `/var/tmp//transform_853b47e1b746-1.jpg' @ error/convert.c/ConvertImageCommand/3078

Any ideas?

Cheers
Christian
~~~~

If no one here knows, you can always ask in the ImageMagick forum: http://www.imagemagick.org/discourse-server/

Error message probably indicates something goes wrong when copying over the image file (aka image is corupted, or image magick is set on a zero-byte file, etc)

Tested again on 1.24alpha. Works fine for me. Closing worksforme. It appears the issue described above is either some sort of configuration issue, or something wrong with your image magick install.

Please re-open if you have steps to reproduce that can be followed outside of your install to generate the error

Gilles raised the priority of this task from Medium to Unbreak Now!.Dec 4 2014, 10:20 AM
Gilles added a project: Multimedia.
Gilles moved this task from Untriaged to Done on the Multimedia board.
Gilles lowered the priority of this task from Unbreak Now! to Medium.Dec 4 2014, 11:22 AM