Project:Support desk

About this board

Welcome to the MediaWiki Support desk, where you can ask MediaWiki questions!

(Read this message in a different language)

See also

Before you post

Post a new question

  1. To help us answer your questions, please indicate which versions you are using, as found on your wiki's Special:Version page:
    • MediaWiki version
    • PHP version
    • Database type and version
  2. Please include the web address (URL) to your wiki if possible. It's often easier for us to identify the source of the problem if we can see the error directly.
  3. To start a new thread, click "Start a new topic".

Would updating MediaWiki destroy/restore anything that was lost due to installing extensions?

2
Guillaume Taillefer (talkcontribs)

Hello. Recently I had a problem with some of the extensions that I was installing which apparently lead to some mediawiki (partially my fault) tables on the back end being deleted. The one that I do notice that still hasn't been restored was title_index, while I was trying to delete something.

At the same time I want to update MediaWiki 1.41, but was wondering what would happen if I tried doing it. Would it have problems because some stuff is missing or would it restore the tables? I want to know this just in case I would have to download my entire wiki to save it.

Thanks

Malyacko (talkcontribs)

In general, backups can save your day, no matter how the software behaves or not.

Reply to "Would updating MediaWiki destroy/restore anything that was lost due to installing extensions?"

How to calculate many wikimedia commons images are uploaded in a specific country

2
138.251.29.208 (talkcontribs)

Hi everyone,

Is there a way to figure out how many wikimedia commons images are in a specific country or region. For example how many wikimedia commons images were uploaded in England or Wales? Any help is appreciated.

Malyacko (talkcontribs)

Hi, this page is for questions about the MediaWiki software itself. Technical questions about specific Wikimedia wiki installations are best asked on meta:Tech.

See https://stats.wikimedia.org/

Reply to "How to calculate many wikimedia commons images are uploaded in a specific country"
Chrisyau3891 (talkcontribs)

Hi all,

If we got article pages in mediawiki, and we want to use Schema.org standard to make schema for each of the pages, any suggestions how to do this?

Reply to "Schema"
82.26.156.45 (talkcontribs)

Mediawiki version 1.41.0 PHP 8.1.2-1ubuntu2.14 (fpm-fcgi) ICU 70.1 PostgreSQL 12.11 (Ubuntu 12.11- Oubuntue. 20.04.1) When trying to add an account or utilising an extension which allows/aids account creation, I keep receiving the error: "A database query error has occurred. This may indicate a bug in the software." I then try to run the update script /mw-config and receive a more detailed error message of "Table externallinks contains el to field. Dropping... An error occurred: Error 42704: ERROR: index "el_to" does not exist Function: Wikimedia\Rdbms\Database:: sourceFile( /var/www/mediawiki/maintenance/postgres/archives /patch-externallinks-drop-el _to.sal) Query: DROP INDEX el_to". I can't find any information or help regarding this particular issue online. Can someone please shed some light on the error and advise me on fixing the issue?

TheDJ (talkcontribs)

Some database knowledge is definitely advisable when trying to recover from a situation like this, so if you are unsure, get someone with more experience.

el_to was removed in 1.41 and the el_to index were removed in 1.41. The script says that the el_to column still exists and thus wants to run maintenance/postgres/archives /patch-externallinks-drop-el _to.sql

The first command of that database migration is to drop the el_to index. But apparently that index is already gone. This is unexpected, as in 1.41 the index and the column were dropped at the same time, by this same file. Possibly this indicates that something went wrong previously when you updated the installation and you didn't notice that an error was thrown during updating.

The easiest workaround is to modify maintenance/postgres/archives /patch-externallinks-drop-el _to.sql and change the 4 lines with "DROP  INDEX" to be "DROP INDEX IF EXISTS" and rerun the update script.

82.26.156.45 (talkcontribs)

Thank you for your reply.

I updated from 1.35 and there were no errors- everything ran as expected.

Could you please elaborate on your suggested workaround, as this is all still quite new to me. I have command line access and my instance is hosted on my own server.

82.26.156.45 (talkcontribs)

TheDJ; thank you for solving my problem.

I found the file and amended it accordingly, re-ran the update and received no errors. Everything is now working as expected, and I'm able to add users.

Thanks again.

OAuth invalid client

1
Creamycd (talkcontribs)

I've tried to use OAuth2 to authorize my app (written in flutter/dart), and here's what I got:

I/flutter ( 7002): {"error":"invalid_client","error_description":"Client authentication failed","message":"Client authentication failed"}
I/flutter ( 7002): 401

And here's my code:

void getToken() async {
  Directory appDir = await getApplicationDocumentsDirectory();
  String appDirUse = appDir.path;
  final codeChallenge = await File('$appDirUse/code_challenge').readAsString();

  Uri sendToUri = Uri.parse('http://$fullServerName${wgScriptPath}rest.php/oauth2/authorize?response_type=code&client_id=$identifier&redirect_uri=$redirectUrl&code_challenge=$codeChallenge&code_challenge_method=S256');
  await openInBrowser(sendToUri);
}
Future<void> openAppLink(String deepLink) async {
String code = deepLink.replaceFirst("wikiapp://OAuth2?code=", "");
Directory appDir = await getApplicationDocumentsDirectory();
String appDirUse = appDir.path;
final verifierFile = await File('$appDirUse/code_verifier').readAsString();
Uri sendToUri = Uri.parse("$kScheme://$fullServerName${wgScriptPath}rest.php/oauth2/access_token");
// openInBrowser(sendToUri);
final response = await http.post(
  sendToUri,headers: headers, body: {'grant_type': 'client_credentials', 'client_id': identifier, 'code': code, 'redirect_uri': redirectUrl, 'code_verifier': verifierFile}
);
}

