Jump to content

Project:Support desk/Flow

About this board

This page is an archive. Do not add new topics here.

Please ask new questions at Project:Support desk instead.

Revision 0 does not exist

22
Rebastion2 (talkcontribs)

So my wiki has gone through a few decades of upgrades and I would consider its database surely rife for optimization. I noticed this as I am unable to upgrade to the latest LTS, so now I am trying to isolate and fix as many problems with the database as I can.


One is shoddy files and other corruptions. Most maintenance scripts don't seem to really fix this.


One problem I have is similar to this one https://stackoverflow.com/questions/34143056/main-page-error-of-mediawiki

I have a file that displays properly but has no 0 revision registered for some reason and I cannot edit it, either. None of the "fixes" I can find on here and elsewhere on the web really help. I appreciate any pointers to maintenance scripts, hacks and other tips to really (really) fix flawed database structures etc...

Bawolff (talkcontribs)

Can you post the entry in the page table for that page, along with anything in the revision table where rev_page is equal to the page_id for that page?

What version of mediawiki are you using?

Common causes of this are referential integrity errors, either with the page_latest field in page, the rev_comment_id field in revision or rev_actor field in revision (the last being most common as the actor migration upgrade script is fragile)

Rebastion2 (talkcontribs)

First of all thanks for your interest in helping me. Ok let's see (would love a maintenance script that just goes through my entire database and either fixes everything or gives me a very detailed report what needs fixing).


"Entry in the page table for that page":

page_namespace 6 pagetitle 4A61636B70616C616E63652E6A7067 is_redirect 0 is_new 1 page_touched 20230118090223 page_latest 5734 page_len page_links_updated 3230313530343032313635383433


"anything in the revision table where rev_page is equal to page_id"

rev_id 5734 rev_page 2524 rev_commend_id 0 rev_actor 0 rev_timestamp 20060208174920 rev_minor_edit 0 rev_deleted 0 rev_len 0 rev_parent_id 0 rev_sha1 70686F6961633968346D383432787134357370377336753231657465657131 (this is not unique, I see a few adjacent revisions that have the same hash, but I could tink of reasons why that may be so, but not sure if it's supposed to be non-unique)

Mediawiki 1.38.2

I may have used delete old revisions many many years ago. And one of the things I have tried very recently is the migrateactors php script which helps in assiging content that has no actor assigned

Bawolff (talkcontribs)

So the rev_actor being 0 and rev_comment_id being 0 indicate that update.php didnt do the migration properly.

The actor migration script generally doesnt work anymore. Its best to run it around 1.33. If you dont have backups to that point you would probably have to manually fix it by updating rev_actor to point to some actor.

Rebastion2 (talkcontribs)

what do I point it to? this all means very little to me not being familiar with the product's sql architecture. Going back to 1.33 is not an option of course....

Rebastion2 (talkcontribs)
Rebastion2 (talkcontribs)

Bawolff, I have a very concrete question, maybe you can point me in the right direction: from all I can gather, once restoring to a pre 1.35 backup state is off the table, there is no real way to "fix" this. However, if it only affects a manageable number of pages/files, I wonder if the following could be achieved: is there a way to manually remove all traces of these pages/files from the database, so that these become "nonexistent" again and can be re-created or re-uploaded (in the case of the files) thereby creating new/fresh and correct database entries for these content items? That would be a manual way of fixing this in order to have the next upgrade to 1.39.2 not throw any errors :)

Bawolff (talkcontribs)

You could delete the entry in the page table i suppose, ymmv.

Rebastion2 (talkcontribs)

hm, can't even find it. Nothing in the database seems to be in plain text, as far as I understand it it is all hashed, but can't find one of the files in question even by looking for their hashed value... so weird

Bawolff (talkcontribs)

They aren't hashed. Some db tools will display page titles in hexadecimal form

Rebastion2 (talkcontribs)

How weird, but indeed the sql query the db tool shows on top of the screen when opening the pages table says "

SELECT *, HEX(`page_title`) AS `page_title`, HEX(`page_content_model`) AS `page_content_model`, HEX(`page_links_updated`) AS `page_links_updated`, HEX(`page_lang`) AS `page_lang`   FROM `swdb_page`LIMIT 50
Rebastion2 (talkcontribs)

