4

I just upgraded a MediaWiki installation from version 1.25.x to 1.26.1, but now the styling information is not displaying. Hence, the page displays all text-like without the links column at the left. When I view the source of the page and click on the link that is supposed to load the style, there appears to be some CSS but the file starts as follows:

/* Internal error

Internal error

Problematic modules: {"mediawiki.sectionAnchor":"error","skins.vector.styles":"error"} */

When I click instead on the script link in the page source, presumably for the default script, it shows a similar message (but without much actual code):

/* Internal error

Internal error

Problematic modules: {"startup":"error"} */

From searching Online I found the following two pages, which as of this writing do not have any solutions:

https://www.mediawiki.org/wiki/Topic:Sty0r6j0y9u8yute

https://www.mediawiki.org/wiki/Topic:Stvdbhcbttk5aa9d

If it matters, the installation I am working with is on HTTPS. The $wgServer setting is set accordingly to $wgServer = "//www.some-domain.com";. Images load just fine, and there are no 404's or other such HTTP errors on the network tab of the browser debugger. The server is running PHP version 5.6.16.

My questions are:

(1) Has anyone else had this problem and found a solution other than downgrading PHP?

(2) Does anyone know if upgrading PHP to the new 7.x series would resolve this issue? (there are some big WordPress installations on the same server, so I have not dared trying to install the new PHP just yet)

Update 1: While I have no idea what the underlying issue is, apparently the problem is specific to the default Vector skin. I changed the $wgDefaultSkin setting (in LocalSettings.php) from vector to monobook, and now the wiki displays just fine.

Update 2: As was requested in the comments, I tried downloading the Vector skin directly from GitHub. I downloaded the latest master branch (as of 2015-12-18). Unfortunately, it made no difference. After deleting the old files and copying in the new (or same?) files and changing the setting back to vector, the problem came back.

Update 3: For the sake of completeness, I tried installing the wmf/1.27.0-wmf.9 branch of Vector, but it made no difference. I even tried restarting the Web server to make sure it was not a caching issue.

Update 4: I tried clearing the server-wide PHP cache, but it made no difference. I then tried enabling the $wgResourceLoaderDebug option. While this option did not resolve the issue with loading, I suppose it would provide better details to someone actually debugging the skin. With this option enabled, the page source shows 5 separate stylesheet entries, only two of which get the Internal error. There is still only one script entry, and it still gets the error.

Michael
  • 231
  • 2
  • 8
  • I am using MediaWiki 1.27alpha, i did almost all updates from 1.1 to 1.27 without trouble, on Debian 6 to today configuration : Debian 8.1 with PHP 5.6.14-0+deb8u1 without this kind of trouble. I would try to check your skin folder, where your style (vector ?), and if you have a vector in extension folder, try to remove it. – Froggiz Dec 18 '15 at 11:06
  • I looked in the *skins* folder, but I could not see anything obvious to do there. I was using the default setting of *vector*, and none of the skins had been modified from the default download package. I tried searching for vector in the *extensions* folder, but nothing was found. What I did end up trying was changing the *wgDefaultSkin* setting (in *LocalSettings.php*) from *vector* to *monobook*, and now the site works just fine. Apparently the problem is with the *vector* skin. – Michael Dec 18 '15 at 14:31
  • So you may have to update vector skin, here you can fin the git repo : https://github.com/wikimedia/mediawiki-skins-Vector – Froggiz Dec 18 '15 at 14:38
  • I just tried the latest master branch of *Vector*, but it made no difference. Really I am just happy that the wiki is working again. I can live with the *Monobook* skin. – Michael Dec 18 '15 at 14:54
  • I read somewhere that you can add A workaround could be to add $wgResourceLoaderDebug=true; in LocalSettings.php waiting to find a real fix – Froggiz Dec 18 '15 at 14:58
  • By the way did you removed the cache sometime it can come from it ? php maintenance/purgeList.php --purge + rm cache/* -R – Froggiz Dec 18 '15 at 15:00
  • I tried the debug option, but it did not resolve the issue. I would try the purge option, but I have the server set up for maximum security, and one of my policies is to never run files in the webroot using unrestricted privileges. I did try clearing the system-wide PHP cache, but it made no difference. – Michael Dec 18 '15 at 15:22
  • Do you have an include of the skin in your Localsettings.php ? What happend if you retry vector without the include vector skin line (now it should be in core )? – Froggiz Dec 18 '15 at 17:54
  • I just tried it, and it produces this error: "Whoops! The default skin for your wiki, defined in $wgDefaultSkin as vector, is not available." – Michael Dec 18 '15 at 17:59
  • My bad :P Anyway did you tried to set debug mode to get more information ? `$wgShowExceptionDetails = true; $wgDebugToolbar = true; $wgShowDebug = true; $wgDevelopmentWarnings = true;$wgDebugLogFile = "/tmp/{$wgSitename}-debug.log";` in your Localsettings – Froggiz Dec 18 '15 at 18:04
  • The cause has been discovered using the debugging mode that you recommended. I have included an answer below. – Michael Dec 18 '15 at 18:59

2 Answers2

2

After enabling full MediaWiki debugging as suggested by Froggiz, I have come to discover a few specific problems in this case, one of which was the actual cause of Vector's failing to load. The problems and solutions are as follows:

(1) The $wgCacheDirectory was commented out in LocalSettings.php. While the MonoBook skin did not seem to care about this condition, Less.php gets an exception without the cache folder being writable; and apparently this module is necessary for the Vector skin. I ended up setting the cache setting as follows:

$wgCacheDirectory = "$IP/cache"; // Make sure this folder is writable;

(2) Although not the cause of the main problem, there were four files expected that apparently were not included in the standard MediaWiki version 1.26.1 package. In fact, it was a copy of one file that was missing: en-gb.json. This file had to be created and placed into the following locations:

/resources/lib/oojs-ui/i18n

/skins/CologneBlue/i18n

/skins/Modern/i18n

/skins/Vector/i18n

Although the comment in LocalSettings.php for $wgLanguageCode says to choose a language code from ./languages/Names.php, the language code must have corresponding files in the i18n folders of the skins.

Michael
  • 231
  • 2
  • 8
  • Don't forget to mark your answer as valid ;) – Froggiz Dec 18 '15 at 22:47
  • 1
    Had the same issue. My $wgLanguageCode (no comments in my ancient config file, mind) was coded to en, however, so I had all the requisite files. However, adding a configuration option for $wgCacheDirectory (never present in my, again, ancient config file) did the trick. If you end up with an MWException after configuring a cache directory, it's not writeable for whatever user is executing the PHP. – Phil Dec 21 '15 at 19:52
  • Good Answer. First and foremost if you plan on running MonoBook as your skin just switching `$wgDefaultSkin = "MonoBook";` will work. In order to make Vector work using 'en' as _$wgLanguageCode_ all I needed to do was uncomment _$wgCacheDirectory_ – kevinaskevin Dec 30 '15 at 14:48
0

I had same issue, but your fix didn't work. I migrated MediaWiki 1.27 from local to development server.

I turned added this to LocalSettings.php $wgResourceLoaderDebug=true;

Then in the console it told me to run update.php. Which I did from the following link. Voila now the Vector skin is working.

https://www.mediawiki.org/wiki/Manual:Upgrading#Web_browser