Jump to content

Project:Support desk/Flow/2024/12

Add topic
From mediawiki.org
This page is an archive.
Please ask questions on the current support desk.


bug with obsolete translations in the title of pages

When a "translate" section is obsolete, it appears in black with a pink background.

On this page and I suspect on many similar pages in French and other languages, there is, according to the line above the list of languages, an obsolete section. But no section with pink background is visible.

In fact there is truly an obsolete translation: the title "Mise en cache des liens" (click on "version traduite" at the top of the page to see it).

It should be great to have the title with a pink background when it is obsolete. Mahabarata73 (talk) 15:37, 1 December 2024 (UTC)

See phab:T381590 (please cross-link so things can be found) Malyacko (talk) 17:57, 5 December 2024 (UTC)
ok, sorry, I will next time Mahabarata73 (talk) 17:00, 7 December 2024 (UTC)

Extensions: HeaderFooter

When updating MW from 1.37 to 1.38 or 1.39 it gives this error "This version of the HeaderFooter extension requires MediaWiki 1.25+". Anyone had the same issue before? How can this be solved? Irdiism (talk) 17:59, 2 December 2024 (UTC)

That sounds unlikely; the extension 1.39 branch requires MediaWiki 1.35.0 per line 9 . Are you sure you are running an extension version compatible with the MediaWiki version? Malyacko (talk) 21:32, 2 December 2024 (UTC)
I have both tried with composer, below my composer.local.json and manually downloading the HeaderFooter extensions to the extensions folders.
{
  "require": {
         "mediawiki/maps": "^7",
         "mediawiki/semantic-media-wiki": "~4.0",
         "mediawiki/semantic-cite": "~3.0",
         "mediawiki/semantic-compound-queries": "~2.2",
         "mediawiki/header-footer": "~3.0",
         "mediawiki/chameleon-skin": "~3.0",
         "mediawiki/page-forms": "~5.0",
         "samwilson/diagrams": "^0.9.2"
       }
} Irdiism (talk) 10:34, 4 December 2024 (UTC)
Till 1.37 it is fine. After that all i get is this
Irdiism (talk) 10:36, 4 December 2024 (UTC)
What creates that output, after which exact steps performed? How did you "manually download" the extension and which exact branch? Please don't paraphrase but provide exact commands to avoid ambiguity. Malyacko (talk) 10:49, 4 December 2024 (UTC)

Fixing argument to template

Say a template {{A}} accepts n named parameters, i, j, k, ..., and {{B}} is another template which invokes {{A}}, but fixes i=foo and passes all other parameters on.

Is there a way to create {{B}} without manually specifying all the named parameters of {{A}} in B's source code?

I think one technique I've seen to accomplish this is creating a dedicated module to parse the arguments, which I would be interested in learning, but I am also interested if there is a simpler approach. Tule-hog (talk) 22:39, 2 December 2024 (UTC)

Scribunto modules is the only option that doesn't involve manually specifying all parameters in B's source code. Bawolff (talk) 20:24, 6 December 2024 (UTC)

extra text on a French page

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


Here you have the original English section on a page: Wikibase/Installation/Advanced_configuration#Localise_your_groups

Here you have the same section but in French language : Wikibase/Installation/Advanced_configuration/fr#Internationaliser_vos_groupes

In the French version, you can see, at the end of the section, the text "<span id="Add_the_wikis_to_the_sites_table">"

I don't know from where it comes : there is no translation with this. Could someone remove this text ? Mahabarata73 (talk) 22:56, 2 December 2024 (UTC)

@Mahabarata73: I think it is due to a duplicated tvar name, which Special:Diff/6884316 should fix. Sam Wilson 06:27, 3 December 2024 (UTC)
The "span" is still visible. Any other idea ? Mahabarata73 (talk) 12:08, 4 December 2024 (UTC)
@Mahabarata73: I'm not sure. @Shirayuki reverted my change, so I guess I didn't do the right thing. But how about this change, to give each tvar within a <translate> element a unique name? Sam Wilson 04:27, 6 December 2024 (UTC)
When a section heading is translated, the Translate extension automatically adds a ‎<span> tag immediately before the section, with its ID corresponding to the untranslated version of the section heading.
Normally, this ‎<span> tag is invisible, but due to a bug, it becomes visible if the section heading contains ‎<code> or other tags. Shirayuki (talk) 13:06, 6 December 2024 (UTC)
I just removed the "$1" in the translated text, I will put it back when this bug will be fix. Thanks for your help. Mahabarata73 (talk) 13:53, 6 December 2024 (UTC)
No, I have already fixed it with this edit, so please refrain from making any further unnecessary changes. Shirayuki (talk) 14:10, 6 December 2024 (UTC)
Oh, yes, great : thanks !! Mahabarata73 (talk) 16:56, 7 December 2024 (UTC)
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Licenses

Hello guys,

I don't really know how to insert licenses or author information into a Mediawiki project so that they are recognized and displayed by the Mediaviewer. To give an example for my problem: If you look at an image in Wikipdia (or Mediawiki) in the media viewer, you can scroll down and see the author information and license information. Unfortunately, this is not the case in my Mediawiki project, I would be very happy to receive an answer! Agatnor (talk) 15:21, 3 December 2024 (UTC)

All this is done with custom templates, placed on the wikitext filedescription, which are then being scraped by and extension.
The way the Information and license templates on Commons provide this data is documented on https://commons.wikimedia.org/wiki/Commons:Machine-readable_data and it happens with classes and ids applied to the templates.
The extension reading out this information is Extension:CommonsMetadata
The results of that extension then provided additional information in the image info API, which is read by MultimediaViewer. This is all VERY cumbersome because it was not an intentional design. —TheDJ (Not WMF) (talkcontribs) 15:32, 3 December 2024 (UTC)
Thanks for the quick reply!
Is there any other “easier” way to display such things better? I just want to have some kind of legally stable way to display data like author and license type. Agatnor (talk) 12:26, 4 December 2024 (UTC)
Not really. Wikipedia is in the Stone Age on this front. —TheDJ (Not WMF) (talkcontribs) 14:01, 5 December 2024 (UTC)
Too bad. Can I change the link from “View license” so that the link leads to the page of the file? In my case, the link leads to “File:FileName.png?uselang=de” and not to the actually existing page “File:FileName.png”. Agatnor (talk) 12:37, 6 December 2024 (UTC)

