Project:Support desk

Jump to: navigation, search

About this board

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

There are also other places where to askCommunication: IRCCommunication#Chat, mailing listsMailing lists, Wikimedia Developer Support, Q&A, mwusers (unofficial forum) etc.

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".
Huwmanbeing (talkcontribs)

I'm setting up a Mediawiki installation and somehow got into a state where my password is not accepted. Since I hadn't yet gotten email configured, I tried to reset my password using the instructions at Manual:ChangePassword.php, but encountered this error:

PasswordError from line 62 of /var/www/mywiki/public_html/maintenance/changePassword.php: * The supplied credentials cannot be changed, as nothing would use them.
* The authentication data change was not handled. Maybe no provider was configured?

Backtrace:
#0 /var/www/mywiki/public_html/maintenance/doMaintenance.php(111): ChangePassword->execute()
#1 /var/www/mywiki/public_html/maintenance/changePassword.php(73): require_once(string)
#2 {main}

Does anyone know how to go about diagnosing this, or what the cause might be? Any advice is greatly appreciated since at the moment I'm unable to administer my wiki. Thanks very much!

MediaWiki=1.29.1, PHP=7.0.22, MySQL=5.7.20.

星耀晨曦 (talkcontribs)

I am tracking the error.

星耀晨曦 (talkcontribs)

Due to my lack of ability, I can only give you a suggestion. Try download a new tarball that match your current version from this site, then extract the includes/auth/ directory to overwrite your existing directory of the same name.

Huwmanbeing (talkcontribs)

I just downloaded a fresh copy of MediaWiki 1.30.0 (the version my installation is now on), and replaced the contents of my includes/auth/ directory with the contents of that directory in the download. Unfortunately the error still persists; this is now the response:

[a4df1cc376641f0cce5b784c] [no req]   PasswordError from line 62 of /var/www/mywiki/public_html/mediawiki-1.30.0/maintenance/changePassword.php: * The supplied credentials cannot be changed, as nothing would use them.
* The authentication data change was not handled. Maybe no provider was configured?

Backtrace:
#0 /var/www/mywiki/public_html/mediawiki-1.30.0/maintenance/doMaintenance.php(92): ChangePassword->execute()
#1 /var/www/mywiki/public_html/mediawiki-1.30.0/maintenance/changePassword.php(73): require_once(string)
#2 {main}
星耀晨曦 (talkcontribs)

I need more debug information. Please edit mediawiki/includes/auth/AuthManager.php, add var_dump($status); behind $any = $any || $status->value !== 'ignored'; on line 860. Then rerun changePassword.php and observe its behavior, and post error response here.

Note: Do not to modify the file in the production environment. Because it will output debugging information to your web page.

Huwmanbeing (talkcontribs)

Sure thing; here is the full dump of the response:

The command I run is php changePassword.php --user=UserName --password=NewPassword.

星耀晨曦 (talkcontribs)

Ok. Then, in the same place, modify as such:

public function allowsAuthenticationDataChange( AuthenticationRequest $req, $checkData = true ) {
        $any = false;
        $providers = $this->getPrimaryAuthenticationProviders() +
            $this->getSecondaryAuthenticationProviders();
        foreach ( $providers as $provider ) {
            $status = $provider->providerAllowsAuthenticationDataChange( $req, $checkData );
            if ( !$status->isGood() ) {
                return Status::wrap( $status );
            }
            $any = $any || $status->value !== 'ignored';var_dump($any);
        }echo "test\n"
        if ( !$any ) {
            $status = Status::newGood( 'ignored' );
            $status->warning( 'authmanager-change-not-supported' );
            return $status;
        }
        return Status::newGood();
}

Rerun changePassword.php.

Huwmanbeing (talkcontribs)

The result is as follows:

bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
test
bool(false)
bool(true)
bool(true)
bool(true)
bool(true)
test
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
test
星耀晨曦 (talkcontribs)

I think your LocalPasswordPrimaryAuthenticationProvider have a problem. Most likely is database query problem. Can you access your database directly via command line interface or other connectors?

