Page MenuHomePhabricator

Fatal exception of type "InvalidArgumentException" while undeleting a file on Commons in RevisionStoreRecord.php: The given Title does not belong to page ID 50301569 but actually belongs to 53495560
Closed, DuplicatePublicPRODUCTION ERROR

Description

Hi,

I got [W1L6XgpAMEkAAFEWSvoAAABD] 2018-07-21 09:18:27: Fatal exception of type "InvalidArgumentException" while undeleting this file https://commons.wikimedia.org/w/index.php?title=File:Devendra_Fadnavis.jpg.

I don't know if it is relevant, but this file has many revisions, and I want to undelete only some of them.

2018-07-21 09:18:27 [W1L6XgpAMEkAAFEWSvoAAABD] mw1238 commonswiki 1.32.0-wmf.13 exception ERROR: [W1L6XgpAMEkAAFEWSvoAAABD] /w/index.php?title=Special:Undelete&action=submit   InvalidArgumentException from line 102 of /srv/mediawiki/php-1.32.0-wmf.13/includes/Storage/RevisionStoreRecord.php: The given Title does not belong to page ID 50301569 but actually belongs to 53495560 {"exception_id":"W1L6XgpAMEkAAFEWSvoAAABD","exception_url":"/w/index.php?title=Special:Undelete&action=submit","caught_by":"mwe_handler"} 
[Exception InvalidArgumentException] (/srv/mediawiki/php-1.32.0-wmf.13/includes/Storage/RevisionStoreRecord.php:102) The given Title does not belong to page ID 50301569 but actually belongs to 53495560
  #0 /srv/mediawiki/php-1.32.0-wmf.13/includes/Storage/RevisionStore.php(587): MediaWiki\Storage\RevisionStoreRecord->__construct(Title, User, CommentStoreComment, stdClass, MediaWiki\Storage\RevisionSlots, boolean)
  #1 /srv/mediawiki/php-1.32.0-wmf.13/includes/Storage/RevisionStore.php(477): MediaWiki\Storage\RevisionStore->insertRevisionInternal(MediaWiki\Storage\RevisionArchiveRecord, Wikimedia\Rdbms\DatabaseMysqli, User, CommentStoreComment, Title, integer, integer)
  #2 /srv/mediawiki/php-1.32.0-wmf.13/includes/libs/rdbms/database/Database.php(3731): Closure$MediaWiki\Storage\RevisionStore::insertRevisionOn(Wikimedia\Rdbms\DatabaseMysqli, string)
  #3 /srv/mediawiki/php-1.32.0-wmf.13/includes/Storage/RevisionStore.php(479): Wikimedia\Rdbms\Database->doAtomicSection(string, Closure$MediaWiki\Storage\RevisionStore::insertRevisionOn;1462)
  #4 /srv/mediawiki/php-1.32.0-wmf.13/includes/page/PageArchive.php(776): MediaWiki\Storage\RevisionStore->insertRevisionOn(MediaWiki\Storage\RevisionArchiveRecord, Wikimedia\Rdbms\DatabaseMysqli)
  #5 /srv/mediawiki/php-1.32.0-wmf.13/includes/page/PageArchive.php(506): PageArchive->undeleteRevisions(array, boolean, string)
  #6 /srv/mediawiki/php-1.32.0-wmf.13/includes/specials/SpecialUndelete.php(1147): PageArchive->undelete(array, string, array, boolean, User)
  #7 /srv/mediawiki/php-1.32.0-wmf.13/includes/specials/SpecialUndelete.php(201): SpecialUndelete->undelete()
  #8 /srv/mediawiki/php-1.32.0-wmf.13/includes/specialpage/SpecialPage.php(566): SpecialUndelete->execute(NULL)
  #9 /srv/mediawiki/php-1.32.0-wmf.13/includes/specialpage/SpecialPageFactory.php(569): SpecialPage->run(NULL)
  #10 /srv/mediawiki/php-1.32.0-wmf.13/includes/MediaWiki.php(288): SpecialPageFactory::executePath(Title, RequestContext)
  #11 /srv/mediawiki/php-1.32.0-wmf.13/includes/MediaWiki.php(867): MediaWiki->performRequest()
  #12 /srv/mediawiki/php-1.32.0-wmf.13/includes/MediaWiki.php(524): MediaWiki->main()
  #13 /srv/mediawiki/php-1.32.0-wmf.13/index.php(42): MediaWiki->run()
  #14 /srv/mediawiki/w/index.php(3): include(string)
  #15 {main}