CSS of Infobox

Currently the width of Infobox templates is defined in Template:Infobox/styles.css by "width: 280px;" (line 8).
I'm not sure it works as you want:
If you want a true width of 280px, you have to add the css:
  • min-width:280px;
  • max-width:280px;
But I'm not sure this value is the good one : if you look at the French page (with the second link above), you will see that the template looks very narrow and, because of this, very high.
I will suggest to use the value 320px for the 3 css (because the result for the English page seems the best if you compare the width and the height of the template). Mahabarata73 (talk) 18:15, 3 December 2024 (UTC)
We know this doesn't work. As inboxes are tables, a width will be treated as a min-width with the actual width depending on the contents. These are templates that were created in the course of the last 25 years, and as such they have some legacy that is not exactly as you would now write them from scratch. —TheDJ (Not WMF) (talkcontribs) 20:51, 3 December 2024 (UTC)
Per sidebar, "For issues about the mediawiki.org website, report to Village Pump instead." Malyacko (talk) 19:01, 3 December 2024 (UTC)

Invalid source image

when i click any on uploads or on article this url comes up

https://wikialpha.us/wiki/File:Sonia_Borrell.jpeg


and its gives me Invalid source image


and same if i click on files and then on (files) in uploads it shows me https://wikialpha.us/images/3/36/Sonia_Borrell.jpeg this url how can i fix this issue and


i am getting this issue

Error creating thumbnail: /bin/bash: /usr/local/bin/convert: No such file or directory Error code: 127


for webp images 223.239.28.201 (talk) 19:08, 3 December 2024 (UTC)

> Error creating thumbnail: /bin/bash: /usr/local/bin/convert: No such file or directory Error code: 127
In order to have thumbnails, the server needs to install imagemagick (which contains the convert command). See also Manual:Image administrationTheDJ (Not WMF) (talkcontribs) 20:48, 3 December 2024 (UTC)

Templates where a paramater is followed with a break only if it's used

Greetings!

I"m working on some templates for my media wiki. I did sort out that I need to follow the parameter with a pipe to have it default to being blank, and that's worked out.

But, I have a set of parameters that are grouped into twos. Basically, each is an image, and an image caption. To make it work nice, I need to include a break between the image and the caption. I have six pairs of these in the template.

However, the way I've currently implemented it, I end up with six page brakes (and therefore extra white space) even if none of the parameters have been passed. What might be the best way to only conditionally add the breaks if the image parameter is non-blank?

This is my bit in the template:

{{{badge1|}}}<small>'' <br> {{{badge1caption| }}}''</small> {{{badge2|}}}<small>'' <br> {{{badge2caption| }}}''</small> {{{badge3|}}}<small>'' <br> {{{badge3caption| }}}''</small> {{{badge4|}}}<small>'' <br> {{{badge4caption| }}}''</small> {{{badge5|}}}<small>'' <br> {{{badge5caption| }}}''</small> {{{badge6|}}}<small>'' <br> {{{badge6caption| }}}''</small> Medwards98020 (talk) 23:39, 3 December 2024 (UTC)

