2

I'm the main developer behind Practical Plants. We're using InstantCommons to grab images from the commons, but it seems like they're failing to cache locally, making page loads slow and placing unnecessary burden on the Commons.

I've set $wgUseInstantCommons=true, which downloads images just fine, but doesn't cache them. I get this in my debug.log:

ForeignAPIRepo: HTTP GET: http://commons.wikimedia.org/w/api.php?titles=File%3ABrassica_oleracea0.jpg&iiprop=timestamp%7Cuser%7Ccomment%7Curl%7Csize%7Csha1%7Cmetadata%7Cmime&prop=imageinfo&iimetadataversion=2&format=json&action=query&redirects=true
Class PEAR_Error not found; skipped loading
ForeignAPIRepo: HTTP GET: http://commons.wikimedia.org/w/api.php?titles=File%3ABrassica_oleracea0.jpg&iiprop=url%7Ctimestamp&iiurlwidth=248&iiurlheight=-1&iiurlparam=248px&prop=imageinfo&format=json&action=query&redirects=true
ForeignAPIRepo::getThumbUrl got remote thumb http://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Brassica_oleracea0.jpg/248px-Brassica_oleracea0.jpg
ForeignAPIRepo: HTTP GET: http://commons.wikimedia.org/w/api.php?titles=mwstore%3A%2F%2Fwikimediacommons-backend%2Fwikimediacommons-thumb%2F1%2F11%2FBrassica_oleracea0.jpg%2F248px-Brassica_oleracea0.jpg&prop=imageinfo&format=json&action=query&redirects=true
ForeignAPIRepo::getThumbUrlFromCache Thumbnail was already downloaded before
ForeignAPIRepo: HTTP GET: http://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Brassica_oleracea0.jpg/248px-Brassica_oleracea0.jpg
ForeignAPIRepo::getThumbUrlFromCache could not write to thumb path: mwstore://wikimediacommons-backend/wikimediacommons-thumb/1/11/Brassica_oleracea0.jpg/248px-Brassica_oleracea0.jpg

Note that the path output in the error ForeignAPIRepo:getThumbUrlFromCache was added by me to try and understand the problem a little, so that lines 300-305 in my ForeignAPIRepo.php file look like this

$op = array( 'op' => 'create', 'dst' => $localFilename, 'content' => $thumb );
if( !$backend->doOperation( $op )->isOK() ) {
 wfRestoreWarnings();
 wfDebug( __METHOD__ . " could not write to thumb path: ".$localFilename."\n" );
 return $foreignUrl;
}

Anyone have a clue what might be going on here? My ./images dir and all subdirectories are 775 (apache user has group rights) so they're definately writable. Furthermore, locally uploaded images work fine.

If I can provide any more information, please let me know!

svick
246k54 gold badges405 silver badges534 bronze badges
asked Dec 20, 2012 at 16:59
1
  • I really doubt it's going to help, but you could try getting a copy of PEAR_Error installed, to see if anything interesting is reported... Commented Dec 21, 2012 at 5:25

2 Answers 2

1

Upgrading to 1.20.2 has fixed this issue, so I'm assuming it was just a bug with the version of MediaWiki I was using (1.19.X).

answered Dec 21, 2012 at 13:04
Sign up to request clarification or add additional context in comments.

Comments

0

Note that, starting in MediaWiki 1.27, InstantCommons will hotlink thumbnails instead of generating them locally. This will greatly reduce headaches. The configuration can also be used on older releases.

answered Nov 7, 2015 at 9:29

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.