Page MenuHomePhabricator

Fatal exception of type "MediaWiki\Revision\RevisionAccessException" when visiting https://wiki.wikimedia.it/wiki/MediaWiki:Common.js
Closed, ResolvedPublic

Description

Current situation (reported by @dario.crespi.wmit):

In production (1.35) of https://wiki.wikimedia.it/, page [[MediaWiki:Common.js]] explodes with:

Fatal exception of type "MediaWiki\Revision\RevisionAccessException

The history does not show the correct latest revision.

It's not possible to delete the page from the web interface.

Inspecting the database, it seems page [[MediaWiki:Common.js]] points to revision 1257231, that has rev_sha1 = g71rbz7gievck79qine062lx5pt14fc but that content_sha1 does not exist. Instead, in the legacy wiki (1.26), the rev_sha1 exists.

This is the situation in production:

Common.js
$ SELECT * FROM page WHERE page_id = 7143 \G;
page_id: 7143
page_namespace: 8
page_title: Common.js
page_restrictions:
page_is_redirect: 0
page_is_new: 0
page_random: 0.539350581857
page_touched: 20220725123931
page_latest: 1257231
page_len: 5869
page_content_model: javascript
page_links_updated: 20220725123931
page_lang: NULL
Common.js latest revision
$ SELECT * FROM revision WHERE rev_id = 1257231 \G;
rev_id: 1257231
rev_page: 7143
rev_comment_id: 0
rev_actor: 0
rev_timestamp: 20220725123931
rev_minor_edit: 1
rev_deleted: 0
rev_len: 5869
rev_parent_id: 1182371
rev_sha1: g71rbz7gievck79qine062lx5pt14fc
NOTE: ↑ that rev_parent_id should be 0 but it's 1182371.
Common.js latest revision content
$ SELECT * FROM content WHERE content_sha1 = 'g71rbz7gievck79qine062lx5pt14fc' \G;
Empty set (0.049 sec)
NOTE: ↑ the content for revision 1257231 does not exist.

Also notable:

Common.js revision more recent than the first revision (!)
$ SELECT * FROM revision WHERE rev_id = 1182371 \G;
rev_id: 1182371
rev_page: 7143
rev_comment_id: 0
rev_actor: 0
rev_timestamp: 20220309151406
rev_minor_edit: 0
rev_deleted: 0
rev_len: 5784
rev_parent_id: 1177961
rev_sha1: 8jwn1qiatgx96ktre86ri1rn2o03oa3

Since our intentions are to delete this page, and since this seems the only page involved with this problem, and since only the latest revision of this page seems broken, the proposed dirty workaround is to update in production page [[MediaWiki:Common.js]] (id 7143) deleting the reference to the broken revision 1182371. Additional notes:

$ SELECT * FROM content WHERE content_sha1 = '8jwn1qiatgx96ktre86ri1rn2o03oa3' \G;
content_id: 145618
content_size: 5784
content_sha1: 8jwn1qiatgx96ktre86ri1rn2o03oa3
content_model: 3
content_address: tt:1148831

So this is the proposed hotfix in production:

$ UPDATE revision SET rev_parent_id = 0 WHERE rev_id = 1257231;
$ DELETE FROM revision WHERE rev_id = 1182371;

This obtains a working page and a working history.

Even said that, the page cannot be deleted yet, because of:

Error 1062: Duplicate entry '46233' for key 'ar_revid_uniq' (localhost)

So, since our intention is to delete this page, it's safe enough to get rid of all these broken archived revisions:

$ DELETE FROM archive WHERE ar_namespace = 8 AND ar_title = 'Common.js';

Now I was able to delete this page using the canonical way.

I have absolutely no idea why such a thing happened. It's like in the dump, the page and the archive table were more up to date (out of sync) than the revision table.

BTW, since the intention was to nuke that page, and now it's really nuked, here the original history:

 12:39, 25 July 2022β€Ž Valerio Bozzolan (Talk | contribs | block)β€Ž m . . (5,869 bytes) (+85)β€Ž . . (fix access of undefined wgUserGroups in MediaWiki 1.35 phabricator:T268515; remove deprecated addOnloadHook()) (rollback 1 edit | undo)
