Topic on Project:Support desk

Blank Pages After Briefly Displaying Wiki

7
Frohro (talkcontribs)

I have been attempting to move my wiki from a server running Ubuntu 14.04, MediaWiki 1.19.14+dfsg-1, PHP 5.5.9-1ubuntu4.18 (apache2handler), MySQL 5.5.49-0ubuntu0.14.04.1 to a fresh install of Ubuntu 16.04, mediawiki 1.27. I copied the mediawiki.conf from the first server into /etc/apache2/conf-available/, modified it for the correct directory, loaded the mysql dump into mariadb, ran the update script (which completed without errors), added extensions the best I could (embedded video and math). The extensions don't seem to be working on the first brief showing of the page, before it goes blank. When I compare /tmp/wiki.logs, I see this, with the new not working wiki on the left, and the old working one on the right. There are no php errors, and I have the php.ini and LocalSettings.php set to show them.

I note that the new non-working wiki seems to do a shutdown after the request ended normally. Is this related to my problem?

I'm at a loss what to do from here. Maybe I should try and install the same version of wiki on each machine, and then try and upgrade the wiki. Any suggestions are welcome!

Thanks,

Rob

Ciencia Al Poder (talkcontribs)

When you say The extensions don't seem to be working on the first brief showing of the page, before it goes blank, do you mean that, on a particular page load, in your browser you start seeing the page until it turns into a blank page? That's often caused by JavaScript code that calls document.write(). That's deprecated code that doesn't work on modern browsers and web applications, because under some circumstances it causes the entire page to start from scratch. The error console of the browser (you can open it usually by hitting F12) normally logs when this happens.

To find the offending code you can try disabling extensions and enabling them one by one, and also look at any javascipt page that you may have modified. You can easily try disabling $wgUseSiteJs and $wgAllowUserJs.

Note that if you moved to a very cheap or free shared host, they may be injecting JavaScript of their own for ads and/or tracking, which may cause this problem.

Frohro (talkcontribs)

First, this is running on my own hardware, a fresh install of Ubuntu 16.04.

Further clarification on what I see:

1) When I load a page without math or video embedded, the page seems to render correctly, but shows only for about three seconds until it goes blank. It was this way before I installed the extensions.

2) With math in the page, the page shows briefly, but math is not rendered correctly; then in about three seconds it disappears.

3) With embedded video in the page it shows with a black box for the video, and then disappears.

I'm using both chrome and firefox on ubuntu 16.04 for testing.

Does this help?

Thanks,

Rob

Ciencia Al Poder (talkcontribs)

Ok, running your own server should discard the ad problem. The 3 seconds display until it goes blank seems to confirm the JavaScript issue. Have you tested what I said about disabling user/site JavaScript on MediaWiki? Does the error console of the browser display some JavaScript error or warning about document.write?

Frohro (talkcontribs)

Thansk Jesús! I did not have $wgUseSiteJs in LocalSettings.php, and setting $wgAllowUserJs to false didn't work, but setting $wgUseSiteCss = false; did make the pages display all the time! The embedded videos work as well, but math still isn't rendering. However, now I should have a much easier time debugging that. Is there a problem with setting $wuUseSiteCss = false that I should be aware of?

Again, thanks for the help. Without your suggestion, I would not have come on the solution, at least probably not for a long time.

Rob

Ciencia Al Poder (talkcontribs)

Okay, so this was fixed by setting false $wgUseSiteJs or $wgUseSiteCSS?

If $wgUseSiteJs fixed it, you should look at Manual:Interface/JavaScript#Global scripts, look at those pages in your wiki, and you probably need to blank them and start from scratch, or identify what's the offending code that breaks the page. It's probably in MediaWiki:Common.js or MediaWiki:Vector.js (if you're using vector skin). As I said, that's probably code using document.write.

If $wgUseSiteCSS was the problem, then look at Manual:Interface/Stylesheets, the problem may be in MediaWiki:Common.css or MediaWiki:Vector.css (if you're using vector skin). Finding what rule is causing it may be a bit tricky if you don't know CSS, but that's probably a body {display:none} or similar.

Math is a different issue and you may want to open a new thread about it, giving additional information like any error message and even looking at a debug log

Frohro (talkcontribs)

Thanks, I don't have $wgUseSiteJs, so it must be $wgUseSiteCSS which I disabled. I'll work on the math a bit more before I bother you guys. Thanks so much for the assistance.

Rob