talking to my hoster now why that is the database wide default, so weird

Rebastion2 (talkcontribs)

it seems to be default behavior for "Adminer" to show as Hex if the column type is binary. Now of course it sucks the hoster uses Adminer, but before I go into further trouble I just want to make sure and ask this: binary is the correct format for the table column(s), right?

Bawolff (talkcontribs)

Yes. We basically use it to tell the DB to be hands off about the value.

Simpsonspedia.net (talkcontribs)
Rebastion2 (talkcontribs)

Hi Bawolf. Appreciate your input. If my problem is limited to just a handful pages/files, you mentioned they could be pointed to to "some actor". Any advice as to which?

The alternative would be to delete all mention of this content and create it anew (thereby correctly establishing that content and its relationships in the database like any new content created)

Bawolff (talkcontribs)

it doesn't really matter which actor. You could create a new user for that purpose.

Rebastion2 (talkcontribs)

I could just assign all these to me, but what values doe rev_actor and rev_comment_id etc. get? forgive me but it's all a bit overwhelming without prior in depth knowledge of the database structure. My goal would be for none of these to be 0, right? ev_minor_edit 0 rev_deleted 0 rev_len 0 rev_parent_id 0 isn't a problem?

Rebastion2 (talkcontribs)

sorry to be a bother, still looking for a step by step sort of instruction how to possibly "fix" this manually (at least as a "hack" - I don't care who these revisions are assigned to as long as the database is no longer practically corrupted and these files uneditable)

Rebastion2 (talkcontribs)

Still wondering how to solve this. There's something in phabricator that's not developed yet about re-calculating the content blobs and thus restoring the lost connections between the tables. If I know the handful of content items affected, could I do it manually? I wonder if I attempt another upgrade now will it work or is https://phabricator.wikimedia.org/T328169 the thing that needs to be done first.

Ciencia Al Poder (talkcontribs)

At your current state, most you can get is assigning all those xx_actor and xx_commend_id an existing id from the actor and comment table respectively. For example, choose a system user like "maintenance script" or create a new user just for this purpose, and a comment that's empty or has a meaningful text like "imported revision" or "restored revision" (you can create a new page and use this edit summary to create it. That should make your revisions accessible again if they're broken due to inconsitencies in those fields.

Rebastion2 (talkcontribs)

My SQL skills are rather basic, I may need a more detailed instruction on how to do it. 1) is there a systematic way to catch all the cases that are corrupted, I keep finding wiki content by accident that is affected 2) which fields in the database do I change to which variables/numbers/ids etc without causing further breakage? And I don't think I understand what you mean by creating an empty comment etc. To be clear: affect content is entirely non-editable from the front end... Thanks for you help!

Reply to "Revision 0 does not exist"

Notifications to Android

11
Gryllida (talkcontribs)

Can I get notifications from Extension:Echo (and other extensions using same mechanism, seeing as "Other MediaWiki extensions can make use of Notifications to send their own notifications; Thanks and DiscussionTools are two such extensions") pushed to Android? If this is not implemented, please guide me how to do it regarding the available API and examples of similar open-source apps, then I can try to develop this feature. I would like to do this as part of an app which is not focused on Wikipedia only, it should allow the users to specify the address of the wiki (or multiple wikis) where to get the notifications from in their Android device.

TheDJ (talkcontribs)

The notifications can be pushed to the (Wikipedia) mobile app, by going Preferences -> Notifications and checking the notifications for the 'Mobile' channel.

As there is only a Wikipedia Android app, those are the only sites of which you can push the notifications to Android. As Application notifications need to be configured by the website owner and registered etc etc, I don't think you can push them to your own app.

TheDJ (talkcontribs)

Of course you can build your own push server to push them. But then you'd have to fetch them using the api from this server, which would be less than ideal, as you'd have to pull them in that case, before you can push, which is pretty inefficient.

Bawolff (talkcontribs)

I guess someone could implement push notifications on the real site instead of the app.

Gryllida (talkcontribs)

Hi TheDJ, Bawolff, thank you for your replies. How does it work in the English Wikipedia app? Where is the push server?