(cur | prev) 15:14, 9 March 2022β€Ž Dario Crespi (Talk | contribs | block)β€Ž . . (5,784 bytes) (-5)β€Ž . . (undo)
(cur | prev) 13:52, 4 March 2022β€Ž Dario Crespi (Talk | contribs | block)β€Ž . . (5,789 bytes) (+1)β€Ž . . (undo)
(cur | prev) 13:50, 4 March 2022β€Ž Dario Crespi (Talk | contribs | block)β€Ž . . (5,788 bytes) (+93)β€Ž . . (+link al manuale) (undo)
(cur | prev) 09:15, 31 December 2021β€Ž Iopensa (Talk | contribs | block)β€Ž . . (5,695 bytes) (+45)β€Ž . . (undo)
(cur | prev) 09:06, 31 December 2021β€Ž Iopensa (Talk | contribs | block)β€Ž . . (5,650 bytes) (+26)β€Ž . . (undo)
(cur | prev) 08:44, 31 December 2021β€Ž Iopensa (Talk | contribs | block)β€Ž . . (5,624 bytes) (+71)β€Ž . . (Aggiungo link alla pagina direttivo) (undo)
(cur | prev) 20:02, 29 September 2017β€Ž Nemo (Talk | contribs | block)β€Ž m . . (5,553 bytes) (-2)β€Ž . . (^_^) (undo)
(cur | prev) 20:01, 29 September 2017β€Ž Nemo (Talk | contribs | block)β€Ž . . (5,555 bytes) (-646)β€Ž . . (HTTPS non c'Γ¨. Per la veritΓ  non vedo l'utilitΓ  di reindirizzare chi va in modifica.) (undo)
(cur | prev) 12:45, 27 August 2017β€Ž Laurentius (Talk | contribs | block)β€Ž . . (6,201 bytes) (+457)β€Ž . . (sidebar anche per lo staff) (undo)
(cur | prev) 09:22, 15 April 2017β€Ž Saverio.G (Talk | contribs | block)β€Ž m . . (5,744 bytes) (+73)β€Ž . . (aggiunta link a sezione direttivo) (undo)
(cur | prev) 18:36, 30 January 2017β€Ž Laurentius (Talk | contribs | block)β€Ž . . (5,671 bytes) (+539)β€Ž . . (aggiungo sezione del menΓΉ per il direttivo) (undo)
(cur | prev) 14:57, 30 January 2017β€Ž Nemo (Talk | contribs | block)β€Ž . . (5,132 bytes) (-116)β€Ž . . (tolgo pagina superata) (undo)
(cur | prev) 13:11, 24 September 2015β€Ž Nemo (Talk | contribs | block)β€Ž . . (5,248 bytes) (+116)β€Ž . . (Collegamento a Associazione:Attribuzione di compiti a volontari, richiesto da Giuliana.) (undo)
(cur | prev) 18:30, 13 April 2015β€Ž Laurentius (Talk | contribs | block)β€Ž . . (5,132 bytes) (+74)β€Ž . . (formattazione delle etichette del menu) (undo)
(cur | prev) 12:45, 19 May 2014β€Ž CristianCantoro (Talk | contribs | block)β€Ž . . (5,058 bytes) (+980)β€Ž . . (undo)
(cur | prev) 08:46, 16 May 2014β€Ž Gvf (Talk | contribs | block)β€Ž . . (4,078 bytes) (-1)β€Ž . . (Cambio gruppo per visualizzazione sidebar soci da users a Soci) (undo)
(cur | prev) 15:52, 17 December 2013β€Ž CristianCantoro (Talk | contribs | block)β€Ž . . (4,079 bytes) (-4)β€Ž . . (undo)
(cur | prev) 15:49, 17 December 2013β€Ž CristianCantoro (Talk | contribs | block)β€Ž . . (4,083 bytes) (-5)β€Ž . . (undo)
(cur | prev) 15:43, 17 December 2013β€Ž CristianCantoro (Talk | contribs | block)β€Ž . . (4,088 bytes) (+206)β€Ž . . (+redirect) (undo)
(cur | prev) 07:42, 26 March 2012β€Ž Laurentius (Talk | contribs | block)β€Ž . . (3,882 bytes) (-885)β€Ž . . (pulisco) (undo)
(cur | prev) 07:36, 26 March 2012β€Ž Laurentius (Talk | contribs | block)β€Ž . . (4,767 bytes) (+103)β€Ž . . (prova per monobook) (undo)
(cur | prev) 21:20, 25 March 2012β€Ž Laurentius (Talk | contribs | block)β€Ž . . (4,664 bytes) (-3)β€Ž . . (funziona!) (undo)
(cur | prev) 21:19, 25 March 2012β€Ž Laurentius (Talk | contribs | block)β€Ž . . (4,667 bytes) (+1)β€Ž . . (prova) (undo)
(cur | prev) 21:17, 25 March 2012β€Ž Laurentius (Talk | contribs | block)β€Ž . . (4,666 bytes) (+1)β€Ž . . (correggo) (undo)
(cur | prev) 21:15, 25 March 2012β€Ž Laurentius (Talk | contribs | block)β€Ž . . (4,665 bytes) (+894)β€Ž . . (test...) (undo)
(cur | prev) 21:01, 25 March 2012β€Ž Laurentius (Talk | contribs | block)β€Ž . . (3,771 bytes) (+3)β€Ž . . (test) (undo)
(cur | prev) 20:59, 25 March 2012β€Ž Laurentius (Talk | contribs | block)β€Ž . . (3,768 bytes) (-18)β€Ž . . (prova) (undo)
(cur | prev) 20:41, 25 March 2012β€Ž Laurentius (Talk | contribs | block)β€Ž . . (3,786 bytes) (+3,786)β€Ž . . (sidebar per soci)