Page MenuHomePhabricator

Error trying to create page on bnwiki: "The revision #0 of the page named "টেমপ্লেট:Arguments" does not exist."
Closed, ResolvedPublic

Description

I'm trying to create Template:Arguments on bnwiki (update: same with টেমপ্লেট:String, টেমপ্লেট:HtmlBuilder, টেমপ্লেট:Citation/CS1). First it says there is an error. When i try to create and click publish, i'm getting edit conflict and Unable to create that page.

I asked about this on enwiki and it was suggested that there might be database corruption or something.

To reproduce:

  1. Go to https://bn.wikipedia.org/wiki/টেমপ্লেট:Arguments
  2. Click "উৎস সম্পাদনা" (edit source), write something (anything)
  3. Click "Publish changes"

Expected result:
You should able to save the edit.

Ectual result:
Unable to save the edit. Edit conflict.

Event Timeline

Thanks for taking the time to report this! Please always follow https://www.mediawiki.org/wiki/How_to_report_a_bug and include error messages here.

https://bn.wikipedia.org/w/index.php?title=টেমপ্লেট:Arguments&action=edit&uselang=en&debug=true says:

The revision #0 of the page named "টেমপ্লেট:Arguments" does not exist.
This is usually caused by following an outdated history link to a page that has been deleted. Details can be found in the deletion log.

Aklapper renamed this task from Error when trying to create "Template:Arguments" on bnwiki to Error trying to create page on bnwiki: "The revision #0 of the page named "টেমপ্লেট:Arguments" does not exist.".May 5 2021, 6:53 AM

@Aklapper This template was never created on bnwiki. There is no deletion log.

Could you please try to create above template on bnwiki? don't worry about content, write anything and try to save it.

(I don't plan to create templates on bnwiki, as I prefer knowing what I'm doing)

@Aklapper Please clarify because I'm not sure if you think this request is a user problem or a database error that needs to be fixed. It is not possible to create
https://bn.wikipedia.org/wiki/Template:Arguments
On visiting the page, "Error" appears where the title should be. On trying to save an edit, an edit conflict error is shown.

It looks like a database error

It has a page ID (363432) created on 9 June 2014. Between the pages before and after being created there is one missing revision (1637537) so it's probably either that revision or it never had any revision ID

It has a page ID (363432) created on 9 June 2014. Between the pages before and after being created there is one missing revision (1637537) so it's probably either that revision or it never had any revision ID

Revision id 1637537 is related to টেমপ্লেট:Resize. See

Taking a quick look at this with T261797: Fix remaining page records with page_latest == 0 in database. in mind:

[samtar@deploy2002 ~]$ mwscript-k8s -f -- attachLatest.php --wiki=bnwiki
⏳ Starting attachLatest.php on Kubernetes as job mw-script.eqiad.yv7y3bzr ...
⏳ Waiting for the container to start...
🚀 Job is running.
📜 Streaming logs:
Looking for pages with page_latest set to 0...
bnwiki 307712 [[মডিউল:Documentation/link box]] can't find latest rev time?!
bnwiki 307744 [[টেমপ্লেট:String]] can't find latest rev time?!
bnwiki 307890 [[টেমপ্লেট:HtmlBuilder]] can't find latest rev time?!
bnwiki 308766 [[টেমপ্লেট:Citation/CS1]] can't find latest rev time?!
bnwiki 308813 [[মডিউল আলাপ:Chart]] can't find latest rev time?!
bnwiki 309843 [[মডিউল:!]] can't find latest rev time?!
bnwiki 310822 [[প্রবেশদ্বার:প্রবেশদ্বার/Module:Error]] can't find latest rev time?!
bnwiki 363432 [[টেমপ্লেট:Arguments]] can't find latest rev time?!
Done! Processed 0 pages.
This was a dry run; rerun with --fix to update page_latest.

so that's not going to help.

Attempting to delete it through MediaWiki rather expectedly failed with [54f6ceac-bd50-47a9-8c0c-de6bbb307b33] 2025-03-19 16:30:25: Fatal exception of type "LogicException" (No revisions for টেমপ্লেট:Arguments?) (logstash)

Next steps would be to try the deleteBatch maintenance script (which I may look at later).
The nukePage script might be another option, but given it has a pretty scary "This script attempts to remove unused entries from the text table, which can cause potential data loss." warning I don't feel comfy touching that at all.

Yeah, what it would actually do is hang forever and make the DB suck. See T22651

Which luckily would mean the data loss didn't happen ...