TheDJ (talkcontribs)
Bawolff (talkcontribs)
Gryllida (talkcontribs)

Thanks. I've found the latter link useful as there is an api query that allows to subscribe to receive new notification. Example of how to leverage this in a tiny sample Android app would be very helpful.

(The infrastructure team is now known as Content Transform Team. @MSantos (WMF) @SLopes-WMF)

Gryllida (talkcontribs)

TheDJ, Bawolff, I appreciate your advice however I've had zero progress because I don't know what I need to do to achieve what I want: write an app that allows me to receive on-wiki notifications as push notifications on Android, and allow me to write custom code to send additional notifications triggered by events which I want which are not included in Echo/Notifications system. Could you please provide me with step by step instructions?

I can administer a software on a toolforge server if it is needed.

TheDJ (talkcontribs)

I also don't know. I can only give the pointers that I have given.

MSantos (WMF) (talkcontribs)

@Gryllida thanks for the context and sorry for the late response on this thread. I am not entirely sure on how to help, we have been maintaining the service but the original authors are not around anymore.

I believe this could be either on Android or the push-notifications service side but if you want to push to the Android and/or iOS devices you need to file a phab task and tag Content Transform Team and Mobile Apps so we can understand your need.

As far as I can remember, we would support any Echo notifications of the box, I am not sure about how Echo interacts with other extensions.

Reply to "Notifications to Android"

What do do after repairing job table?

5
Jonathan3 (talkcontribs)

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?

TheDJ (talkcontribs)

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.

Jonathan3 (talkcontribs)

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...

Bawolff (talkcontribs)

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.

Jonathan3 (talkcontribs)

Thank you. I'll look into those.

Reply to "What do do after repairing job table?"
TobyRush (talkcontribs)

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 (talkcontribs)

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 (talkcontribs)

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'\'''

Bawolff (talkcontribs)

Error 127 generally means that $wgScribuntoEngineConf['luastandalone']['luaPath'] is set incorrectly,or you are otherwise missing some files in the scribunto extension.

Bawolff (talkcontribs)

> 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?

Reply to "Lua Error: Status 127"
181.171.135.220 (talkcontribs)

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

Ammarpad (talkcontribs)

Check your $wgDBTableOptions in LocalSettings.php. Visit the link to see the allowed valid values.

181.171.135.220 (talkcontribs)

I am currently in the process of installing MediaWiki from scratch, and I do not yet have the LocalSettings.php file.

Ammarpad (talkcontribs)

How are you doing the installation? Please give exact steps leading to the error. Also state from where you downloaded MediaWiki.

Bawolff (talkcontribs)

Reminds me a bit of phab:T212236


What is the output of SHOW ENGINES; from your database server.

Reply to "Instalation Error"

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

5
Summary by Jonathan3

Added "manifest_version": 2

Jonathan3 (talkcontribs)

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 (talkcontribs)

I've gone for "1" in the meantime!

Samwilson (talkcontribs)

@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

Jonathan3 (talkcontribs)

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 (talkcontribs)

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

2
Sparusaurata2 (talkcontribs)

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...

TheDJ (talkcontribs)

@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'

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

link to a disambiguation page

6
Mahabarata73 (talkcontribs)

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 ?

ToadetteEdit (talkcontribs)

The link should be as is. There is no page about the standard MediaWiki editor, and the modern WikiEditor is already linked.

Jonathan3 (talkcontribs)

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.

TheDJ (talkcontribs)
Jonathan3 (talkcontribs)

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.

Mahabarata73 (talkcontribs)

I just found here another page about Edit:Recovery where the text (of the second section) is clearer and could inspire the Help page.

Reply to "link to a disambiguation page"

Issues with Categories constantly changing.

3
Grimreeper1342 (talkcontribs)

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.

Bawolff (talkcontribs)

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?

Kantarell90 (talkcontribs)

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.

Reply to "Issues with Categories constantly changing."

big problem with ListGroupRight page in French

3
Mahabarata73 (talkcontribs)

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.

ToadetteEdit (talkcontribs)

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.

Mahabarata73 (talkcontribs)

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.