Something along these lines, maybe (not tested). It checks whether each image parameter exists before printing anything. The HTML comments keep the wikitext neatly on separate lines but sometimes help to make sure extra line breaks don't creep into the output.
{{#if:{{{badge1|}}} | {{{badge1}}}<small>'' <br> {{{badge1caption| }}}''</small> }}<!--
-->{{#if:{{{badge2|}}} | {{{badge2}}}<small>'' <br> {{{badge2caption| }}}''</small> }}<!--
-->{{#if:{{{badge3|}}} ......................
Jonathan3 (talk) 00:11, 4 December 2024 (UTC)
This relies on the bundled Extension:ParserFunctions, which you will need to enable if you haven't already. Jonathan3 (talk) 00:12, 4 December 2024 (UTC)

how to run two wikis on the same server

i followed the instruction on how to run two wikis on the same server using the one web server setup and it went well. my problem is with the LocalSettings.php since i do not understand php. the script is not able to select the right LocalSetting.php to run the wiki and i always get unknown wiki.


the server is with locally private address hosted. two separate LocalSettings_ar.php and LocalSettings_en.php for each wiki :


<?php

$wikis = [

    'earlyintervention.om' => 'ar_ewiki',

    'en.earlyintervention.om' => 'en_wiki',

];

if ( defined( 'MW_DB' ) ) {

    // Automatically set from --wiki option to maintenance scripts

    $wikiID = MW_DB;

} else {

    // Use MW_DB environment variable or map the domain name

    $wikiID = $_SERVER['MW_DB'] ?? $wikis[ $_SERVER['SERVER_NAME'] ?? '' ] ?? null;

}

if ( $wikiID ) {

    require_once "LocalSettings_$wikiID.php";

} else {

    die( 'Unknown wiki.' );

}

// Add any settings that should apply to all wikis below this line

// ------- Wikimalkindy (talk) 07:14, 4 December 2024 (UTC)

Try changing the:
$wikiID = $_SERVER['MW_DB'] ?? $wikis[ $_SERVER['SERVER_NAME'] ?? ] ?? null;
line to something like:
$wikiID = $wiki[WebRequest::detectServer()] ?? null;
Note, WebRequest::detectServer() also includes the protocol, so when using this method you would have to change your $wikis to be something like:
$wikis = [
    'https://earlyintervention.om' => 'ar_ewiki',
    'https://en.earlyintervention.om' => 'en_wiki',
];
If its still not working, you could try changing the die( 'Unknown wiki.' ); line to die( 'Unknown wiki. Wiki name is ' . htmlspecialchars( WebRequest::detectServer() ) ); This should at least let you know what mediawiki thinks the server name is, in case it does not match anything on your list in $wikis. Bawolff (talk) 20:20, 6 December 2024 (UTC)

Edit Template

Hi,

While editing template data and click show preview button then previous changes and you changes are showing correctly but it is changing the page text order.

Ex: If I change line 30 and click show preview it is removing from line number 30 and added into the line 1. 213.143.146.149 (talk) 10:19, 4 December 2024 (UTC)

Category:All_skins

This catedory starts with a text telling users that there are currently 103 skins.

This category is visible in many languages, and this text too.

But if you look at any translated page, you will see the list of skins is very far of this number : 38 for Deutsch, 27 for French, 25 for Spanish for example.

The main reason is that most skins cannot be translated : Skin:Aberrant, Skin:Amethyst to give only 2 examples.

It would be nice if a translation administrator would control all skins in the English category and allow translations with, at least, the title of the skin to be translated as a beginning. Mahabarata73 (talk) 13:09, 4 December 2024 (UTC)

A priority before to do that is to remove the "Special:MyLanguage/" part in the first link of the 2 original texts MediaWiki:Default-skin-not-found-no-skins — translatewiki.net and MediaWiki:Default-skin-not-found — translatewiki.net
because for italian, nederlands, dansk or portugues users (and probably more) it shows only between 4 and 6 skins ! Mahabarata73 (talk) 13:53, 4 December 2024 (UTC)
I agree, that does seem wrong. Not sure how to fix it short of translating all pages.
I agree that changing the message seems like a reasonable near term solution. Bawolff (talk) 20:12, 6 December 2024 (UTC)

Issues with Categories constantly changing.

As the title suggests I am currently having issues with my local mediaWiki site. Whenever I edit a page all categories on said page are changed ultimately breaking their links. It is pretty consistent on the categories break, as they change from

[[Category:WIP]]

to

[[index.php?title=Category:WIP]]

I am unsure what is causing this or how to fix it so any guidance would be useful. Grimreeper1342 (talk) 20:36, 4 December 2024 (UTC)

I think i've heard of this happening before with visual editor, but i don't remember what the solution was. I think it was something to do with $wgServer, $wgArticlePath or $wgScriptPath.
Can you post your LocalSettings.php (removing any passwords/ secret keys)? What version of MediaWiki is this? Bawolff (talk) 20:02, 6 December 2024 (UTC)
Yes, you can set $wgUsePathInfo= true; in the LocalSettings.php, however if you do this and you have non UTF-8 characters in the URL it will no longer work. So for example in a swedish wiki the "Settings" page is called "Inställningar" and no longer works. Kantarell90 (talk) 10:35, 9 December 2024 (UTC)

This Flow page will be moved, soon

Hi all. As mentioned in Tech News, starting on December 16, Flow/Structured Discussions pages will be automatically archived and set to read-only on this wiki.

As one of the busiest pages on this wiki using Flow, I plan to move this page earlier than that. I will likely do so on Thursday or Friday this week, or early next week, depending on developer availability (in case anything doesn't go smoothly).

Once moved, this page will become a standard discussion page (using the newer DiscussionTools system instead), but existing Flow-threads will remain active/editable until the 16th. I will also copy across the existing headers from the Flow page to the new page.

For background information on the software-decision, please see Structured Discussions/Deprecation. Please let me know if you have any questions about this upcoming page-move. Thanks. Quiddity (WMF) (talk) 00:17, 5 December 2024 (UTC)

Image trouble

When uploading an image, I mistakenly uploaded the wrong file. I then corrected it by uploading the correct file, but everywhere except the image page itself still shows it as the original, wrong file. How to fix? TFAltHist (talk) 05:32, 5 December 2024 (UTC)

Have you tried bypassing your browser cache ? Images are generally cached pretty aggressively and so when it changes it can take a while before this is reflected. —TheDJ (Not WMF) (talkcontribs) 13:59, 5 December 2024 (UTC)

Hi!

I am working on customizing our MediaWiki installation. We are using the Medik skin and have encountered an issue: when an anchor link is clicked, it does not position itself correctly on the page.

I would like to know the best way to resolve this issue and implement smooth and precise scrolling behavior.

Is there a way to implement this functionality globally?

Any guidance, including code examples or documentation references, would be greatly appreciated.

Thank you for your time and support! S-farfab (talk) 10:33, 5 December 2024 (UTC)

Generally this happens because the page hides or adds all kinds of elements with Javascript, that are not in the original serverside generated html. This is called layout shift. I'm not familiar with Medik, so I cannot say if it's developer has taken this into account or not. —TheDJ (Not WMF) (talkcontribs) 13:57, 5 December 2024 (UTC)

Installing MediaWiki 1.42.3

I downloaded the media wiki 1.42.3 from https://hub.docker.com/_/mediawiki

Deployed using command

docker pull mediawiki

followed by

docker run --network some-network --name some-mediawiki -p 8080:80 -d mediawiki


I want to use postgresql

Deployed using

https://hub.docker.com/_/postgres

docker pull postgres

followed by :

docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres


Now I can access Media wiki

http://localhost:8080/mw-config/index.php?page=Language

I selected Database type

MariaDB, MySQL, or compatible

Database name - my_wiki

Database user name - postgres

password mysecretpassword

On Next I get following error

Cannot access the database: :real_connect(): (HY000/2002): No such file or directory.

Check the host, username and password and try again. If using "localhost" as the database host, try using "127.0.0.1" instead (or vice versa).


I tried to use 127.0.0.1 instead of localhost but same issue.

Am trying on MacBook Paperlessnow (talk) 17:58, 5 December 2024 (UTC)

did you expose the posgres port to the mediawiki network ? —TheDJ (Not WMF) (talkcontribs) 16:04, 6 December 2024 (UTC)
Am able to connect to Postgres using dbever sql client.
So, can I assume it is exposed? Paperlessnow (talk) 16:19, 6 December 2024 (UTC)
According to your post, you selected "MariaDB, MySQL, or compatible" and not "postgres". You have to select postgres on the database setup screen in order to use postgres.
If that doesn't appear as an option, it probably means that your version of php has not been compiled with support for postgres. Bawolff (talk) 19:52, 6 December 2024 (UTC)

Problem with RSS feed

Comic 3015: D&D Combinatorics is causing the RSS feed to fail because the ampersand is not correctly encoded in the <title> .

"error on line 47 at column 18: EntityRef: expecting ';'"

line 47 is

[tab]<title>3015: D&D Combinatorics</title> 2A00:23C6:549B:3101:91:72F0:AAA5:84AB (talk) 21:03, 5 December 2024 (UTC)

It'd be useful to explain what wiki you're talking about. It looks like it might be about the Explain XKCD Recent Changes feed, is that right?
The relevant part of the RSS feed there looks like this, which seems correct:
<item>
	<title>Talk:3015: D&amp;D Combinatorics</title>
	<link>https://www.explainxkcd.com/wiki/index.php?title=Talk:3015:_D%26D_Combinatorics&amp;diff=358704&amp;oldid=358703</link>
Sam Wilson 02:19, 6 December 2024 (UTC)
That feed also passes validation. Sam Wilson 02:21, 6 December 2024 (UTC)
It's this one: https://explainxkcd.com/rss.xml (linked from the sidebar) 2A00:23C6:549B:3101:F915:F5F6:548:395F (talk) 08:24, 6 December 2024 (UTC)
That feed is not appear to be produced by the MediaWiki software, so its not something we can help with. You should contact the explainxkcd people. Bawolff (talk) 19:50, 6 December 2024 (UTC)
Sorry, I came here from a link on explainxkcd and didn't notice I was no longer on that site. I'll try to raise it over there. Thanks for your advice. 2A00:23C6:549B:3101:FCEE:41F2:B244:D365 (talk) 14:09, 7 December 2024 (UTC)

Cannot execute query while transaction status is ERROR

Hello,

I've been hosting a MediaWiki instance for a friend of mine for a few years now. Recently, we've started getting database errors in various places: when trying to edit pages, view pages, view a page's history, etc.

The error message is always the same. Below is an example backtrace from when I try to view my user page's history:

[3980e1cab7ddab4431e53812] /index.php?title=User:Roesch&action=history   Wikimedia\Rdbms\DBTransactionStateError: Cannot execute query from WatchedItemStore::fetchWatchedItems while transaction status is ERROR
     Backtrace:
     from /var/www/html/wf203/mediawiki/includes/libs/rdbms/database/TransactionManager.php(207)
      #0 /var/www/html/wf203/mediawiki/includes/libs/rdbms/database/Database.php(991): Wikimedia\Rdbms\TransactionManager->assertTransactionStatus()
      #1 /var/www/html/wf203/mediawiki/includes/libs/rdbms/database/Database.php(640): Wikimedia\Rdbms\Database->assertQueryIsCurrentlyAllowed()
      #2 /var/www/html/wf203/mediawiki/includes/libs/rdbms/database/Database.php(1350): Wikimedia\Rdbms\Database->query()
      #3 /var/www/html/wf203/mediawiki/includes/libs/rdbms/database/DBConnRef.php(119): Wikimedia\Rdbms\Database->select()
      #4 /var/www/html/wf203/mediawiki/includes/libs/rdbms/database/DBConnRef.php(351): Wikimedia\Rdbms\DBConnRef->__call()
      #5 /var/www/html/wf203/mediawiki/includes/libs/rdbms/querybuilder/SelectQueryBuilder.php(729): Wikimedia\Rdbms\DBConnRef->select()
      #6 /var/www/html/wf203/mediawiki/includes/watcheditem/WatchedItemStore.php(891): Wikimedia\Rdbms\SelectQueryBuilder->fetchResultSet()
      #7 /var/www/html/wf203/mediawiki/includes/watcheditem/WatchedItemStore.php(728): WatchedItemStore->fetchWatchedItems()
      #8 /var/www/html/wf203/mediawiki/includes/watcheditem/WatchedItemStore.php(710): WatchedItemStore->loadWatchedItemsBatch()
      #9 /var/www/html/wf203/mediawiki/includes/watcheditem/WatchedItemStore.php(700): WatchedItemStore->loadWatchedItem()
      #10 /var/www/html/wf203/mediawiki/includes/watchlist/WatchlistManager.php(269): WatchedItemStore->getWatchedItem()
      #11 /var/www/html/wf203/mediawiki/includes/actions/HistoryAction.php(169): MediaWiki\Watchlist\WatchlistManager->getTitleNotificationTimestamp()
      #12 /var/www/html/wf203/mediawiki/includes/actions/FormlessAction.php(48): HistoryAction->onView()
      #13 /var/www/html/wf203/mediawiki/includes/actions/ActionEntryPoint.php(733): FormlessAction->show()
      #14 /var/www/html/wf203/mediawiki/includes/actions/ActionEntryPoint.php(510): MediaWiki\Actions\ActionEntryPoint->performAction()
      #15 /var/www/html/wf203/mediawiki/includes/actions/ActionEntryPoint.php(145): MediaWiki\Actions\ActionEntryPoint->performRequest()
      #16 /var/www/html/wf203/mediawiki/includes/MediaWikiEntryPoint.php(199): MediaWiki\Actions\ActionEntryPoint->execute()
      #17 /var/www/html/wf203/mediawiki/index.php(58): MediaWiki\MediaWikiEntryPoint->run()
      #18 {main}

These errors occur sporadically, and sometimes disappear after trying again a few times.

I noticed the following lines in the debug data panel:

[rdbms] Wikimedia\Rdbms\LoadBalancer::reuseOrOpenConnectionForNewRef: reusing connection for 0/mediawiki
  [rdbms] SqlBagOStuff::modifyTableSpecificBlobsForSet [0.389ms] localhost: REPLACE INTO "objectcache" (keyname,value,exptime) VALUES ('mediawiki:messages:en',x'158cb10a83401005ff65bf606f5d6fe3bbca42d0268a4230e5e5b8056bcb907f8f7633304c4683ef0903bd86759be627a503924e2868ecb7912e6c04e4b1a89bb439b27dbc3e3c73712edcd6aaaec6771741c3be4cebfb96700d844583b00516d38ed2ef0f','99991231235959')
  [rdbms] Error 5 from SqlBagOStuff::modifyTableSpecificBlobsForSet, database is locked REPLACE INTO "objectcache" (keyname,value,exptime) VALUES ('mediawiki:messages:en',x'158cb10a83401005ff65bf606f5d6fe3bbca42d0268a4230e5e5b8056bcb907f8f7633304c4683ef0903bd86759be627a503924e2868ecb7912e6c04e4b1a89bb439b27dbc3e3c73712edcd6aaaec6771741c3be4cebfb96700d844583b00516d38ed2ef0f','99991231235959') localhost
  [SQLBagOStuff] DBError: Error 5: database is locked
  Function: SqlBagOStuff::modifyTableSpecificBlobsForSet
  Query: REPLACE INTO "objectcache" (keyname,value,exptime) VALUES ('mediawiki:messages:en',x'158cb10a83401005ff65bf606f5d6fe3bbca42d0268a4230e5e5b8056bcb907f8f7633304c4683ef0903bd86759be627a503924e2868ecb7912e6c04e4b1a89bb439b27dbc3e3c73712edcd6aaaec6771741c3be4cebfb96700d844583b00516d38ed2ef0f','99991231235959')
  [SQLBagOStuff] SqlBagOStuff::handleDBError: ignoring query error
  

I'm running MediaWiki 1.42.3 with PHP 8.3.14 (fpm-fcgi). Due to the site running on a (well, relatively) underperforming single-board computer, I'm using SQLite for the database. The wiki can be accessed at https://wf203.net/.

My theory is that multiple PHP-FPM processes (from other visitors and crawlers) are trying to modify the database at the same time (this would also explain the sporadic occurrences of the errors).

If this really is the case, are these errors a bug in MediaWiki or expected behavior? And, in case of the latter, is there a way to work around them without having to switch to MySQL(/PostgreSQL)?

If not, what could be causing this?

I've already tried running the update.php maintenance script just in case, but didn't get any errors or new migrations, so the database itself seems to be fine.

Thanks! Twolnszq (talk) 10:54, 6 December 2024 (UTC)

"database is locked" indeed means that another process is already writing to it.
I personally would only use sqlite for a local wiki. Anything exposed to the internet probably should be using mysql/mariadb —TheDJ (Not WMF) (talkcontribs) 16:00, 6 December 2024 (UTC)
Kind of both. The sqlite backend is not well tested in multithread environments, and the concurrency model of sqlite is a bit different than mysql. So its mediawiki's fault, but also not totally unexpected. Bawolff (talk) 19:24, 6 December 2024 (UTC)
That said, this description also sounds like there might be a misconfiguration. Normally in sqlite in mediawiki there are separate dbs for objectcache and normal stuff, in your error message that appears not the be the case, so something may be misconfigured.
What is the contents of your LocalSettings.php (minus any passwords/keys). In particular, what is the config of $wgLocalisationCacheConf and $wgObjectCaches ? Bawolff (talk) 19:33, 6 December 2024 (UTC)
Neither $wgLocalisationCacheConf nor $wgObjectCaches are defined in LocalSettings.php (I don't remember configuring them either), but the getConfiguration script returns:
$wgLocalisationCacheConf = array(7) {
["class"]=>
string(17) "LocalisationCache"
["store"]=>
string(6) "detect"
["storeClass"]=>
bool(false)
["storeDirectory"]=>
bool(false)
["storeServer"]=>
array(0) {
}
["forceRecache"]=>
bool(false)
["manualRecache"]=>
bool(false)
};
$wgObjectCaches = array(8) {
[0]=>
array(2) {
["class"]=>
string(14) "EmptyBagOStuff"
["reportDupes"]=>
bool(false)
}
[1]=>
array(2) {
["class"]=>
string(12) "SqlBagOStuff"
["loggroup"]=>
string(12) "SQLBagOStuff"
}
["memcached-php"]=>
array(2) {
["class"]=>
string(21) "MemcachedPhpBagOStuff"
["loggroup"]=>
string(9) "memcached"
}
["memcached-pecl"]=>
array(2) {
["class"]=>
string(22) "MemcachedPeclBagOStuff"
["loggroup"]=>
string(9) "memcached"
}
["hash"]=>
array(2) {
["class"]=>
string(13) "HashBagOStuff"
["reportDupes"]=>
bool(false)
}
["apc"]=>
array(2) {
["class"]=>
string(13) "APCUBagOStuff"
["reportDupes"]=>
bool(false)
}
["apcu"]=>
array(2) {
["class"]=>
string(13) "APCUBagOStuff"
["reportDupes"]=>
bool(false)
}
["wincache"]=>
array(2) {
["class"]=>
string(17) "WinCacheBagOStuff"
["reportDupes"]=>
bool(false)
}
};
All settings in LocalSettings.php:
$wgSitename = "WF203";
$wgScriptPath = "";
$wgServer = "https://wf203.net";
$wgResourceBasePath = $wgScriptPath;
$wgLogo = "$wgResourceBasePath/resources/assets/wflogo1.png";
$wgEnableEmail = true;
$wgEnableUserEmail = true;
$wgEmergencyContact = "apache@🌻.invalid";
$wgPasswordSender = "apache@🌻.invalid";
$wgEnotifUserTalk = false;
$wgEnotifWatchlist = false;
$wgEmailAuthentication = true;
$wgDBtype = "sqlite";
$wgDBserver = "";
$wgDBname = "mediawiki";
$wgDBuser = "";
$wgDBpassword = "";
$wgSQLiteDataDir = "/var/www/html/wf203";
$wgDBprefix = "";
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
$wgMainCacheType = CACHE_ACCEL;
$wgMemCachedServers = [];
$wgEnableUploads = true;
$wgUseImageMagick = true;
$wgImageMagickConvertCommand = "/usr/bin/convert";
$wgUseInstantCommons = true;
$wgPingback = false;
$wgShellLocale = "C.UTF-8";
$wgCacheDirectory = "/var/www/html/wf203/cache";
$wgLanguageCode = "en";
$wgSecretKey = "[redacted]";
$wgAuthenticationTokenVersion = "1";
$wgUpgradeKey = "[redacted]";
$wgRightsPage = "";
$wgRightsUrl = "";
$wgRightsText = "";
$wgRightsIcon = "";
$wgDiff3 = "/usr/bin/diff3";
$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['*']['edit'] = false;
$wgDefaultSkin = "vector";
wfLoadSkin( 'Vector' );
wfLoadSkin( 'MinervaNeue' );
wfLoadExtension( 'Cite' );
wfLoadExtension( 'MobileFrontend' );
wfLoadExtension( 'VisualEditor' );
$wgDefaultUserOptions['visualeditor-enable'] = 1;
$wgHiddenPrefs[] = 'visualeditor-enable';
That also reminds me, when I first set up MediaWiki I did use MySQL, but at some point I migrated to SQLite using https://github.com/vdechef/mysql2sqlite (and renaming back the indices afterwards, since the script prefixes them: https://github.com/vdechef/mysql2sqlite/blob/master/mysql2sqlite#L356-L358). Not sure if this is relevant, since (apart from this one) I haven't had any issues since. Twolnszq (talk) 21:04, 6 December 2024 (UTC)
Try setting:
$wgObjectCaches[CACHE_DB] = [
	'class' => SqlBagOStuff::class,
	'loggroup' => 'SQLBagOStuff',
	'server' => [
		'type' => 'sqlite',
		'dbname' => 'wikicache',
		'tablePrefix' => '',
		'variables' => [ 'synchronous' => 'NORMAL' ],
		'dbDirectory' => $wgSQLiteDataDir,
		'trxMode' => 'IMMEDIATE',
		'flags' => 0
	]
];
$wgLocalisationCacheConf['storeServer'] = [
	'type' => 'sqlite',
	'dbname' => "{$wgDBname}_l10n_cache",
	'tablePrefix' => '',
	'variables' => [ 'synchronous' => 'NORMAL' ],
	'dbDirectory' => $wgSQLiteDataDir,
	'trxMode' => 'IMMEDIATE',
	'flags' => 0
];
$wgJobTypeConf['default'] = [
	'class' => 'JobQueueDB',
	'claimTTL' => 3600,
	'server' => [
		'type' => 'sqlite',
		'dbname' => "{$wgDBname}_jobqueue",
		'tablePrefix' => '',
		'variables' => [ 'synchronous' => 'NORMAL' ],
		'dbDirectory' => $wgSQLiteDataDir,
		'trxMode' => 'IMMEDIATE',
		'flags' => 0
	]
];
This also requires you to create separate databases wikicache.sqlite, mediawiki_l10n_cache.sqlite, mediawiki_jobqueue.sqlite in your sqlite data directory.
you can use the sqlite3 command line tool to do this.
the mediawiki_l10n_cache.sqlite database should have the following schema:
        CREATE TABLE l10n_cache (
                lc_lang BLOB NOT NULL,
                lc_key TEXT NOT NULL,
                lc_value BLOB NOT NULL,
                PRIMARY KEY (lc_lang, lc_key)
        );
        PRAGMA journal_mode=WAL;
The mediawiki_jobqueue.sqlite database should have the following schema:
        CREATE TABLE job (
                job_id INTEGER  NOT NULL PRIMARY KEY AUTOINCREMENT,
                job_cmd BLOB NOT NULL default '',
                job_namespace INTEGER NOT NULL,
                job_title TEXT  NOT NULL,
                job_timestamp BLOB NULL default NULL,
                job_params BLOB NOT NULL,
                job_random integer  NOT NULL default 0,
                job_attempts integer  NOT NULL default 0,
                job_token BLOB NOT NULL default '',
                job_token_timestamp BLOB NULL default NULL,
                job_sha1 BLOB NOT NULL default ''
        );
        CREATE INDEX job_sha1 ON job (job_sha1);
        CREATE INDEX job_cmd_token ON job (job_cmd,job_token,job_random);
        CREATE INDEX job_cmd_token_id ON job (job_cmd,job_token,job_id);
        CREATE INDEX job_cmd ON job (job_cmd, job_namespace, job_title, job_params);
        CREATE INDEX job_timestamp ON job (job_timestamp);
        PRAGMA journal_mode=WAL;
The wikicache.sqlite db should have the schema
CREATE TABLE IF NOT EXISTS "objectcache" (
	keyname BLOB NOT NULL default '' PRIMARY KEY,
	value BLOB,
	exptime BLOB NOT NULL
);
CREATE INDEX "exptime" ON "objectcache" (exptime);
PRAGMA journal_mode=WAL;
Also, you should verify that your main database uses the WAL journal mode. If you're not sure, you can use the sqlite3 command to convert it, by opening it with sqlite3 and running PRAGMA journal_mode=WAL;.
Hope that helps Bawolff (talk) 22:46, 6 December 2024 (UTC)
Seems like that did the trick! I poked around the wiki for a few minutes but haven't encountered a single error. Thank you! Twolnszq (talk) 07:01, 7 December 2024 (UTC)

Lua Error: Status 127

I've been trying for days to track down a problem with my installation of MediaWiki 1.41.1, which I spent some time rescuing from a spam attack a while back. My NavBoxes aren't working, being replaced with "Lua error: Internal error: The interpreter exited with status 127." My understanding is that 127 is a "file not found" error, but I can't figure out what file it can't find. I'm not certain that it's related to NavBox specifically; I get the impression that it's a more general Lua issue, since I'm seeing the error in a nearly all my Templates and Modules.

Is there a way I can determine what file Lua is looking for? I've got $wgShowDebug set to true but I'm not seeing anything obvious in the logs... though I don't know for sure what exactly I'm looking for. TobyRush (talk) 20:41, 6 December 2024 (UTC)

Okay, I can confirm that it's nothing to do with the Navbox: if I enter a simple command (like =p.Hello .. ', World!')into the Debug Console on any page, I get the status 127 error. My webserver does not allow executables outside of /usr/bin, so I have the following in my LocalSettings.php:
$wgScribuntoEngineConf['luastandalone']['luaPath'] = '/usr/bin/lua';
I'm sure this is something simple for someone familiar with Lua an Scribunto, but I'm at a loss... TobyRush (talk) 21:42, 6 December 2024 (UTC)
Also, for each error it throws on the page (for example, a page where I have several NavBoxes), it includes this line in the log. Not sure if that's something normal or if it hints at anything:
[Scribunto] MediaWiki\Extension\Scribunto\Engines\LuaStandalone\LuaStandaloneInterpreter::__construct: creating interpreter: 'exec' '/bin/sh' '/home/sites/35b/2/226fa573e0/public_html/theorywiki/extensions/Scribunto/includes/Engines/LuaStandalone/lua_ulimit.sh' '7' '8' '51200' ''\''/usr/bin/lua'\'' '\''/home/sites/35b/2/226fa573e0/public_html/theorywiki/extensions/Scribunto/includes/Engines/LuaStandalone/mw_main.lua'\'' '\''/home/sites/35b/2/226fa573e0/public_html/theorywiki/extensions/Scribunto/includes'\'' '\''3'\'' '\''8'\''' TobyRush (talk) 21:45, 6 December 2024 (UTC)
Error 127 generally means that $wgScribuntoEngineConf['luastandalone']['luaPath'] is set incorrectly,or you are otherwise missing some files in the scribunto extension. Bawolff (talk) 17:47, 7 December 2024 (UTC)
> My webserver does not allow executables outside of /usr/bin, so I have the following in my LocalSettings.php:
Did you actually move the lua binary to that path? Bawolff (talk) 00:23, 11 December 2024 (UTC)
Thanks. Yes, I had actually moved the lua binary to that path.
It looks like I wasn't doing anything incorrectly; I finally determined that my web hosting service was indeed locking things down and would not let me run lua scripts (even though they had done so in the past).
This was the last in a long line of issues I had with that webhost, so I've moved to a different web host and copied everything over there. At first I was having the same problem, but I ended up removing the $wgScribuntoEngineConf line altogether (so I just load the extension an set the default engine to 'luastandalone' and things seem to be working now.
I'm pretty sure I had tried that at my old host, but regardless, things are working now on my new server using the lua binaries built in to the scribunto extension. TobyRush (talk) 23:30, 21 December 2024 (UTC)

On this page, in the last sentence of the first section, there is a link to "the witkitext editor" which arrives on a page with 20 different editors. Which one is the good one ? Could someone improve the link ? Mahabarata73 (talk) 21:40, 7 December 2024 (UTC)

The link should be as is. There is no page about the standard MediaWiki editor, and the modern WikiEditor is already linked. ToadetteEdit (talk) 12:28, 8 December 2024 (UTC)
The sentence on Help:Edit Recovery is: "This feature is for the wikitext editor, not VisualEditor, and does not require WikiEditor to be enabled."
The disambiguation page linked to from the word "editor" lists a whole load of editors, including VisualEditor and WikiEditor...
Presumably the words "wikitext editor" could be replaced with text from the first item on the disambiguation list: "the default MediaWiki editor (2003 wikitext editor)".
I don't know enough about the topic to make the change myself. Jonathan3 (talk) 23:52, 8 December 2024 (UTC)
I linked it to Extension:WikiEditor, which is the appropriate one. —TheDJ (Not WMF) (talkcontribs) 09:54, 9 December 2024 (UTC)
Now it essentially means, "This feature is for WikiEditor, not VisualEditor, and does not require WikiEditor to be enabled."
That might be right but doesn't make sense to me yet. Maybe it needs an explanation. Jonathan3 (talk) 11:09, 9 December 2024 (UTC)
I just found here another page about Edit:Recovery where the text (of the second section) is clearer and could inspire the Help page. Mahabarata73 (talk) 12:12, 9 December 2024 (UTC)

Gírias e Linguajar da internet

Traduzi uma página sobre um single musical e estou tendo problemas para enviar pois o sistema alega que há gírias e linguajar "tecnológico", suponho que isso atrapalhe no processo de distribuição de informação, uma vez que desconsidere o palavreado digital como correto, se alguém poder me ajudar ficarei grato. Mateus Cooper Lisboa (talk) 02:08, 8 December 2024 (UTC)

This appears to be an abusefilter false positive, in any case you csn report to an admin on pt.wp or at pt:Wikipédia:Pedidos/Outros. ToadetteEdit (talk) 12:56, 8 December 2024 (UTC)

big problem with ListGroupRight page in French

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


This special page can be seen in different languages but is not translatable: we have to change the language at the top of the page to see it in the desired language.

If you do this and choose french (français), you will find, for "(ipblock-exempt)", the french text "Exemptés de blocage IP".

This translation is very bad: "exemptés" means "people who have this right" when this group name should mean "people who can give this right".

So the good french text of this group should be "Exempteurs de blocage d'IP" ("Exemptés" need to be changed to "Exempteurs" and "IP" need to be changed to "d'IP").

I didn't find how to change this big issue (big because the exact opposite of what it should be) so if someone knows and may fix this, it will be highly appreciated.

Because it is the name of a group, there are maybe some other changes to do. Please try to fix all. Mahabarata73 (talk) 14:18, 8 December 2024 (UTC)

1) Such messages are defined at translatewiki.net, in this case at translatewiki:MediaWiki:Group-ipblock-exempt/fr. You can create an account there and fix it yourself. 2) I see no issues on my side as "Exemptés de blocage IP" translates to "exempt from IP blocking" which is the name of the exact user right. But machine translation can often be unreliable, so manual checking by native users may be needed, as in the case here. ToadetteEdit (talk) 16:04, 8 December 2024 (UTC)
My mistake, sorry : I confused the old "ipblock-exempt" group and the new (and apparently empty on mediawiki) "ipblock-exempt-grantor” group.
This topic can be closed. Mahabarata73 (talk) 21:34, 8 December 2024 (UTC)
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

PHP Deprecated:  (Extension name)'s extension.json or skin.json does not have manifest_version

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


I've noticed this deprecation notice on some extensions of mine I've cobbled together over the years

Over half the extensions I have from mediawiki.org have <code>"manifest_version": 2</code> and the rest have <code>"manifest_version": 1</code>.

I can see from Manual:Extension.json/Schema#manifest version that these are the two choices, but can't work out much more than that.

Which should I use? Jonathan3 (talk) 22:43, 8 December 2024 (UTC)

I've gone for "1" in the meantime! Jonathan3 (talk) 23:47, 8 December 2024 (UTC)
@Jonathan3: I think you'd be best off moving to version 2, and fixing any issues that arise. It's the way of the future after all! :-P Sam Wilson 01:52, 9 December 2024 (UTC)
Cool. Done. In one of the extensions that caused (with ExtensionName replacing the actual name):
  • PHP Warning: array_key_exists() expects parameter 2 to be array, bool given in /var/www/html/includes/registration/ExtensionProcessor.php on line 830
  • PHP Fatal error: Uncaught UnexpectedValueException: Missing value for config ExtensionNameEnableFoo in /var/www/html/includes/registration/ExtensionProcessor.php:831 for a "config" value. It was just a leftover from whatever example template I'd based it on, so getting rid of it solved things.
For my own future reference, this is what caused the problem:
	"config": {
		"ExtensionNameEnableFoo": true
	},
Jonathan3 (talk) 10:03, 9 December 2024 (UTC)
P.S. I've just seen this, which explains things: Manual:Extension.json/Schema#config. Jonathan3 (talk) 10:05, 9 December 2024 (UTC)
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

What do do after repairing job table?

My server ran out of space. I only realised this yesterday, but it meant I needed to repair the job table. Is there any way of re-doing things that failed in the past, but weren't in the job table (any more), i.e. making sure the wiki database is all up to date now? Jonathan3 (talk) 12:17, 9 December 2024 (UTC)

This is hard to say. Many of the tasks handled by jobs have maintenance scripts to refresh essentially all pages or specific pages for that type of change. But these are expensive operations, so doing them for an entire wiki without knowing where the discrepancy is, might not be wise. Additionally, some of the tasks handled by the job queue will also be handled eventually as people use the site again and cause triggers to refire. —TheDJ (Not WMF) (talkcontribs) 13:31, 9 December 2024 (UTC)
Thanks. I'd be happy to run whatever scripts would be recommended. The wiki isn't that big (15k pages maybe). I've used refreshLinks.php before and it didn't take inordinately long. But maybe there are just too many - Manual:Maintenance_scripts/List_of_scripts... Jonathan3 (talk) 14:36, 9 December 2024 (UTC)
Most jobs don't really matter too much if they get dropped. RefreshLinks.php will probably do most the stuff. In rare cases rebuildRecentChanges maybe. Bawolff (talk) 00:21, 11 December 2024 (UTC)
Thank you. I'll look into those. Jonathan3 (talk) 10:06, 11 December 2024 (UTC)

JS hook in the wikicode editor (when the preview is refreshed)

I'd like some custom JS code to be executed when the preview panel in the wiki editor is refreshed. (I am using a custom JS library for mathematical typesetting, and I want it to be run on the preview so that the mathematical content is typeset.) Is there any way to achieve this?

Even partial answers would be very welcome, since I even struggle at understanding how the editor's code is organised... Sparusaurata2 (talk) 12:53, 9 December 2024 (UTC)

@Sparusaurata2 you are looking for the Javascript hook system. And the hook for when the wikicontent (be it in a preview or not) changes is 'wikipage.content' —TheDJ (Not WMF) (talkcontribs) 13:28, 9 December 2024 (UTC)
Thanks a lot! Following this suggestion, I added the following code in Common.js:
mw.hook( 'wikipage.content' ).add( function( $content ) {
  renderMathInElement($content, {
   delimiters: [
     {left: '$DKATEX$', right: '$DKATEX$', display: true},
     {left: '$TKATEX$', right: '$TKATEX$', display: false},
     {left: '\\[',      right: '\\]',      display: true},
     {left: '\\(',      right: '\\)',      display: false
   ],
   output: "mathml"
  });
} );
but when I try it out and reload the Preview in the Wiki editor, the expected result does not happen (the math is not rendered) and instead I obtain an error in the JS console: Uncaught TypeError: e.childNodes is undefined. Any idea why this is happening? Sparushau (talk) 13:52, 27 January 2025 (UTC)

Instalation Error

Hello

I am trying to perform a installation of MediaWiki 1.42.3 on my server, and I am encountering the following error:

Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' DEFAULT CHARSET=binary' at line 8

Function: Wikimedia\Rdbms\Database::sourceFile( /home/mediawiki/htdocs/maintenance/tables-generated.sql )

Query: CREATE TABLE `site_identifiers` (

si_type VARBINARY(32) NOT NULL,

si_key VARBINARY(32) NOT NULL,

si_site INT UNSIGNED NOT NULL,

INDEX si_site (si_site),

INDEX si_key (si_key),

PRIMARY KEY(si_type, si_key)

) ENGINE=, DEFAULT CHARSET=binary


MariaDB Version: 10.6.20 181.171.135.220 (talk) 17:09, 9 December 2024 (UTC)

Check your $wgDBTableOptions in LocalSettings.php. Visit the link to see the allowed valid values. – Ammarpad (talk) 17:27, 9 December 2024 (UTC)
I am currently in the process of installing MediaWiki from scratch, and I do not yet have the LocalSettings.php file. 181.171.135.220 (talk) 17:30, 9 December 2024 (UTC)
How are you doing the installation? Please give exact steps leading to the error. Also state from where you downloaded MediaWiki. – Ammarpad (talk) 13:30, 10 December 2024 (UTC)
Reminds me a bit of phab:T212236
What is the output of SHOW ENGINES; from your database server. Bawolff (talk) 00:20, 11 December 2024 (UTC)