Last modified: 2011-12-06 06:50:54 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T34800, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 32800 - dumpBackup.php fails when $wgMainCacheType = CACHE_ACCEL; (and apc is disabled on commandline php)
dumpBackup.php fails when $wgMainCacheType = CACHE_ACCEL; (and apc is disable...
Status: NEW
Product: MediaWiki
Classification: Unclassified
Maintenance scripts (Other open bugs)
1.18.x
All All
: Normal major (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-05 07:06 UTC by Jools Wills
Modified: 2011-12-06 06:50 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Jools Wills 2011-12-05 07:06:41 UTC
Steps to reproduce

1) set $wgMainCacheType = CACHE_APC;
2) from commandline (without apc enabled), run dumpBackup.php

CACHE_ACCEL requested but no suitable object cache is present. You may want to install APC.
Backtrace:
#0 [internal function]: ObjectCache::newAccelerator(Array)
#1 mediawiki/includes/objectcache/ObjectCache.php(62): call_user_func('ObjectCache::ne...', Array)
#2 mediawiki/includes/objectcache/ObjectCache.php(50): ObjectCache::newFromParams(Array)
#3 mediawiki/includes/objectcache/ObjectCache.php(23): ObjectCache::newFromId(3)
#4 mediawiki/includes/GlobalFunctions.php(3600): ObjectCache::getInstance(3)
#5 mediawiki/includes/Setup.php(402): wfGetMainCache()
#6 mediawiki/maintenance/doMaintenance.php(98): require_once('...')
#7 mediawiki/maintenance/commandLine.inc(64): require('...')
#8 mediawiki/maintenance/dumpBackup.php(32): require_once('...')
#9 {main}

(note some paths have been stripped for security)

This worked on 1.17. It is quite common to want APC enabled for www, but not have it running for commandline php.
Comment 1 Jools Wills 2011-12-05 07:12:10 UTC
Correction: I have cache set to $wgMainCacheType = CACHE_ACCEL;
Comment 2 Brion Vibber 2011-12-05 08:03:10 UTC
This sort of caching is known to cause problems when mixed with command line utilities or multiple servers. As a workaround, disable the CACHE_ACCEL in your LocalSettings.php with a condition like this:

if (php_sapi_name != "cli") {
  ...
}

dumpBackup.php should be safe to run in that config, I think, as it won't be making writes and thus needs no cache clears.
Comment 3 Jools Wills 2011-12-05 08:09:44 UTC
Will do. Is this still considered a bug though - I mean if there is no cache available, shouldn't the mediawiki code just not use any cache functions instead of throwing an exception ?
Comment 4 Niklas Laxström 2011-12-05 08:43:36 UTC
It's a faulty configuration. Some scripts rely on being able to clear the cache (like the password reset script) and having them silently not work is not nice.
Comment 5 Jools Wills 2011-12-05 08:55:16 UTC
am i missing something. If there is no cache in use, then they should work anyway surely. This all worked in 1.17 - and I saw no information relating to needing this logic wrapped around the configuration setting.

The sensible thing would be if there is no apc cache as in this case, to fall back on not using a cache. Not failing (which is a change from behaviour from 1.17)
Comment 6 Brion Vibber 2011-12-05 16:06:57 UTC
That script would work, but bad data could be left in the caches for your web scripts.

Ultimately it's our fault for having this config option available at all when we constantly recommend against it. :P
Comment 7 Daniel Friesen 2011-12-05 16:11:43 UTC
Jools, Niklas is saying that some cli scripts also do work that involves clearing the web side's cache.
ie: There's something cached for the web version, a script from the cli is run, modifies the backing information, and wants to clear that information. If there's a cache on the web but not cache in the cli then that means that falling back to no-cache and purging that means inadvertently the script has thought it cleared the cache when in reality the cache is still there on the web, and the web side of the wiki is still serving outdated information to users.
Comment 8 Jools Wills 2011-12-06 06:50:54 UTC
Thanks for the clarification and help everyone. appreciated.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links