Event Timeline

Again the second time

[W1L8ZwpAMFkAAB6WGGIAAAAP] 2018-07-21 09:27:03: Fatal exception of type "InvalidArgumentException"

JS Console

JQMIGRATE: Migrate is installed with logging active, version 3.0.1
VM281:111 This page is using the deprecated ResourceLoader module "jquery.ui.widget".
(anonymous) @ VM281:111
runScript @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:93
checkCssHandles @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:93
execute @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:94
implement @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:100
(anonymous) @ VM281:111
domEval @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:91
(anonymous) @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:97
requestIdleCallback (async)
asyncEval @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:97
work @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:98
enqueue @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:92
load @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:101
(anonymous) @ index.php?title=Special:Undelete&action=submit:9
startUp @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:82
script.onload @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:105
load (async)
(anonymous) @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:105
(anonymous) @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:105
VM281:215 This page is using the deprecated ResourceLoader module "jquery.ui.position".
(anonymous) @ VM281:215
runScript @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:93
checkCssHandles @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:93
execute @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:94
implement @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:100
(anonymous) @ VM281:215
domEval @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:91
(anonymous) @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:97
requestIdleCallback (async)
asyncEval @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:97
work @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:98
enqueue @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:92
load @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:101
(anonymous) @ index.php?title=Special:Undelete&action=submit:9
startUp @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:82
script.onload @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:105
load (async)
(anonymous) @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:105
(anonymous) @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:105
VM281:630 This page is using the deprecated ResourceLoader module "mediawiki.api.options".
Use "mediawiki.api" instead.
(anonymous) @ VM281:630
runScript @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:93
checkCssHandles @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:93
execute @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:94
implement @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:100
(anonymous) @ VM281:630
domEval @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:91
(anonymous) @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:97
requestIdleCallback (async)
asyncEval @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:97
work @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:98
enqueue @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:92
load @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:101
(anonymous) @ index.php?title=Special:Undelete&action=submit:9
startUp @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:82
script.onload @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:105
load (async)
(anonymous) @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:105
(anonymous) @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:105
VM281:106 This page is using the deprecated ResourceLoader module "jquery.ui.core".
Please use OOUI instead.
(anonymous) @ VM281:106
runScript @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:93
checkCssHandles @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:93
execute @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:94
handlePending @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:89
markModuleReady @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:92
runScript @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:93
checkCssHandles @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:93
(anonymous) @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:93
fireCallbacks @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:87
addEmbeddedCSS @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:87
(anonymous) @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:87
requestAnimationFrame (async)
addEmbeddedCSS @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:87
execute @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:94
implement @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:100
(anonymous) @ VM281:52
domEval @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:91
(anonymous) @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:97
requestIdleCallback (async)
asyncEval @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:97
work @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:98
enqueue @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:92
load @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:101
(anonymous) @ index.php?title=Special:Undelete&action=submit:9
startUp @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:82
script.onload @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:105
load (async)
(anonymous) @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:105
(anonymous) @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:105
load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:85 Use of "wgAction" is deprecated. Use mw.config instead.
get @ load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:85
(anonymous) @ index.php?title=User:Dschwen/MegapixelDisplay.js&action=raw&ctype=text/javascript:15
load.php?debug=false&lang=en&modules=startup&only=scripts&skin=monobook:85 Use of "wgNamespaceNumber" is deprecated. Use mw.config instead.

Again

[W1MAqQpAMFgAAI6gJKYAAABP] 2018-07-21 09:45:17: Fatal exception of type "InvalidArgumentException"

with another file

https://commons.wikimedia.org/w/index.php?title=File:Ramdas_Athawale.jpg