I don't know what happened... Why it always 701 and Client authentication failed?

Reply to "OAuth invalid client"

Error 500 When Accessing Database

1
38.88.51.138 (talkcontribs)

I am not at all a web developer/admin, not my area of expertise. Hoping I can find some guidance here. We have a mediawiki instance installed in Dreamhosts. That is hosting a SQL server that used to be accessible by navigating to bertoni-law.com/wiki. That now returns an error 500 code. I just took over this client so I have no idea how long that has been going on. I cant seem to track down a solution here. If anyone has any ideas that can at least point me in some kind of direction, that would be awesome!

Reply to "Error 500 When Accessing Database"

I'm unable to install Wikibase on my MediaWiki-Docker container

2
Nikotinel (talkcontribs)

I've been trying to install the Wikibase extension on my Mediawiki container by following this MediaWiki-Docker/Extension/Wikibase guide. Everything went smoothly until I had to run the "update.php" script, when I got this:

root@767207bc625b:/var/www/html# php maintenance/run.php update.php

Fatal error: Uncaught ExtensionDependencyError: WikibaseRepository is not compatible with the current MediaWiki core (version 1.41.0), it requires: >= 1.42.

WikibaseClient is not compatible with the current MediaWiki core (version 1.41.0), it requires: >= 1.42.

in /var/www/html/includes/registration/ExtensionRegistry.php:460

Stack trace:

#0 /var/www/html/includes/registration/ExtensionRegistry.php(314): ExtensionRegistry->readFromQueue(Array)

#1 /var/www/html/includes/Setup.php(285): ExtensionRegistry->loadFromQueue()

#2 /var/www/html/maintenance/run.php(49): require_once('/var/www/html/i...')

#3 {main}

  thrown in /var/www/html/includes/registration/ExtensionRegistry.php on line 460


I'm using version 1.41.0, and as I understand it that version is the newest stable version. I'd rather not have to upgrade my mediawiki image. I tried looking for an older version that would be compatible with version 1.41.0 on https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Wikibase/ and found https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Wikibase/+/refs/heads/REL1_41 (which I assumed to be the right version) but was unable to clone it due to a 403 error. I then tried downloading the regular wikibase from the download link on Wikibase/Installation, but that didn't work and I got a whole bunch of error messages.

Any ideas?

Thanks for the help.

Nikotinel (talkcontribs)

I managed a workaround. When cloning the repo, I used this command instead: 'git clone --branch REL1_41 https://gerrit.wikimedia.org/r/mediawiki/extensions/Wikibase extensions/Wikibase' which cloned the right branch. Then I just followed the instructions on the guide (MediaWiki-Docker/Extension/Wikibase) and it worked.

Reply to "I'm unable to install Wikibase on my MediaWiki-Docker container"

Hiding website name like on wikipedia.org

1
213.204.92.196 (talkcontribs)

Normally in Vector-2022 skin it is set to show the website logo and the website name next to it. But I want to edit that and put it like wikipedia.org, only the logo showing.

I know that I can remove the website name in the LocalSettings.php with this line

$wgSitename = '';

but the thing is that I want the website name to still show in the tab (like it does on wikipedia.org) and not completely remove it...

Any idea how I can achieve this?

Reply to "Hiding website name like on wikipedia.org"

MediaWiki:Sitenotice does not load CSS classes for .mw-ui-button

1
Smihael (talkcontribs)

In the current version of site notice on slwiki, the CSS classes .mw-ui-button and .mw-ui-progressive are not loaded. When the site notice is displayed, for example, on the main page, the button is not visible even though it is visible at the interface page itself. When inspecting the CSS, it seems that it is dynamically generated in the load.php script. Is there any quick workaround to force these CSS classes to be loaded, or do we need to hard-code the button's appearance in the site notice itself?

Reply to "MediaWiki:Sitenotice does not load CSS classes for .mw-ui-button"

About Latest Version

4
72.255.3.43 (talkcontribs)

we installed the latest version of mediawiki but it's not working???? PHP version is stable with mediawiki requirment.

Malyacko (talkcontribs)

This is way too vague. Please read the sidebar and provide a clear and complete list of exact steps to reproduce the situation, step by step, so that nobody needs to guess or interpret how you performed each step, what happens after performing these steps to reproduce, what you expected to happen instead, a full link to a web address where the issue can be seen, the exact full MediaWiki version, exact PHP version, exact database software name and version, etc., and what exactly makes you think that something "is not working".

72.255.3.43 (talkcontribs)

The real issue is that I downloaded the latest version of MediaWiki in a .zip file, but upon extracting it, I discovered that the files were corrupted. I also tried an older version I had, thinking it might be an issue with the new version, but it turned out to be corrupted as well. At first, I thought it might be a problem with my system, so I ran some corruption detectors, only to find out that the files were indeed damaged, not my system.

Malyacko (talkcontribs)

If the local software on your machine corrupts zip files, then there is nothing that can be fixed in MediaWiki itself.

Reply to "About Latest Version"