Huwmanbeing (talkcontribs)

That's interesting. Yes, I can easily access the database via phpMyAdmin.

星耀晨曦 (talkcontribs)

Try select action SELECT user_id FROM user WHERE user_name='<UserName>' via phpMyAdmin. (<UserName> is you want to change username) Can you select out a number?

Now I think it is unlikely that the database problem. Maybe other in LocalPasswordPrimaryAuthenticationProvider.

Huwmanbeing (talkcontribs)

For the user whose password I'm trying to reset, the user_id is 1.

星耀晨曦 (talkcontribs)

Looks like not a database problem. Edit mediawiki/includes/auth/LocalPasswordPrimaryAuthenticationProvider.php, add var_dump($row); behind ); on line 222., then rerun changePassword.php.

Huwmanbeing (talkcontribs)

OK, I've made that addition to LocalPasswordPrimaryAuthenticationProvider.php; below is the result from running changePassword. (Nothing extra seems to appear from the dump.)

[2f16bf0d63423d2400ce46db] [no req]   PasswordError from line 62 of /var/www/mywiki/public_html/mediawiki-1.30.0/maintenance/changePassword.php: * The supplied credentials cannot be changed, as nothing would use them.
* The authentication data change was not handled. Maybe no provider was configured?

Backtrace:
#0 /var/www/mywiki/public_html/mediawiki-1.30.0/maintenance/doMaintenance.php(92): ChangePassword->execute()
#1 /var/www/mywiki/public_html/mediawiki-1.30.0/maintenance/changePassword.php(73): require_once(string)
#2 {main}
星耀晨曦 (talkcontribs)

Oh, now. Edit mediawiki/includes/auth/LocalPasswordPrimaryAuthenticationProvider.php, add var_dump($username);behind $username = User::getCanonicalName( $req->username, 'usable' ); on line 215., then rerun changePassword.php.

Huwmanbeing (talkcontribs)

The response is bool(false).

星耀晨曦 (talkcontribs)

What username did you input when you run changePassword.php?

Huwmanbeing (talkcontribs)

Huwmanbeing is the username I'm inputting.

星耀晨曦 (talkcontribs)

Please use the following code to edit your line 1092-1141 in includes/user/User.php.

Huwmanbeing (talkcontribs)

The response:

test1
test2
test1
test2
bool(false)
星耀晨曦 (talkcontribs)

Maybe, I find the problem point. Are you set $wgReservedUsernames in LocalSettings.php? Or do you installed an extension that blocks users from logging in or registering?

Huwmanbeing (talkcontribs)

I don't have any $wgReservedUsernames defined in LocalSettings.

I do have new account creation turned off for unregistered users ($wgGroupPermissions['*']['createaccount'] = false;). I tried re-enabling account creation and re-running changePassword but the result is the same.

I have several extensions installed, but none specifically for blocking logins or registrations. Other than the three automatically-installed "spam prevention" extensions (ConfirmEdit, SpamBlacklist, and TitleBlacklist), I have two others: Abuse Filter and AntiSpoof. I've tried disabling them both and re-running changePassword but that also didn't seem to change anything.

星耀晨曦 (talkcontribs)

Very strange. Add var_dump($reservedUsernames); to line 912 in includes/user/User.php.

Huwmanbeing (talkcontribs)

Yes, it's very odd — I really appreciate all your help with trying to track it down. Here's the result from var_dump($reservedUsernames):

array(12) {
  [0]=>
  string(17) "MediaWiki default"
  [1]=>
  string(17) "Conversion script"
  [2]=>
  string(18) "Maintenance script"
  [3]=>
  string(40) "Template namespace initialisation script"
  [4]=>
  string(14) "ScriptImporter"
  [5]=>
  string(12) "Unknown user"
  [6]=>
  string(25) "msg:double-redirect-fixer"
  [7]=>
  string(22) "msg:usermessage-editor"
  [8]=>
  string(16) "msg:proxyblocker"
  [9]=>
  string(20) "msg:spambot_username"
  [10]=>
  string(23) "msg:autochange-username"
  [11]=>
  string(25) "msg:newusermessage-editor"
}
星耀晨曦 (talkcontribs)