https://commons.wikimedia.org/w/index.php?title=File:Devendra_Fadnavis.jpg

Error undeleting page
Errors were encountered while undeleting the file:

    A non-identical file already exists at "mwstore://local-swift-eqiad/local-public/f/f2/Devendra_Fadnavis.jpg".
    A non-identical file already exists at "mwstore://local-swift-codfw/local-public/f/f2/Devendra_Fadnavis.jpg".

Does this suggest that the file was not properly deleted?
(attempted to restore ALL revisions)

https://commons.wikimedia.org/w/index.php?title=File:Devendra_Fadnavis.jpg

Error undeleting page
Errors were encountered while undeleting the file:

    A non-identical file already exists at "mwstore://local-swift-eqiad/local-public/f/f2/Devendra_Fadnavis.jpg".
    A non-identical file already exists at "mwstore://local-swift-codfw/local-public/f/f2/Devendra_Fadnavis.jpg".

Does this suggest that the file was not properly deleted?
(attempted to restore ALL revisions)

Problem seens to be with file versions dated: 2016-11-25T06:28:40 & 2016-07-23T17:07:44 : they cannot be viewed.

Problem seens to be with file versions dated: 2016-11-25T06:28:40 & 2016-07-23T17:07:44 : they cannot be viewed.

After restoring 2016-11-25T06:28:40 problem viewing this version has disappeared.
However, restoring 2016-07-23T17:07:44 seems to result in restoring rescalled version of 2016-11-25T06:28:40 (with metadata of 2016-07-23T17:07:44 ?)
The effect is similar to the one observed in T198177

2017-12-31T16:38:47 can be viewed, but cannot be restored.

