Project:Support desk

About this board

Welcome to MediaWiki.org's Support desk, where you can ask MediaWiki questions!

There are also other places where to ask :

Before you post

Post a new question

  1. To help us answer your questions, please always indicate which versions you are using (reported by your wiki's Special:Version page):
    • MediaWiki
    • PHP
    • Database
  2. Please include the URL of your wiki unless you absolutely can't. It's often a lot easier for us to identify the source of the problem if we can look for ourselves.
  3. To start a new thread, click "Start a new topic".
Previous page history was archived for backup purposes at Project:Support_desk/old on 2015-07-30.
Other languages: English  العربية čeština Esperanto français 日本語 中文

Cant see friends most of the time

1
2601:989:457E:1530:846A:F336:6236:52BB (talkcontribs)

Been having trouble seeing my friends lobby on pavlov. and dont understand why. we didnt have this trouble when we first started playing.

Reply to "Cant see friends most of the time"

I can't view pages on Talented Deviants

1
184.15.182.237 (talkcontribs)

I created an account and confirmed it, but it STILL won't let me.

Reply to "I can't view pages on Talented Deviants"
82.19.18.89 (talkcontribs)

Tried to log into NSWiki, using the login with nationstates link. A key was generated, but when I put it into the required box, i got an unknown user id message. Any ideas?

Reply to "Login Problem"

Skin not loading (IONOS Hosting)

2
7heo T (talkcontribs)

Hi !

I'm not used to "coding" so I installed MediaWiki on my Ionos hosted server thanks to their build-in tool.

MediaWiki a been instaled correctly and i can browse through the pages but with no skin.

I get this error :

"Refused to apply style from '[URL]' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled."

After some reaserches I found that it can be due to short URL and that a need to create a symbolic link from /var/www pointing to /var/lib/mediawiki/[my $wgScriptPath value]. But I don't have a var folder in my wiki directory on the server. So what am I supposed to do ? It seems that my problem is linked to the fact I'm hosted by Ionos ? Have anyone already used MediaWiki with Ionos ?

Thanks for your help

MarkAHershberger (talkcontribs)

This ("Refused to apply style...") sounds like a server configuration problem.

I've set up an Ionos site just to test this since it looks like I can do that without incurring any cost. I'll come back and update this when I've tried it.

Reply to "Skin not loading (IONOS Hosting)"

How to use IsFileCacheable hook

2
T0lk (talkcontribs)

Extension:AccessControl (https://github.com/wikimedia/mediawiki-extensions-AccessControl/tree/REL1_34) should probably not let rebuildFileCache.php cache pages that are supposed to be access restricted. I see Manual:Hooks/IsFileCacheable can be used.

Unfortunatey there are no examples of this hook Category:IsFileCacheable extensions, is this correct in AccessControl.hooks.php:

<?php
use MediaWiki\MediaWikiServices;
class AccessControlHooks {
        public static function isFileCacheable (&$article) {
        $matches = [];

        $text = $article->getParserOutput(
            // 0 gets the current ID
            0, // $article->mOldId,
            // Don't have a user (and hopefully shouldn't need one as just grabbing tags)
            null
        )->getRawText();

        $parser = MediaWikiServices::getInstance()->getParser();
        $parser->extractTagsAndParams(['accesscontrol'], $text, $matches);

        return !count($matches);
        }
        ...
}
MarkAHershberger (talkcontribs)
Reply to "How to use IsFileCacheable hook"
Sokote zaman (talkcontribs)
MarkAHershberger (talkcontribs)

I don't understand what you're asking. Could you clarify what you want?

Sokote zaman (talkcontribs)

Yes, thank you

More explanation:

I want to have buttons on some pages and not buttons on some pages.

How do I show or not show a button in a template consisting of several patterns?

Thanks

MarkAHershberger (talkcontribs)

When do you want the button to show up? If it is something on the page, I think you could do this with some JS in your Common.js.

Sokote zaman (talkcontribs)

Thank you for your response

I want some pages to be just syntax and some pages to be syntax with buttons.

Sokote zaman (talkcontribs)

How can I fix this problem?

MarkAHershberger (talkcontribs)

"Some pages to be just syntax" -- could you point to an example on your wiki where you want this to happen? I still don't understand your question. It looks like you know how to make buttons (you made a couple here), why can't you do that on your wiki?

Reply to "template show or hide"

syntaxhighlight custom colors

2
Sokote zaman (talkcontribs)

How do I black out the font and background color?


1 C:\Users\Your Name\AppData\Local\Programs\Python\Python36-32\Scripts>pip uninstall camelcase
2 Uninstalling camelcase-02.1:
3   Would remove:
4     c:\users\Your Name\appdata\local\programs\python\python36-32\lib\site-packages\camecase-0.2-py3.6.egg-info
5     c:\users\Your Name\appdata\local\programs\python\python36-32\lib\site-packages\camecase\*
6 Proceed (y/n)?
MarkAHershberger (talkcontribs)

Could you point to an example of what you want to do? It sounds like you would need to use a span and some CSS.

Reply to "syntaxhighlight custom colors"

Wikimedia\Rdbms\DBReadOnlyError after VM crash

5
80.128.145.126 (talkcontribs)

I run a wiki on an Apache webserver with Mysql in a Linux-VM . This VM crashed yesterday without reason and now this is happening:

*Apache is running

*MySQL opens 200+ threads with Mysqld --daemonize myslq.pid

**It tells me, that there are 14 open files

**mysqladmin says, that 140+ localhost/wiki process are sleeping (this number is constantly growing, which causes a "to many connection" error after a while)

*My VM is reaching its RAM and CPU limitation due to MySQL and freezes

*If I try to connect to my wiki via internet it either gives me a connection time out or "Wikimedia\Rdbms\DBReadOnlyError" (but the wiki wasn't in read only mode when the vm crashed)


Since I installed MediaWiki two years ago I kept it up-to-date, made two successful upgrades to the recent versions and never changed the apache/mysql default settings (with exclusion of user/password) and it all worked fine. Until yesterday.


Further testing/logging within the wiki isn't possible due to the nature of the problem. I can't provide any log files.

80.128.145.126 (talkcontribs)

I have to correct myself: After many reloads I finally got an error log.

And again: I have no idea why it says "Read-only". I checked the LocalSettings and it's not read only.


MediaWiki internal error.

Original exception: [3b46c182321d3ea4b8b9902a] /wiki/Mainpage Wikimedia\Rdbms\DBReadOnlyError from line 1121 of /var/lib/mediawiki/includes/libs/rdbms/database/Database.php: Database is read-only

Backtrace:

#0 /var/lib/mediawiki/includes/libs/rdbms/database/Database.php(2010): Wikimedia\Rdbms\Database->query(string, string)

#1 /var/lib/mediawiki/includes/objectcache/SqlBagOStuff.php(414): Wikimedia\Rdbms\Database->update(string, array, array, string)

#2 /var/lib/mediawiki/includes/libs/objectcache/BagOStuff.php(316): SqlBagOStuff->cas(array, string, array, integer)

#3 /var/lib/mediawiki/includes/objectcache/SqlBagOStuff.php(488): BagOStuff->mergeViaCas(string, Closure, integer, integer)

#4 /var/lib/mediawiki/includes/libs/objectcache/WANObjectCache.php(549): SqlBagOStuff->merge(string, Closure, integer, integer)

#5 /var/lib/mediawiki/includes/cache/MessageCache.php(732): WANObjectCache->set(string, array, integer)

#6 /var/lib/mediawiki/includes/cache/MessageCache.php(671): MessageCache->setValidationHash(string, array)

#7 /var/lib/mediawiki/includes/cache/MessageCache.php(420): MessageCache->saveToCaches(array, string, string)

#8 /var/lib/mediawiki/includes/cache/MessageCache.php(342): MessageCache->loadFromDBWithLock(string, array, NULL)

#9 /var/lib/mediawiki/includes/cache/MessageCache.php(971): MessageCache->load(string)

#10 /var/lib/mediawiki/includes/cache/MessageCache.php(928): MessageCache->getMsgFromNamespace(string, string)

#11 /var/lib/mediawiki/includes/cache/MessageCache.php(868): MessageCache->getMessageForLang(Language, string, boolean, array)

#12 /var/lib/mediawiki/includes/cache/MessageCache.php(808): MessageCache->getMessageFromFallbackChain(Language, string, boolean)

#13 /var/lib/mediawiki/includes/Message.php(1290): MessageCache->get(string, boolean, Language)

#14 /var/lib/mediawiki/includes/Message.php(1006): Message->fetchMessage()

#15 /var/lib/mediawiki/includes/specialpage/SpecialPage.php(840): Message->isDisabled()

#16 /var/lib/mediawiki/includes/specials/SpecialRecentchanges.php(164): SpecialPage->addHelpLink(string, boolean)

#17 /var/lib/mediawiki/includes/specialpage/SpecialPage.php(565): SpecialRecentChanges->execute(NULL)

#18 /var/lib/mediawiki/includes/specialpage/SpecialPageFactory.php(568): SpecialPage->run(NULL)

#19 /var/lib/mediawiki/includes/MediaWiki.php(288): SpecialPageFactory::executePath(Title, RequestContext)

#20 /var/lib/mediawiki/includes/MediaWiki.php(861): MediaWiki->performRequest()

#21 /var/lib/mediawiki/includes/MediaWiki.php(524): MediaWiki->main()

#22 /var/lib/mediawiki/index.php(42): MediaWiki->run()

#23 {main}

Exception caught inside exception handler: [3b46c182321d3ea4b8b9902a] /wiki/Mainpage Wikimedia\Rdbms\DBReadOnlyError from line 1121 of /var/lib/mediawiki/includes/libs/rdbms/database/Database.php: Database is read-only

Backtrace:

#0 /var/lib/mediawiki/includes/libs/rdbms/database/Database.php(2010): Wikimedia\Rdbms\Database->query(string, string)

#1 /var/lib/mediawiki/includes/objectcache/SqlBagOStuff.php(414): Wikimedia\Rdbms\Database->update(string, array, array, string)

#2 /var/lib/mediawiki/includes/libs/objectcache/BagOStuff.php(316): SqlBagOStuff->cas(array, string, array, integer)

#3 /var/lib/mediawiki/includes/objectcache/SqlBagOStuff.php(488): BagOStuff->mergeViaCas(string, Closure, integer, integer)

#4 /var/lib/mediawiki/includes/libs/objectcache/WANObjectCache.php(549): SqlBagOStuff->merge(string, Closure, integer, integer)

#5 /var/lib/mediawiki/includes/cache/MessageCache.php(732): WANObjectCache->set(string, array, integer)

#6 /var/lib/mediawiki/includes/cache/MessageCache.php(671): MessageCache->setValidationHash(string, array)

#7 /var/lib/mediawiki/includes/cache/MessageCache.php(420): MessageCache->saveToCaches(array, string, string)

#8 /var/lib/mediawiki/includes/cache/MessageCache.php(342): MessageCache->loadFromDBWithLock(string, array, NULL)

#9 /var/lib/mediawiki/includes/cache/MessageCache.php(971): MessageCache->load(string)

#10 /var/lib/mediawiki/includes/cache/MessageCache.php(928): MessageCache->getMsgFromNamespace(string, string)

#11 /var/lib/mediawiki/includes/cache/MessageCache.php(868): MessageCache->getMessageForLang(Language, string, boolean, array)

#12 /var/lib/mediawiki/includes/cache/MessageCache.php(808): MessageCache->getMessageFromFallbackChain(Language, string, boolean)

#13 /var/lib/mediawiki/includes/Message.php(1290): MessageCache->get(string, boolean, Language)

#14 /var/lib/mediawiki/includes/Message.php(982): Message->fetchMessage()

#15 /var/lib/mediawiki/includes/skins/Skin.php(1348): Message->exists()

#16 /var/lib/mediawiki/includes/skins/Skin.php(1305): Skin->addToSidebarPlain(array, string)

#17 /var/lib/mediawiki/includes/skins/Skin.php(1261): Skin->addToSidebar(array, string)

#18 /var/lib/mediawiki/includes/skins/Skin.php(1287): Skin->{closure}()

#19 /var/lib/mediawiki/includes/skins/SkinTemplate.php(481): Skin->buildSidebar()

#20 /var/lib/mediawiki/includes/skins/SkinTemplate.php(249): SkinTemplate->prepareQuickTemplate()

#21 /var/lib/mediawiki/includes/OutputPage.php(2388): SkinTemplate->outputPage()

#22 /var/lib/mediawiki/includes/exception/MWExceptionRenderer.php(137): OutputPage->output()

#23 /var/lib/mediawiki/includes/exception/MWExceptionRenderer.php(54): MWExceptionRenderer::reportHTML(Wikimedia\Rdbms\DBReadOnlyError)

#24 /var/lib/mediawiki/includes/exception/MWExceptionHandler.php(75): MWExceptionRenderer::output(Wikimedia\Rdbms\DBReadOnlyError, integer)

#25 /var/lib/mediawiki/includes/exception/MWExceptionHandler.php(149): MWExceptionHandler::report(Wikimedia\Rdbms\DBReadOnlyError)

#26 /var/lib/mediawiki/includes/MediaWiki.php(551): MWExceptionHandler::handleException(Wikimedia\Rdbms\DBReadOnlyError)

#27 /var/lib/mediawiki/index.php(42): MediaWiki->run()

#28 {main}

80.128.145.126 (talkcontribs)

Update: After using the "SET GLOBAL read_only = OFF;" command in mysql, I don't get any time outs anymore but blank pages without any information.

80.128.145.126 (talkcontribs)

Update: This is the last entry of the Apache errorlog.


[Fri Apr 03 19:42:38.978709 2020] [php7:error] [pid 22088] [client 46.229.168.151:31960] PHP Fatal error: Uncaught Error: Call to a member function getCode() on null in /var/lib/mediawiki/includes/user/User.php:1737\nStack trace:\n#0 /var/lib/mediawiki/includes/user/User.php(5417): User::getDefaultOptions()\n#1 /var/lib/mediawiki/includes/user/User.php(3101): User->loadOptions()\n#2 /var/lib/mediawiki/includes/context/RequestContext.php(336): User->getOption('language')\n#3 /var/lib/mediawiki/includes/Message.php(380): RequestContext->getLanguage()\n#4 /var/lib/mediawiki/includes/Message.php(1290): Message->getLanguage()\n#5 /var/lib/mediawiki/includes/Message.php(842): Message->fetchMessage()\n#6 /var/lib/mediawiki/includes/Message.php(934): Message->toString('text')\n#7 /var/lib/mediawiki/includes/exception/MWExceptionRenderer.php(201): Message->text()\n#8 /var/lib/mediawiki/includes/exception/MWExceptionRenderer.php(301): MWExceptionRenderer::msg('dberr-problems', 'Sorry! This sit...')\n#9 /var/lib/mediawiki/includes/exception/MWExceptionRenderer.php(52): MWExceptionRenderer::reportOutageHTML(Object(Wikimedia\Rdbms\DBCon in /var/lib/mediawiki/includes/user/User.php on line 1737

MarkAHershberger (talkcontribs)

Do you have a database backup? If you do, you should drop the database and restore from the backup.

If you don't, then your best bet is to try to use rebuild or repair the DB.

Reply to "Wikimedia\Rdbms\DBReadOnlyError after VM crash"
BensDBN (talkcontribs)

Hi,

I have a MediaWiki that is set to private and I want a specific user account to be able to programatically signed in and when I browse to the wiki that its automatically signed in.

I followed this post: API:Login but it doesnt tell you what to do after you have logged in and I'm hoping to get some help regarding saving your login to a cookie.

I get a readapidenied error when I try to do a GET token request, I switched to the depricated way of doing it via POST but at least im able to get a token. I now do a login post and I get a return (I'm not sure if this is successful as it shows a different token with a status of "Needs Token".


Any help or links to documentation would be greatly appreciated.


Ciencia Al Poder (talkcontribs)

"Being logged in" from a browser's perspective means you have entered valid credentials, and you got an HTTP cookie with a session identifier, and the browser sends back that cookie with the session identifier on all requests to the wiki that tells the server who's the user (this is what maintains the user logged in, until the cookie expires or the session is no longer valid on the server).

If you're able to programatically set a cookie on the user's browser from the same domain as MediaWiki, you'll be good to go. Otherwise, you won't be able to do so. Maybe Extension:Auth remoteuser is an alternative if you can set up the user on the server level.

About the api, if you receive Needs Token, this means you're not sending back the cookie you received from the first POST.

BensDBN (talkcontribs)

Hi Ciencia,

Thanks for your response. I am using AngularJS, I am just battling to grab to the cookie from the response headers from the first POST. I'm busy looking into how to do this currently.

I can see the cooking on the response header: Set-Cookie: wikidb_session=sd00uqls8o2hi6q7cev6gpg0tjhjbh4t; path=/; HttpOnly

Have any ideas?

All the documentation for API:Login all use request which has been shut down. :(

Ciencia Al Poder (talkcontribs)

You can't grab a cookie set with a HttpOnly flag (that's what you've received) from JavaScript. This is a protection to prevent JavaScript from stealing sessions. However, the cookie will get stored on the browser automatically and be used on future request. However this will only be true if the request comes from the same domain and path.

So basically, if you run the JavaScript code on a page on the same domain as MediaWiki, it should work. If you run the JavaScript code on a page on a different domain or subdomain, it won't work.

I don't know, however, what the solution should be. Maybe implement OAuth on your application and change MediaWiki logins to login against that OAuth server (this won't make users logged-in automatically, but they can click a button to log-in without further credentials if they're already logged in in the OAuth application). That's what happens when you use "login with facebook" buttons on other websites, for example.

BensDBN (talkcontribs)

My IIS server and my Wiki Server are on the same domain. The origin is currently set to localhost as I’m busy testing, which I think is part of the issue. But how does one test when you are developing? we have 3 different levels of security on the wiki, so based on the level of security of the person logged into our SPA that is the level of sites they see in the wiki. With your alternative suggestion, would the process be I log into OAuth from my application, providing a set of credentials and then when the customer is redirected to the wiki they click on Log in and it will automatically log them in with the set of credentials I provided initially?

Ciencia Al Poder (talkcontribs)

I have never set up an OAuth system. You may need to install Extension:WSOAuth and develop a class to handle the login system. From what I understand, OAuth not only authenticates users, but also provides a list of user groups or similar, that can be equivalent to MediaWiki user groups. I don't know how easy is to integrate that with your system.

BensDBN (talkcontribs)

Hi,

I have tackled this again. I moved mediawiki to our web server. I also updated to the latest version of mediawiki which fixed the token issue. So im now using the recommended way to get the token. I have published my code to the webserver so the Orgin is exactly the same.

I added mediawiki as an application under our main site so now the url to get to the wiki is https://application.example.com/wiki

In the web.config on IIS i added Access-Control-Allow-Origin and set the orgin to https://application.example.com (an example) and on the request headers it is exactly the same.

However my response headers is still :

Set-Cookie: UseDC=master; expires=Fri, 03-Apr-2020 14:18:01 GMT; Max-Age=10; path=/; secure; HttpOnly

Set-Cookie: UseCDNCache=false; expires=Fri, 03-Apr-2020 14:18:01 GMT; Max-Age=10; path=/; secure; HttpOnly


So you can now see that it has secure but still has HttpOnly. Is there a setting that i can add in localSettings to white list a domain?

I'm not entirely sure now why its still HttpOnly.

Ciencia Al Poder (talkcontribs)

Session cookies must be HttpOnly, otherwise any script on the page could tamper with it.

If you're doing the login to MediaWiki through the application server-side (which would be desirable security-wise), you should capture the cookies in the header and then send them back to your application. That way since you have setup them as path=/ it should work.

Reply to "Automatic Login"
178.157.254.233 (talkcontribs)

Hi

I just updated my Mediawiki from 1.29 to 1.34 and at the same time I updatede the php from 7.1.33 to 7.4.4

But when I open my wiki I get the message:

MediaWiki 1.34 internal error

MediaWiki 1.34 requires at least PHP version 7.2.9, you are using PHP 7.1.33-14+ubuntu18.04.1+deb.sury.org+1"


But when I write "php -version" i get

PHP 7.4.4 (cli) (built: Mar 20 2020 13:47:45) ( NTS )

Copyright (c) The PHP Group

Zend Engine v3.4.0, Copyright (c) Zend Technologies

   with Zend OPcache v7.4.4, Copyright (c), by Zend Technologies


II can't figure out what I am doing wrong.

How do I fix it?

Best regard

Kenneth

Ubuntu server 18.04

Malyacko (talkcontribs)
Nsturtz2 (talkcontribs)

7.3.11 is the newest

Malyacko (talkcontribs)

Where? How? Plus 7.3.11 is not 7.1.33.

Nsturtz2 (talkcontribs)

Oh sorry that is my bad, I have the outdated version on my server. Thank you for pointing that out to me.

2.107.60.30 (talkcontribs)

Hi

You were right. I had installed PHP versions in parallel and also the wrong version.

I had added the repository ppa:ondrej/php and because I did not specified the php version I automatically got the newest (7.4.4)

After removing the wrong PHP version I installed 7.3 and now it's working again


Hope you all have a nice weekend

Kenneth

Reply to "Wrong php version"