Add echo "test\n"; to line 921 in mediawiki/includes/user/User.php behind behind }.

This should be the last debugging if you get test. Since, this is not logical.

Huwmanbeing (talkcontribs)

I added that echo to the end of line 921; the result appears unchanged. Here's the full response:

Do you suspect it's something amiss with reserved usernames?

Huwmanbeing (talkcontribs)

Just pinging for a response. Any thoughts? Huwmanbeing (talk) 20:52, 18 January 2018 (UTC)

Osnard (talkcontribs)

Do you have an authentication provider enabled? Do you use any authentication extensions? OAuth?

Huwmanbeing (talkcontribs)

No, I haven't installed anything authentication-related. I just upgraded from 1.29.1 to 1.30.0 to see if that might address the problem, but unfortunately no luck. I'm baffled about how to diagnose and solve this. Huwmanbeing (talk) 13:52, 21 January 2018 (UTC)

TheDJ (talkcontribs)

1: Reset your localsettings.php to as basic as you can 2: Make sure you ran maintainance/update.php 3: Follow Manual:How_to_debug

Huwmanbeing (talkcontribs)

I've run update.php and temporarily pared out as much as I can from LocalSettings. I also set up a $wgDebugLogFile to get more detail, and attempted to make the change via both changePassword.php and the Special:PasswordReset page, but it doesn't seem to shed much light. There's one relevant line which notes...

[authentication] User1 attempted password reset of User2 but failed

...but otherwise gives no indication of exactly why it failed, and concludes with "the request ended normally". Huwmanbeing (talk) 15:01, 22 January 2018 (UTC)

Huwmanbeing (talkcontribs)

Is it possible that email needs to be set up and working in order to use changePassword? (Since I'm having some problems with SMTP, just wondered if that might affect this.) Might be no connection, but I'm grasping at straws...

MarkAHershberger (talkcontribs)

Email isn't necessary to run changePassword.php. You can try Manual:CreateAndPromote.php to change the password, but it looks like you have some sort of alternative for user authentication set up.

Huwmanbeing (talkcontribs)

Good thought; I just tried CreateAndPromote with --force to try resetting a password for the account, but unfortunately the result is the same:

The authentication data change was not handled. Maybe no provider was configured?
Backtrace:
#0 ...mediawiki-1.30.0/maintenance/doMaintenance.php(92): CreateAndPromote->execute()
#1 ...mediawiki-1.30.0/maintenance/createAndPromote.php(154): require_once(string)
#2 {main}

I don't recall establishing anything out of the ordinary for user authentication. (I normally have new account creation turned off, but the error also occurs when it's on.) What does it mean by "no provider configured"? Do you know of any way to determine what's happening?

Tgr (WMF) (talkcontribs)

Sounds like you have disabled local password authentication. Check $wgAuthManagerConfig / $wgAuthManagerAutoConfig. (The easiest way is probably to run maintenance/shell.php and then just type in the names of those variables.)

Reply to "ChangePassword.php error"

cannot access pages from RESTBase server

1
Scejja (talkcontribs)

I've just installed RESTBase server with this config.yaml

       ...
       paths:
         /{domain:127.0.0.1:8081}:
         ...
               apiUriTemplate: http://127.0.0.1:8081/mediawiki/api.php
               baseUriTemplate: "{{'http://{domain}:7231/{domain}/v1'}}"
             parsoid:
               host: http://localhost:8142
             table:
               backend: sqlite
               dbname: db.sqlite3
               ...

I'm using

Mediawiki 1.30 , PHP 7.0.22, MySQL 5.7.21, ubuntu0.16.04.1

When I make

curl http://127.0.0.1:7231/127.0.0.1:8081/v1/

I get

{"items":["page","transform"]}

And with

http://127.0.0.1:7231/127.0.0.1%3A8081/v1/page/

