Page MenuHomePhabricator

Caches stuck when uploading images with maintenance script
Closed, DeclinedPublic

Description

I'm copying pages from another wiki, and this happens

I'm running the latest mediawiki with php5-fpm, using cache=accel

to reproduce:
1 - open the page the file will eventually be at in the browser
like: wiki.example.com/index.php?title=File:myimage.jpg
2 - upload the image with the maintenance script
www-data@myserver$ php maintenance/importImages.php /path/to/images/directory

The image is not visible on the website. Instead, I only see the text
"
No file by this name exists.

Importing file
"

running the purge script
php purgeList.php --purge --all
does not correct the problem, though visiting the purge page does
wiki.example.com/index.php?title=File:myimage.jpg&action=purge

Restarting php5-fpm also corrects the issue.

Event Timeline

Hi @Azhao12345, thanks for taking the time to report this!

Which version is "the latest mediawiki" exactly?

After running php maintenance/importImages.php, did you also run php maintenance/update.php?

maintenance/update.php is for upgrading MediaWiki or adding a new extension that requires it, it shouldn't be used for this.

I'm a bit confused, you say the page contains both the text "No file by this name exists." and "Importing file"? Where in the page does "Importing file" appear?

By "cache=accel" do you mean setting $wgMainCacheType = CACHE_ACCEL?

Ah, thanks @Ciencia_Al_Poder! (and I'm sorry for having given wrong advice)

maintenance/update.php is for upgrading MediaWiki or adding a new extension that requires it, it shouldn't be used for this.

I'm a bit confused, you say the page contains both the text "No file by this name exists." and "Importing file"? Where in the page does "Importing file" appear?

By "cache=accel" do you mean setting $wgMainCacheType = CACHE_ACCEL?

It is definitely an unusual error. The text "importing file" appears directly below "no file by this name exists"

these are the cache settings:

Shared memory settings

$wgMainCacheType = CACHE_ACCEL;
$wgMemCachedServers = [];
$wgSessionCacheType=CACHE_DB;

I'm using mediawiki 1.27

@Azhao12345 Are you using File Cache? Or some other static url cache via Nginx? Or a reverse-proxy like Squid or Varnish?

If so, then the issue may be related to one of these:

If you could try again and that time also make sure it is not caused by your web browser's cache (e.g. use a force refresh, or enable "Disable cache" in the developer tools, or use Incognito mode the second time).

Aklapper changed the task status from Open to Stalled.Jun 18 2017, 4:32 PM

@Azhao12345: Could you please answer the last comment(s)?

there is no cache, just a single apache server. as I said, restarting the php daemon or going to the individual page purge endpoint.

This really should be enough info to attempt to repro the problem.

CACHE_ACCEL is a cache. It resides only on the webserver and it can't be contacted from the outside, so maintenance scripts can't clear this cache.

However, I'm not sure if MediaWiki uses it to store this kind of information, given that it should be of low capacity, probably.

@Azhao12345 Does that still happen in a supported and more recent MediaWiki version (if yes, which one)?

Unfortunately closing this Phabricator task as no further information has been provided.

@Azhao12345: After you have provided the information asked for and if this still happens, please set the status of this task back to "Open" via the Add Action...Change Status dropdown. Thanks!