Topic on Project:Support desk

MWException when I try to enable extensions

7
98.232.166.211 (talkcontribs)

Hey folks! I recently installed MediaWiki under Ubuntu 14.04 and when I try to enable ANY extension (even the built-in ones) in LocalSettings.php, this appears on my site:

[11510db67cc1ae0ba2232772] /index.php/Main_Page MWException from line 118 of /var/www/html/includes/cache/localisation/LCStoreCDB.php: Unable to move the new CDB file into place.

Backtrace:

#0 /var/www/html/includes/cache/localisation/LocalisationCache.php(1024): LCStoreCDB->finishWrite()

#1 /var/www/html/includes/cache/localisation/LocalisationCache.php(462): LocalisationCache->recache(string)

#2 /var/www/html/includes/cache/localisation/LocalisationCache.php(336): LocalisationCache->initLanguage(string)

#3 /var/www/html/includes/cache/localisation/LocalisationCache.php(273): LocalisationCache->loadItem(string, string)

#4 /var/www/html/languages/Language.php(464): LocalisationCache->getItem(string, string)

#5 /var/www/html/includes/search/SearchEngineConfig.php(42): Language->getNamespaces()

#6 /var/www/html/includes/user/User.php(1530): SearchEngineConfig->searchableNamespaces()

#7 /var/www/html/includes/user/User.php(5033): User::getDefaultOptions()

#8 /var/www/html/includes/user/User.php(528): User->loadOptions()

#9 /var/www/html/includes/user/User.php(444): User->saveToCache()

#10 /var/www/html/includes/user/User.php(405): User->loadFromId(integer)

#11 /var/www/html/includes/session/UserInfo.php(88): User->load()

#12 /var/www/html/includes/session/CookieSessionProvider.php(119): MediaWiki\Session\UserInfo::newFromId(string)

#13 /var/www/html/includes/session/SessionManager.php(479): MediaWiki\Session\CookieSessionProvider->provideSessionInfo(WebRequest)

#14 /var/www/html/includes/session/SessionManager.php(182): MediaWiki\Session\SessionManager->getSessionInfoForRequest(WebRequest)

#15 /var/www/html/includes/WebRequest.php(700): MediaWiki\Session\SessionManager->getSessionForRequest(WebRequest)

#16 /var/www/html/includes/session/SessionManager.php(121): WebRequest->getSession()

#17 /var/www/html/includes/Setup.php(745): MediaWiki\Session\SessionManager::getGlobalSession()

#18 /var/www/html/includes/WebStart.php(137): require_once(string)

#19 /var/www/html/index.php(40): require(string)

#20 {main}

Does anybody know how to fix this? I have no idea why this is happening.

Any sort of help would be appreciated. Thanks!

87.123.52.53 (talkcontribs)

Hi, perhaps setting the rights of folder /cache to 777 (= writable) will solve this problem. Cheers

98.232.166.211 (talkcontribs)

That didn't work. Any other way I can fix this?

TheDJ (talkcontribs)

The extension needs to regenerate the localization cache, and the location where it tries to write to, apparently doesn't allow writing. See also

73.196.227.225 (talkcontribs)

Ran into this problem today, hopefully these notes help someone else.

MW version: 1.27.0 System: Debian Jessie (v8.6)

What precipitated this: Debian pushed an update today to the mysql-server package. This was not the cause of the problem, but it did seem to be the trigger. (As an aside, I had a FULL backup of the wiki before upgrading. I was safe no matter what. Always. Backup. Your. Wiki. Before. You. Cause. A. Problem.)

Result: "Fatal exception of type MWException"

Solution:

1) add "$wgShowExceptionDetails = true;" to the bottom of LocalSettings.php. The point of doing this is to check that you really have the same problem, as per step 3.

2) Refresh the page.

3) Top line will now show: "Unable to move the new CDB file into place."

4) Make note of the ownership settings of the MW installation directory, so you can tighten things up again later.

5) I am running a stock version of Apache as supplied by Debian. So: chown -R www-data:www-data /usr/share/mediawiki

6) Refresh the page. Take the wiki for a test drive. Everything works now.

7) Remove "$wgShowExceptionDetails = true;" from LocalSettings.php.

8) Change the MW install directory ownership settings back to whatever satisfies your paranoia. Track down the documentation on the minimum required writable directories for normal MW operation. This is left as an exercise for the reader.

To be clear, the problem was caused by incorrect ownership settings on the MW cache directory. So, the solution procedure above is a bit of a sledgehammer, but it worked.