I get

{"items":["data-parsoid","html","title","wikitext"]}

And in browser I get to "Wikimedia REST API".

But if I try to get some wiki page using the API wiki I get 404

For example:

curl -X GET --header 'Accept: application/problem+json' 'http://127.0.0.1:7231/127.0.0.1%3A8081/v1/page/html/P%C3%A1gina_principal'

{

  "type": "https://mediawiki.org/wiki/HyperSwitch/errors/not_found",

  "title": "Not found.",

  "method": "get",

  "uri": "/127.0.0.1%3A8081/v1/page/html/P%C3%A1gina_principal"

}

I have short URLs enabled, so main page is:

http://127.0.0.1:8081/wane/P%C3%A1gina_principal

Any help please?

Reply to "cannot access pages from RESTBase server"
Nicole Sharp (talkcontribs)

Hello, I would like to set up a single-user private wiki but still allow public comments on talkpages. So anonymous editors cannot create accounts or new pages or upload any files, but are allowed to edit talkpages (and only talkpages) to post comments or feedback. Is there a way to set this up to restrict editing to only a single namespace? Nicole Sharp (talk) 17:21, 21 February 2018 (UTC)

Nicole Sharp (talkcontribs)

Okay, found this: Manual:Preventing access#Restrict editing of an entire namespace. But can I do the opposite, i.e. restrict editing to all namespaces except for one? Or do I have to list each namespace individually, and then the namespaces not listed are allowed for edits?

Reply to "editing of talkpages only"

Logo only showing up on "Create account" page...

1
184.150.236.43 (talkcontribs)

Recently, the main logo at the top of any wiki page disappeared, except for the one at the top of the "Special: Create Account" page. Unfortunately, this is hosted on a company intranet and I cannot share the site URL with you. Can anyone suggest why this may be happening (could the Create Account page and the other pages be using a different template, or something like that...)?

Reply to "Logo only showing up on "Create account" page..."
213.55.103.174 (talkcontribs)

We implement MediaWiki in our company as an Enterprise Wiki, we are using it very well as Quick Reliable Knowledge base. But, recently we face a disturbing problem, which is the default WikiEditor is missing. We thought the problem is with the Default WikiEditor, then we installed the WikiEditor extension, unfortunately the problem is still persists.

When I check the browser's "developer tools", F12, the JavaScript is not loading.

Unfortunately, I can not send you the URL address of our wiki. because it is deployed as intranet in the company. Here is Version of our Wiki...

MediaWiki 1.26.0

PHP 5.6.19 (cgi-fcgi)

MySQL 5.7.11-log

Thank you,

Malyacko (talkcontribs)

If you're still running ancient unsupported insecure version 1.26 then the bigger problem to solve first is upgrading.

What does "not loading" exactly mean and what *do* you see? Which "JavaScript" exactly? All and any js files? What do the server logs of your webserver software show?

213.55.103.174 (talkcontribs)

This is what I got when I tried to debug using the browser's "developer tools", F12.

"Loading failed for the <script> with source “http://cbepedia.internal/load.php?debug=false&lang=en&modules=startup&only=scripts&skin=vector”.

Main_Page:14"

I did not check the Server logs on my web server. I would really love to know how I can check that?

We deployed MediaWiki on a Windows Server 2008 r2 data center (IIS 7.5).

Let me know, if you would like to know more.

TheDJ (talkcontribs)

Loading failed for the <script> with source. That likely means that the resource loader could not succeed. There can be many reasons for this, but i'd start by running that request with curl or wget from a terminal, to figure out if content is properly being returned (any error message might show up in that content as well).

Reply to "WikiEditor is not showing up"
46.222.246.30 (talkcontribs)

I'm new to Mediawiki (MediaWiki 1.30.0, PHP 7.0.22, MySQL 5.7.21)

How can I remove talk tab in Vector skin for users how are not logged in?

- This seems to be old:

Manual:FAQ#How do I add.2Fremove tabs throughout my wiki.3F

- DynamicTabs is archived

