Topic on Project:Support desk

Several problems after moving and upgrading a wiki

47
Semako96 (talkcontribs)

After moving and upgrading a wiki, I managed to get it running, but as you can see here: https://mariowiki.net - there are still several problems.

There are no images showing up.I can't get them to load, because I always get an error 500. altough they exist on the server and can be downloaded via FTP. I don't know what the problem is there, maybe it has something to do with the shorturls?

I am using the htaccess example from Manual:Short_URL/Apache:

## http://www.mediawiki.org/wiki/Manual:Short_URL/Apache

# Enable the rewrite engine
RewriteEngine On

# Short URL for wiki pages
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/index.php [L]

# Redirect / to Main Page
RewriteRule ^/*$ %{DOCUMENT_ROOT}/index.php [L]

but with the /w removed, since my domain points right to the installation directory of MediaWiki. Articles load fine.


Also, I can't log in, it always gives me an error message that the action got canceled because of a problem with the transmission of my account data. Is that problem related to the above one?


Another problem is that on the login page I get an error message where the user menu should be: ''Warning: call_user_func() expects parameter 1 to be a valid callback, function 'efClearStatistics' not found or invalid function name in /home/.sites/327/site4525714/web/wiki/includes/Setup.php on line 940''


And of course the wiki looks kinda broken, but that might be related to changes in the vector.css page? I can't edit that page of course, because I can't login.


Can someone help me, please?

Leaderboard (talkcontribs)

I am getting an error which translates to "The database is temporarily closed to new entries and changes. Please try again later.". I think you've locked it?

Semako96 (talkcontribs)

yeah, I locked the database, but that shouldn't affect logins, right?

Semako96 (talkcontribs)

Unlocking the database allowed me to login (I could log in even after the database was locked on the old server with MW 1.24...), and I managed to solve the images problem (that was caused by an errant .htaccess in the images folder), but the error message I mentioned above is still there, where the user menu should be.


Also, I noticed that there are several calls for a /w directory in my server's error log, which doesn't exist because my MediaWiki is installed in a directory called /wiki and the domain points to that directory:

[Mon Jan 14 16:47:34 2019] [error] [client 46.229.168.135] File does not exist: /home/.sites/327/site4525714/web/wiki/w
[Mon Jan 14 16:47:34 2019] [error] [client 46.229.168.135] File does not exist: /home/.sites/327/site4525714/web/wiki/error

oh, and even after reverting my changes to the Vector.css page, the skin still looks kinda broken. What happened there?

Semako96 (talkcontribs)

Also stuff like collapsible tables doesn't work as I just noticed, and sometimes thumbnail images still don't load...

And it doesn't redirect you to the main page, when you just enter the domain, you need to enter https://mariowiki.net/wiki/MarioWiki:Hauptseite to reach it, entering https://mariowiki.net gives you the provider's default page or a not found error.

MarkAHershberger (talkcontribs)

To be redirected to the front page, you need an .htaccess file that will perform the redirect.

You need something similar for /w and /wiki: short urls.

Semako96 (talkcontribs)

I already read that manual, my current .htaccess is in that thread's opnening post. But what's wrong with that .htaccess?

AhmadF.Cheema (talkcontribs)
Semako96 (talkcontribs)

Okay, it works, but sometimes it doesn't load for whatever reason... And what about my other problems? Any help...?

Semako96 (talkcontribs)

Interestingly sometimes the page loads, sometimes it doesn't. I'll switch back to the old URL structure later to see if that helps.

MarkAHershberger (talkcontribs)

I'm seeing this error:

Warning: call_user_func() expects parameter 1 to be a valid callback, function 'efClearStatistics' not found or invalid function name in .../includes/Setup.php on line 940

This seems to indicate that you've modified the MediaWiki source code directly. If you've done that, then we cannot be of much help since we don't know what other modifications you've made.

Also, I would recommend sticking with a URL structure that mimic's Wikipedia's (e.g. /w and /wiki). Others can work, but they require more tinkering.

Semako96 (talkcontribs)

I also don't know what causes that error. I moved to a clean, new MediaWiki installation, the only files I took over from the old wiki were the localsettings.php (altough updated), the images folder and the database. Maybe in the old installation source code was modified, but in the new installation, sourcecode definitely is not modified.

Semako96 (talkcontribs)

So I just changed the structure by renaming the wiki folder to /w, pointing the domain to the server's root directory and changed the script path in the localsettings.php from "" to "/w" - and now all I get is a certificate error and the hoster's default 404 page. Not even a MediaWiki error. What's the problem there...?

I am now using exactly the example .htaccess from the Short URLs manual I linked above.

Semako96 (talkcontribs)

Managed to get the wiki running again with the new folder structure, which is now the MediaWiki default one, but the other problems still remain, and it is sometimes loading images, sometimes not, and loading of the stylesheet is delayed too...

Ciencia Al Poder (talkcontribs)

The problem with efClearStatistics is caused by one of your skins or extensions. Disable all of them, and then enable them one by one until you find which one is what makes the error message appear on every page.

If you upgraded, remember to upgrade also all extensions. Don't carry them from the old install, since they may be incompatible. Also, be sure to not unpack the new files over the old ones. Always unpack them on a new folder, to avoid leaving old files from the old install there that may cause strange problems

Semako96 (talkcontribs)

chmod 775 for the image folder, subfolders and files should be fine?

MarkAHershberger (talkcontribs)

I would use chmod -R 1777 images

Semako96 (talkcontribs)

I just set chmod 777 for images and subfolders and files, without any noticeable change... (not via shell, via ftp settings)

Ciencia Al Poder (talkcontribs)
Semako96 (talkcontribs)

That is the error I find in the error log:

[Mon Jan 14 23:03:18 2019] [crit] [client 93.236.167.163] (13)Permission denied: /home/.sites/327/site4525714/web/wiki/w/images/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable


So for whatever reason it searches for a .htaccess in the images folder and because it can't find one it prevents access? What's that? Usually it should allow access if there's no htaccess preventing access to the files/folders, right?

Ciencia Al Poder (talkcontribs)

Yes, there's no problem if .htaccess is not present. However, the error says ensure it is readable.

Another problem may be that you added 777 permissions to everything, while it should be done only to folders, not files. Having files with 7 or 5 permissions makes them executable, and can cause a remote execution on your server. Maybe your .htaccess is affected too, and it refuses to read it for security.

To fix permissions you'll need shell access... Changing permissions from a web interface can be very cumbersome. Maybe your hoster can do that for you if you ask...

Semako96 (talkcontribs)

I don't need shell access, but I have it if I need it.

I have now set permissions to 777 for folders and 755 for files, still thumbnails are not loading properly, but the image you linked above is no longer a 403 error.

As I said there is NO htacccess in the images folder.

Semako96 (talkcontribs)

I found the reason for the error message, it was an errant variable in the localSettings.php file. But the problem with the thumbnails not loading (and mariowiki.net not always properly redirecting, I contacted my hoster because of that already) persists.


Also, collapsible tables don't work anymore and I still get other error messages on some pages like MediaWiki:Vector.css: https://mariowiki.net/wiki/MediaWiki:Vector.css

And thank you for trying to help me, it is my first time hosting my own wiki, since I took that one over from the old hoster, I "only" have experience with forum softwares, not with mediawiki so I am still learning ;-)

Semako96 (talkcontribs)

Any ideas?

Ciencia Al Poder (talkcontribs)

Files should have mode 644 or 664, not 7 nor 5 (which makes them executable)

Ciencia Al Poder (talkcontribs)

There are still permission issues it seems:

Warning: md5_file(/home/.sites/327/site4525714/web/wiki/w/images/Wiki.png): failed to open stream: Permission denied (...)

For whatever reason PHP can't access that file for reading.

Ciencia Al Poder (talkcontribs)

There's a problem with your scripts. If you open the browser console you'll see:

ReferenceError: addOnloadHook is not defined

addOnloadHook has been deprecated for a long time. The fix should be as easy as replacing all "addOnloadHook" with "$", which is the jQuery replacement. There are instances of this on MediaWiki:Common.js

See also ResourceLoader/Migration guide (users)

Semako96 (talkcontribs)

yes, that was because those scripts were never updated before, similar to the mediaWiki version. Thanks for mentioning it, I just replaced the addOnloadHooks with a "$", and now stuff like the collapsible tables works again.


I don't know what caused that error, the file is named Wiki.png with captial "W", and that file can be opened for me.


Another issue I just noticed is that file names with symbols such as question marks are corrupted (examples can be found [https://mariowiki.net/wiki/%3F-Block here]. The problem is that the image names on the server are corrupted, so that the file pages are empty. How to fix that?

Semako96 (talkcontribs)

The problem with the question marks was apparently caused by Windows, which replaced them with underscores when I saved the files locally after downloading them from the old server. So I just have to reupload the files from my Linux computer.

Any ideas why the wiki looks broken the first time you open it on mmobile but fine after a reload?

Ciencia Al Poder (talkcontribs)

I'm unable to discover the mobile version of MarioWiki

Semako96 (talkcontribs)

Just open the wiki on the phone. There's no mobile frontend installed yet, but the vector skin looks broken the first time you load it on the phone, and when you reload it, it will look fine.

Ciencia Al Poder (talkcontribs)

I'm using the browser's tool to simulate a mobile device, and it doesn't switch to the mobile skin... And appending ?useformat=mobile to the URL doesn't work

Leaderboard (talkcontribs)

I suspect you're using browser sniffing, but even then I can't get it to work neither by emulation nor by my S6; I only see the desktop one.

Semako96 (talkcontribs)

There's NO MOBILE SKIN installed yet. It is just the regular Vector skin. And THAT VECTOR SKIN LOOKS BROKEN when you open the wiki on phone (I am using an android phone with Google Chrone), but reloading the page fixes it. And I don't know what causes that problem, so I am asking here for help.

Semako96 (talkcontribs)

Altough usually there are no more errors present, uploading an image still gives several errors at once:

Warning: is_executable(): open_basedir restriction in effect. File(/bin/bash) is not within the allowed path(s): (/home/.sites/327/site4525714/web:/home/.sites/327/site4525714/tmp:/usr/share/pear:/usr/bin/php_safemode) in /home/.sites/327/site4525714/web/wiki/w/includes/shell/Command.php on line 312

Warning: is_executable(): open_basedir restriction in effect. File(/bin/bash) is not within the allowed path(s): (/home/.sites/327/site4525714/web:/home/.sites/327/site4525714/tmp:/usr/share/pear:/usr/bin/php_safemode) in /home/.sites/327/site4525714/web/wiki/w/includes/shell/Command.php on line 312

Warning: is_executable(): open_basedir restriction in effect. File(/bin/bash) is not within the allowed path(s): (/home/.sites/327/site4525714/web:/home/.sites/327/site4525714/tmp:/usr/share/pear:/usr/bin/php_safemode) in /home/.sites/327/site4525714/web/wiki/w/includes/shell/Command.php on line 312

Warning: is_executable(): open_basedir restriction in effect. File(/bin/bash) is not within the allowed path(s): (/home/.sites/327/site4525714/web:/home/.sites/327/site4525714/tmp:/usr/share/pear:/usr/bin/php_safemode) in /home/.sites/327/site4525714/web/wiki/w/includes/shell/Command.php on line 312

Warning: is_executable(): open_basedir restriction in effect. File(/bin/bash) is not within the allowed path(s): (/home/.sites/327/site4525714/web:/home/.sites/327/site4525714/tmp:/usr/share/pear:/usr/bin/php_safemode) in /home/.sites/327/site4525714/web/wiki/w/includes/shell/Command.php on line 312


Despite the errors, everthing works correctly, the thumbs are generated. What might cause that errors?

MarkAHershberger (talkcontribs)

As I said on another thread, open_basedir is likely set by your hoster. If you have control over the php.ini, you can fix these errors. Search for open_basedir on this wiki to read more.

Semako96 (talkcontribs)

Can I also just hide these messages, since uploads work fine and these are only warnings, not actual errors? and if yes, how? I assume it must be a variable for the localSettings.php file?


I am on a shared host and so I don't have access to a php.ini file.

AhmadF.Cheema (talkcontribs)
Ciencia Al Poder (talkcontribs)
Semako96 (talkcontribs)

To which php script do I need to add that?


What is open_basedir exactly and what does MediaWiki need it for?

MarkAHershberger (talkcontribs)

Information on open_basedir.

You can hide errors by putting the following in your LocalSettings.php:

error_reporting( 0 );
ini_set( 'display_errors', 0 );

Note that if you encounter problems later, you may want to remove those.

Semako96 (talkcontribs)
Leaderboard (talkcontribs)

It works properly (no need to reload) on my end:

Semako96 (talkcontribs)

That's interesting... Maybe a bug in mobile chrome?

Semako96 (talkcontribs)

I was editing a template and when I saved, I got a whole bunch of errors:

https://abload.de/img/errorsxojm6.png


When I reloaded the page, Firefox asked me if I want to send data again, I accepted and the edit was saved.

What went wrong this time?

MarkAHershberger (talkcontribs)

I think the open_basedir is causing your intermittent problems. If that is the case, you have three options:

  1. Work with your hoster to resolve it. It looks like your problem would be solved they can allow PHP to execute /bin/bash.
  2. Switch hosters.
  3. Agitate for this task in Phabricator to be resolved so that MediaWiki no longer requires access to /bin/bash. I doubt you would have much success with this route.
Semako96 (talkcontribs)

Thanks. Contacted the hosting provider.

I don't want to change hosters again - do you even know a shared hoster that allows /bin/bash to be executable by default? I don't have the time to set up and maintain a dedicated server or v-server and I don't want to have to pay for two hosting services (there's another website running on the wiki's shared hosting) ;)