I'm going to cook up a band-aid patch to at least make it possible in theory to run that script in production ...

Next steps would be to try the deleteBatch maintenance script (which I may look at later).

[samtar@deploy2002 ~]$ cat batchdelete.txt | mwscript-k8s --attach -- deleteBatch.php --wiki=bnwiki --r "[[phab:T281921]]"
⏳ Starting deleteBatch.php on Kubernetes as job mw-script.eqiad.mp9xtqnx ...
⏳ Waiting for the container to start...
🚀 Job is running.
📜 Attached to stdin/stdout:
LogicException from line 529 of /srv/mediawiki/php-1.44.0-wmf.20/includes/page/DeletePage.php: No revisions for টেমপ্লেট:Arguments?
#0 /srv/mediawiki/php-1.44.0-wmf.20/includes/page/DeletePage.php(430): MediaWiki\Page\DeletePage->deleteInternal(Object(WikiPage), 'base', '[[phab:T281921]...')
#1 /srv/mediawiki/php-1.44.0-wmf.20/maintenance/deleteBatch.php(134): MediaWiki\Page\DeletePage->deleteUnsafe('[[phab:T281921]...')
#2 /srv/mediawiki/php-1.44.0-wmf.20/maintenance/includes/MaintenanceRunner.php(695): DeleteBatch->execute()
#3 /srv/mediawiki/php-1.44.0-wmf.20/maintenance/run.php(51): MediaWiki\Maintenance\MaintenanceRunner->run()
#4 /srv/mediawiki/multiversion/MWScript.php(219): require_once('/srv/mediawiki/...')
#5 {main}

No such luck.

Yeah, what it would actually do is hang forever and make the DB suck. See T22651

Which luckily would mean the data loss didn't happen ...

I'm going to cook up a band-aid patch to at least make it possible in theory to run that script in production ...

My interest in getting this resolved is piqued at the moment — let me know how you get on :-)

I've added you as a reviewer to that patch.

In this specific case once that patch is merged and deployed I *think* running nukePage.php to get rid of that page should be harmless, but don't trust me on that - look at the code yourself, test it on local wikis, etc.

In the general case running the nukeFoo.php scripts will leave orphan records behind in the database with the current DB structure, since they haven't been rewritten properly for multi-content revisions. That shouldn't in itself cause any problems, but is worthy of note.

I also discovered T389396 when testing on my local wiki, but that also shouldn't affect production.

The other option is of course running a manual delete from page where page_id=xx SQL query - at least then you know exactly what it will delete ...

if the revision for it exists in production, we can just set the page_latest instead. Give me a second.

There is no logging entry and no revision either:

wikiadmin2023@10.64.32.82(bnwiki)> select * from logging where log_type = 'create' and log_title = 'Arguments' and log_namespace = 10 limit 5;
Empty set (0.001 sec)

wikiadmin2023@10.64.32.82(bnwiki)> select * from page where page_title = 'Arguments';
+---------+----------------+------------+------------------+-------------+----------------+----------------+--------------------+-------------+----------+--------------------+-----------+
| page_id | page_namespace | page_title | page_is_redirect | page_is_new | page_random    | page_touched   | page_links_updated | page_latest | page_len | page_content_model | page_lang |
+---------+----------------+------------+------------------+-------------+----------------+----------------+--------------------+-------------+----------+--------------------+-----------+
|  363432 |             10 | Arguments  |                0 |           1 | 0.181447257172 | 20250319164835 | NULL               |           0 |        0 | wikitext           | NULL      |
|  495941 |            828 | Arguments  |                0 |           1 | 0.621263277933 | 20250312191226 | 20250312191258     |     2113963 |    10427 | Scribunto          | NULL      |
| 1020334 |            829 | Arguments  |                0 |           0 | 0.054886939195 | 20240922172757 | 20240922210545     |     4869020 |      792 | wikitext           | NULL      |
+---------+----------------+------------+------------------+-------------+----------------+----------------+--------------------+-------------+----------+--------------------+-----------+
3 rows in set (0.649 sec)

wikiadmin2023@10.64.32.82(bnwiki)> select * from revision where rev_pa
rev_page       rev_parent_id  
wikiadmin2023@10.64.32.82(bnwiki)> select * from revision where rev_page = 363432;
Empty set (0.001 sec)

wikiadmin2023@10.64.32.82(bnwiki)>

I'd just delete the row

Ladsgroup claimed this task.
Ladsgroup added a project: DBA.
Ladsgroup moved this task from Triage to Done on the DBA board.