- And, I saw this this post

Topic:Qji4lqoeaodggoft

but I do not know how to manage hooks, to apply it. I have to register the hook in LocalSettings.php,

$wgHooks['BeforePageDisplay'][] = 'wfHideVariousTabsFromAnonymous';

but where may a put the event handler?

function wfHideVariousTabsFromAnonymous( &$hidetabcss ) {

       global $wgUser;

       if ( !$wgUser->isLoggedIn() ) {

               $hidetabcss .= 'li#ca-history, li#ca-viewsource, li#ca-edit, li#ca-talk, .vectorMen$

       }

       return true;

}

Any help please?

Malyacko (talkcontribs)

User:Subfader/Hide page tabs maybe

46.222.246.30 (talkcontribs)

I tried this, but Vector.php seems different, there's no globalWrapper div.

<?php global $wgUser; if( $wgUser->isAnon() ) { ?>
     <style type="text/css">
       #ca-talk { display: none !important; }
     </style> 
   <?php } ?>
Ciencia Al Poder (talkcontribs)

This hook is no longer available: Manual:Hooks/SkinTemplateSetupPageCss. It won't work.

You can hide it for all in MediaWiki:Common.css and then unhide it for the group "user" using Manual:User group CSS and Javascript

46.222.246.30 (talkcontribs)

Seems to be the solution

In MediaWiki:Common.css I put:

#ca-talk { display:none!important; }

In MediaWiki:Group-user.css I put:

#ca-talk { display:block!important;}

Thanks a lot!!

This post was hidden by 46.222.246.30 (history)
Reply to "Hide tab Discussion in MW 1.30"

PHP warning while uploading html files via Html2Wiki

4
Summary by 星耀晨曦

A PHP 7.2 compatibility issue and has been fixed in master branch.

Note: mediawiki 1.30 is not fully compatible with PHP 7.2.

Bisherbas (talkcontribs)
[Sun Feb 18 09:36:53.647910 2018] [php7:warn] [pid 31670] [client ::1:58474] PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /var/www/html/wiki/includes/api/ApiEditPage.php on line 337, referer: <nowiki>http://localhost/html/wiki/Special:Html2Wiki

MediaWiki v1.30

Apache2 v2.4.18

PHP v7.2.2

Ubuntu 16.04

Mysql v15.1

星耀晨曦 (talkcontribs)

This is a PHP 7.2 compatibility issue, mediawiki 1.30 is not fully compatible with PHP 7.2. See T182004. This issue has been solved and mediaiwiki 1.31 will fully compatible with PHP 7.2.

Bisherbas (talkcontribs)

Thank you! Know when 1.31 will be released?

星耀晨曦 (talkcontribs)

We plan release 1.31 in June 2018. A major release will be made every six months.

193.52.16.15 (talkcontribs)

Hi,

Everything is fine on my mediawiki 1.15.1, PHP 5.1.6 (apache2handler) and MySQL 5.0.77.

But (there is always a but...) when users try to upload XML file (it is teachers doc courses for their students), they can't with the warning text : This file contain HTML code or script...

Despite the fact that xml is added to $wgFileExtensions and not in the blacklist file.

How can I allow those upload of xml files ?

Thanks in adavance.

jh

193.52.16.15 (talkcontribs)

I answer to myself :

This was because in the function detectScript (in includes/specials/SpecialUpload.php), the system verify the entire uploaded file to find some HTML tags which are '<a href', '<body', '<head', '<html', '<img', '<pre', '<script' and '<table'. And in the XML file to uploaded there was a <PRENOM> (First name in French) tag.

To fix the problem I change '<pre' to '<pre>' so that it's only real <pre> tag which cause the problem. Not exhaustive manner of course but it works for this case.

113.193.89.72 (talkcontribs)

this is not working for me i m having problem "This XML file does not appear to have any style information associated with it. The document tree is shown below." pls help

Reach Out to the Truth (talkcontribs)

Unless the file actually does contain style information, that's normal.

Reply to "(RESOLVED) Upload XML files"