(This and my above comments concern https://commons.wikimedia.org/w/index.php?title=File:Devendra_Fadnavis.jpg image)

Again when trying to restore old revisions of https://commons.wikimedia.org/wiki/File:Raghubar_Das.jpg

[W1MLQwpAAEUAAB0CyRQAAABN] 2018-07-21 10:30:34: Fatal exception of type "InvalidArgumentException"

Again when trying to restore old revisions of https://commons.wikimedia.org/wiki/File:Raghubar_Das.jpg

[W1MLQwpAAEUAAB0CyRQAAABN] 2018-07-21 10:30:34: Fatal exception of type "InvalidArgumentException"

I confirm: same result when attempting to undelete any earlier version of this image.

Krenair subscribed.

The next step here is to get someone to dig up the stack trace, I don't see anything here needing escalation all the way to ops.

2018-07-21 09:18:27 [W1L6XgpAMEkAAFEWSvoAAABD] mw1238 commonswiki 1.32.0-wmf.13 exception ERROR: [W1L6XgpAMEkAAFEWSvoAAABD] /w/index.php?title=Special:Undelete&action=submit   InvalidArgumentException from line 102 of /srv/mediawiki/php-1.32.0-wmf.13/includes/Storage/RevisionStoreRecord.php: The given Title does not belong to page ID 50301569 but actually belongs to 53495560 {"exception_id":"W1L6XgpAMEkAAFEWSvoAAABD","exception_url":"/w/index.php?title=Special:Undelete&action=submit","caught_by":"mwe_handler"} 
[Exception InvalidArgumentException] (/srv/mediawiki/php-1.32.0-wmf.13/includes/Storage/RevisionStoreRecord.php:102) The given Title does not belong to page ID 50301569 but actually belongs to 53495560
  #0 /srv/mediawiki/php-1.32.0-wmf.13/includes/Storage/RevisionStore.php(587): MediaWiki\Storage\RevisionStoreRecord->__construct(Title, User, CommentStoreComment, stdClass, MediaWiki\Storage\RevisionSlots, boolean)
  #1 /srv/mediawiki/php-1.32.0-wmf.13/includes/Storage/RevisionStore.php(477): MediaWiki\Storage\RevisionStore->insertRevisionInternal(MediaWiki\Storage\RevisionArchiveRecord, Wikimedia\Rdbms\DatabaseMysqli, User, CommentStoreComment, Title, integer, integer)
  #2 /srv/mediawiki/php-1.32.0-wmf.13/includes/libs/rdbms/database/Database.php(3731): Closure$MediaWiki\Storage\RevisionStore::insertRevisionOn(Wikimedia\Rdbms\DatabaseMysqli, string)
  #3 /srv/mediawiki/php-1.32.0-wmf.13/includes/Storage/RevisionStore.php(479): Wikimedia\Rdbms\Database->doAtomicSection(string, Closure$MediaWiki\Storage\RevisionStore::insertRevisionOn;1462)
  #4 /srv/mediawiki/php-1.32.0-wmf.13/includes/page/PageArchive.php(776): MediaWiki\Storage\RevisionStore->insertRevisionOn(MediaWiki\Storage\RevisionArchiveRecord, Wikimedia\Rdbms\DatabaseMysqli)
  #5 /srv/mediawiki/php-1.32.0-wmf.13/includes/page/PageArchive.php(506): PageArchive->undeleteRevisions(array, boolean, string)
  #6 /srv/mediawiki/php-1.32.0-wmf.13/includes/specials/SpecialUndelete.php(1147): PageArchive->undelete(array, string, array, boolean, User)
  #7 /srv/mediawiki/php-1.32.0-wmf.13/includes/specials/SpecialUndelete.php(201): SpecialUndelete->undelete()
  #8 /srv/mediawiki/php-1.32.0-wmf.13/includes/specialpage/SpecialPage.php(566): SpecialUndelete->execute(NULL)
  #9 /srv/mediawiki/php-1.32.0-wmf.13/includes/specialpage/SpecialPageFactory.php(569): SpecialPage->run(NULL)
  #10 /srv/mediawiki/php-1.32.0-wmf.13/includes/MediaWiki.php(288): SpecialPageFactory::executePath(Title, RequestContext)
  #11 /srv/mediawiki/php-1.32.0-wmf.13/includes/MediaWiki.php(867): MediaWiki->performRequest()
  #12 /srv/mediawiki/php-1.32.0-wmf.13/includes/MediaWiki.php(524): MediaWiki->main()
  #13 /srv/mediawiki/php-1.32.0-wmf.13/index.php(42): MediaWiki->run()
  #14 /srv/mediawiki/w/index.php(3): include(string)
  #15 {main}
Reedy triaged this task as Medium priority.Jul 21 2018, 2:07 PM
Reedy updated the task description. (Show Details)
Reedy added a subscriber: daniel.
Aklapper renamed this task from Fatal exception of type "InvalidArgumentException" while undeleting a file on Commons to Fatal exception of type "InvalidArgumentException" while undeleting a file on Commons in RevisionStoreRecord.php: The given Title does not belong to page ID 50301569 but actually belongs to 53495560.Jul 21 2018, 4:01 PM

Again with 2 files:
[W1cFVwpAMEsAAGqc4ZYAAAAV] 2018-07-24 10:54:21: Fatal exception of type "InvalidArgumentException"
for https://commons.wikimedia.org/w/index.php?title=File:Pillar_birojs.jpg

[W1cGkQpAIEIAAGq3RSUAAAAO] 2018-07-24 10:59:34: Fatal exception of type "InvalidArgumentException"
for https://commons.wikimedia.org/w/index.php?title=File:Luminor.jpg

This is a serious issue. It seems there are files lost. I suggest to raise the priority.

Also at https://commons.wikimedia.org/wiki/File:TechHubRiga.jpg where the first revision is gone:

[W1Ye3wpAMFIAAIXBMNIAAABJ] 2018-07-23 18:30:56: Fatal exception of type "InvalidArgumentException"

Reedy raised the priority of this task from Medium to High.Jul 24 2018, 12:42 PM

Apparently this is not a regular outage that would affect all files with multiple uploads. See https://commons.wikimedia.org/wiki/File:T200121-1.png for example which I could delete and successfully undelete.

Now, I could undelete all the files mentioned above.

OK, so this might be closed, but I would like an explanation for the cause...

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:09 PM