Is there a minimum name length for categories?

5
Summary by AhmadF.Cheema

Apparently, no. Unfinished jobs was the issue preventing categories from updating.

Ehtech2000 (talkcontribs)

The Issue

Hi there,

I created a category "KB" and assigned three pages to it, but no matter what I do to try and refresh it (short of clearing cache because I don't want to have to re-log-in to all my open online accounts and then wait for images to download and cache again), the category consistently says:

This category currently contains no pages or media.

But, other categories work perfectly fine. I'm wondering if the reason it is not showing the associated pages might be because there is a minimum category name length of "three characters" -- but, I can't find anywhere where it says that, to confirm my suspicion. Neither this page Help:Categories, nor a Google search answered my questions.

My Questions

  1. Is the minimum category name length greater than one, and if so, what is it AND where is it documented?
  2. Is minimum name length something that would cause the error message above?

Any help is appreciated.

AhmadF.Cheema (talkcontribs)

Are other categories working correctly? If not, this is probably a jobs related issue. See Topic:T6uzpn51mgb8n5sc.

Ehtech2000 (talkcontribs)

That was the answer! I figured out what caused the issue with the categories not refreshing. I'm trying to mimick infoboxes on my local personal wiki and so I've had to import many XML templates exported from Wikipedia just to get the wikipedia:Brian May infobox (musical artist) to work. Based on what I'm reading, all the imports must have moved pointers and messed up references in the MySQL tables. Anyway, I ran the RunJobs.php script, refreshed my page and now all the categories work like a charm.

Ehtech2000 (talkcontribs)
:Thanks AhmadF.Cheema. Most categories are working, however I've had this 'no pages' issue on other categories during the past three weeks since I installed my brand-new wiki on localhost in Windows. I will need to review the link you pr, but the RunJobs.phpbshpp' script looks promising. I'll report back.
This post was hidden by 2001:16B8:1047:1200:C4B7:B5DD:AC50:12D6 (history)

Which information can the CheckUser tool find?

6
43.230.99.105 (talkcontribs)

Is the CheckUser extension able to find someone's information apart from their external IP address? I.e., can it find the internal IP, the physical MAC address or the computer name of an editor?

Bawolff (talkcontribs)

No. Such information is not transmitted over the internet so there would be no way for checkuser or any similar type of thing to know it.

checkuser records the folliwing info:

  • user-agent (web browser, OS and sometimes language)
  • ip
  • x-forward-for (if the user is using a proxy, what is the ip address before the proxy. Whether or not this is supported depends on the proxy)
43.230.99.108 (talkcontribs)

Hello @Bawolff, thanks for your answer! I wonder, if such information is not transmitted over the internet, then how come some websites such as this one are able to detect my internal/local IP?

And regarding the proxy, just to make sure I understand well: If a user connects to a wiki and edits pages throughout a proxy server or a VPN, can the CheckUser tool tell what is the "real" IP address used by this user (i.e. not the IP of the proxy/VPN)?

Bawolff (talkcontribs)

It may or may not be able to tell you the real ip address of the user - some proxies are configured to send that information along, other's are not. It depends on the proxy.

As for the site you linked. That's using WebRTC to find your local IP address, which is a relatively new API. The local IP address is not transmitted in general, but javascript is able to find it on browsers supporting WebRTC. CheckUser does not have support for obtaining this information. Collecting it would be a bit more invasive, as you would have to actively collect it instead of just recording what the browser sends by default.

Normally local IP is not that interesting, as most of the time its either a private IP address (starting with 10. or 192.168) which is kind of meaningless as they are often dynamically assigned and a great many people use the same one, or its simply the same as the person's public address.

Ciencia Al Poder (talkcontribs)

This information (the local IP revealed on the website you linked) is not sent through HTTP headers, it's available only on the browser currently running the page (this information is not transmitted over Internet), so no, it's not available to CheckUser.

43.230.99.104 (talkcontribs)

OK, thanks !

Reply to "Which information can the CheckUser tool find?"