Page MenuHomePhabricator

Duplicator extension throws error Call to a member function getId() on null
Open, MediumPublic

Description

At https://tools.wmflabs.org/zoranzoki21wiki/wiki I installed Duplicator extension for testing purposes and working on T212044. But when I want to test it, I get this:

[075522b861dc33588932ee2e] /zoranzoki21wiki/wiki/index.php?title=%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%BE:Duplicator Error from line 1373 of /data/project/zoranzoki21wiki/public_html/wiki/includes/page/WikiPage.php: Call to a member function getId() on null

Backtrace:

#0 /data/project/zoranzoki21wiki/public_html/wiki/includes/page/Article.php(2798): WikiPage->updateRevisionOn(Wikimedia\Rdbms\DatabaseMysqli, NULL, NULL, NULL)
#1 /data/project/zoranzoki21wiki/public_html/wiki/extensions/Duplicator/Duplicator.page.php(335): Article->updateRevisionOn(Wikimedia\Rdbms\DatabaseMysqli, NULL)
#2 /data/project/zoranzoki21wiki/public_html/wiki/extensions/Duplicator/Duplicator.page.php(115): SpecialDuplicator->duplicate(Title, Title, boolean)
#3 /data/project/zoranzoki21wiki/public_html/wiki/includes/specialpage/SpecialPage.php(569): SpecialDuplicator->execute(NULL)
#4 /data/project/zoranzoki21wiki/public_html/wiki/includes/specialpage/SpecialPageFactory.php(558): SpecialPage->run(NULL)
#5 /data/project/zoranzoki21wiki/public_html/wiki/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#6 /data/project/zoranzoki21wiki/public_html/wiki/includes/MediaWiki.php(862): MediaWiki->performRequest()
#7 /data/project/zoranzoki21wiki/public_html/wiki/includes/MediaWiki.php(517): MediaWiki->main()
#8 /data/project/zoranzoki21wiki/public_html/wiki/index.php(42): MediaWiki->run()
#9 {main}

This happening and when I use fresh copy from gerrit and from my patch https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/Duplicator/+/481949/

MediaWiki version:
MediaWiki 1.33.0-alpha (311b203)
PHP 7.2.8-1+0~20180725124257.2+stretch~1.gbp571e56 (cgi-fcgi)
MariaDB 10.0.34-MariaDB
ICU 57.1

Event Timeline

Errors from this extension in the MediaWiki 1.36.

dberror.log
Tue Dec 1 0:20:17 GMT 2020      fw-cpanel01.fyfeweb.com kizuletk_wiki2-mw       Error 1054 from SpecialDuplicator::duplicate, Unknown column 'rev_text_id' in 'field list' (localhost) INSERT INTO `mwrevision` (rev_page,rev_text_id,rev_comment,rev_user,rev_user_text,rev_timestamp,rev_minor_edit,rev_deleted) VALUES (3,NULL,'Копирано са [[Test page]], измена [[4]]',NULL,NULL,'20201111140731','0','0') localhost
#0 /home/kizuletk/public_html/wiki.kizule.ga/includes/libs/rdbms/database/Database.php(1658): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, integer, string, string)
#1 /home/kizuletk/public_html/wiki.kizule.ga/includes/libs/rdbms/database/Database.php(1227): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string,string, boolean)
#2 /home/kizuletk/public_html/wiki.kizule.ga/includes/libs/rdbms/database/Database.php(2343): Wikimedia\Rdbms\Database->query(string, string, integer)
#3 /home/kizuletk/public_html/wiki.kizule.ga/includes/libs/rdbms/database/Database.php(2323): Wikimedia\Rdbms\Database->doInsert(string, array, string)
#4 /home/kizuletk/public_html/wiki.kizule.ga/includes/libs/rdbms/database/DBConnRef.php(68): Wikimedia\Rdbms\Database->insert(string, array, string)
#5 /home/kizuletk/public_html/wiki.kizule.ga/includes/libs/rdbms/database/DBConnRef.php(369): Wikimedia\Rdbms\DBConnRef->__call(string, array)
#6 /home/kizuletk/public_html/wiki.kizule.ga/extensions/Duplicator/Duplicator.page.php(324): Wikimedia\Rdbms\DBConnRef->insert(string, array, string)
#7 /home/kizuletk/public_html/wiki.kizule.ga/extensions/Duplicator/Duplicator.page.php(114): SpecialDuplicator->duplicate(Title, Title, boolean)
#8 /home/kizuletk/public_html/wiki.kizule.ga/includes/specialpage/SpecialPage.php(607): SpecialDuplicator->execute(NULL)
#9 /home/kizuletk/public_html/wiki.kizule.ga/includes/specialpage/SpecialPageFactory.php(1183): SpecialPage->run(NULL)
#10 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(310): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#11 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(943): MediaWiki->performRequest()
#12 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(546): MediaWiki->main()
#13 /home/kizuletk/public_html/wiki.kizule.ga/index.php(53): MediaWiki->run()
#14 /home/kizuletk/public_html/wiki.kizule.ga/index.php(46): wfIndexMain()
#15 {main}
error.log
Tue Dec 1 0:20:17 GMT 2020      fw-cpanel01.fyfeweb.com kizuletk_wiki2-mw       Error 1054 from SpecialDuplicator::duplicate, Unknown column 'rev_text_id' in 'field list' (localhost) INSERT INTO `mwrevision` (rev_page,rev_text_id,rev_comment,rev_user,rev_user_text,rev_timestamp,rev_minor_edit,rev_deleted) VALUES (3,NULL,'Копирано са [[Test page]], измена [[4]]',NULL,NULL,'20201111140731','0','0') localhost
#0 /home/kizuletk/public_html/wiki.kizule.ga/includes/libs/rdbms/database/Database.php(1658): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, integer, string, string)
#1 /home/kizuletk/public_html/wiki.kizule.ga/includes/libs/rdbms/database/Database.php(1227): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string,string, boolean)
#2 /home/kizuletk/public_html/wiki.kizule.ga/includes/libs/rdbms/database/Database.php(2343): Wikimedia\Rdbms\Database->query(string, string, integer)
#3 /home/kizuletk/public_html/wiki.kizule.ga/includes/libs/rdbms/database/Database.php(2323): Wikimedia\Rdbms\Database->doInsert(string, array, string)
#4 /home/kizuletk/public_html/wiki.kizule.ga/includes/libs/rdbms/database/DBConnRef.php(68): Wikimedia\Rdbms\Database->insert(string, array, string)
#5 /home/kizuletk/public_html/wiki.kizule.ga/includes/libs/rdbms/database/DBConnRef.php(369): Wikimedia\Rdbms\DBConnRef->__call(string, array)
#6 /home/kizuletk/public_html/wiki.kizule.ga/extensions/Duplicator/Duplicator.page.php(324): Wikimedia\Rdbms\DBConnRef->insert(string, array, string)
#7 /home/kizuletk/public_html/wiki.kizule.ga/extensions/Duplicator/Duplicator.page.php(114): SpecialDuplicator->duplicate(Title, Title, boolean)
#8 /home/kizuletk/public_html/wiki.kizule.ga/includes/specialpage/SpecialPage.php(607): SpecialDuplicator->execute(NULL)
#9 /home/kizuletk/public_html/wiki.kizule.ga/includes/specialpage/SpecialPageFactory.php(1183): SpecialPage->run(NULL)
#10 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(310): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#11 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(943): MediaWiki->performRequest()
#12 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(546): MediaWiki->main()
#13 /home/kizuletk/public_html/wiki.kizule.ga/index.php(53): MediaWiki->run()
#14 /home/kizuletk/public_html/wiki.kizule.ga/index.php(46): wfIndexMain()
#15 {main}
[kizuletk@fw-cpanel01 wiki.kizule.ga]$ cat /tmp/mediawiki/error.log
2020-12-01 00:20:17 fw-cpanel01.fyfeweb.com kizuletk_wiki2-mw: [83214dde9f5e359227b7e727] /index.php/%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%BE:Duplicator   ErrorException from line 303 of /home/kizuletk/public_html/wiki.kizule.ga/extensions/Duplicator/Duplicator.page.php: Use of Article::insertOn was deprecated in MediaWiki 1.35. [Called from SpecialDuplicator::duplicate]
#0 [internal function]: MWExceptionHandler::handleError(integer, string, string, string, array)
#1 /home/kizuletk/public_html/wiki.kizule.ga/includes/debug/MWDebug.php(329): trigger_error(string, integer)
#2 /home/kizuletk/public_html/wiki.kizule.ga/includes/debug/MWDebug.php(303): MWDebug::sendRawDeprecated(string, boolean, string)
#3 /home/kizuletk/public_html/wiki.kizule.ga/includes/debug/MWDebug.php(234): MWDebug::deprecatedMsg(string, string, string, integer)
#4 /home/kizuletk/public_html/wiki.kizule.ga/includes/GlobalFunctions.php(1029): MWDebug::deprecated(string, string, string, integer)
#5 /home/kizuletk/public_html/wiki.kizule.ga/includes/page/Article.php(2752): wfDeprecated(string, string)
#6 /home/kizuletk/public_html/wiki.kizule.ga/extensions/Duplicator/Duplicator.page.php(303): Article->insertOn(Wikimedia\Rdbms\MaintainableDBConnRef)
#7 /home/kizuletk/public_html/wiki.kizule.ga/extensions/Duplicator/Duplicator.page.php(114): SpecialDuplicator->duplicate(Title, Title, boolean)
#8 /home/kizuletk/public_html/wiki.kizule.ga/includes/specialpage/SpecialPage.php(607): SpecialDuplicator->execute(NULL)
#9 /home/kizuletk/public_html/wiki.kizule.ga/includes/specialpage/SpecialPageFactory.php(1183): SpecialPage->run(NULL)
#10 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(310): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#11 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(943): MediaWiki->performRequest()
#12 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(546): MediaWiki->main()
#13 /home/kizuletk/public_html/wiki.kizule.ga/index.php(53): MediaWiki->run()
#14 /home/kizuletk/public_html/wiki.kizule.ga/index.php(46): wfIndexMain()
#15 {main}
2020-12-01 00:20:17 fw-cpanel01.fyfeweb.com kizuletk_wiki2-mw: [83214dde9f5e359227b7e727] /index.php/%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%BE:Duplicator   ErrorException from line 317 of /home/kizuletk/public_html/wiki.kizule.ga/extensions/Duplicator/Duplicator.page.php: PHP Notice: Undefined property: stdClass::$rev_text_id
#0 /home/kizuletk/public_html/wiki.kizule.ga/extensions/Duplicator/Duplicator.page.php(317): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /home/kizuletk/public_html/wiki.kizule.ga/extensions/Duplicator/Duplicator.page.php(114): SpecialDuplicator->duplicate(Title, Title, boolean)
#2 /home/kizuletk/public_html/wiki.kizule.ga/includes/specialpage/SpecialPage.php(607): SpecialDuplicator->execute(NULL)
#3 /home/kizuletk/public_html/wiki.kizule.ga/includes/specialpage/SpecialPageFactory.php(1183): SpecialPage->run(NULL)
#4 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(310): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#5 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(943): MediaWiki->performRequest()
#6 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(546): MediaWiki->main()
#7 /home/kizuletk/public_html/wiki.kizule.ga/index.php(53): MediaWiki->run()
#8 /home/kizuletk/public_html/wiki.kizule.ga/index.php(46): wfIndexMain()
#9 {main}
2020-12-01 00:20:17 fw-cpanel01.fyfeweb.com kizuletk_wiki2-mw: [83214dde9f5e359227b7e727] /index.php/%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%BE:Duplicator   ErrorException from line 319 of /home/kizuletk/public_html/wiki.kizule.ga/extensions/Duplicator/Duplicator.page.php: PHP Notice: Undefined property: stdClass::$rev_user
#0 /home/kizuletk/public_html/wiki.kizule.ga/extensions/Duplicator/Duplicator.page.php(319): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /home/kizuletk/public_html/wiki.kizule.ga/extensions/Duplicator/Duplicator.page.php(114): SpecialDuplicator->duplicate(Title, Title, boolean)
#2 /home/kizuletk/public_html/wiki.kizule.ga/includes/specialpage/SpecialPage.php(607): SpecialDuplicator->execute(NULL)
#3 /home/kizuletk/public_html/wiki.kizule.ga/includes/specialpage/SpecialPageFactory.php(1183): SpecialPage->run(NULL)
#4 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(310): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#5 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(943): MediaWiki->performRequest()
#6 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(546): MediaWiki->main()
#7 /home/kizuletk/public_html/wiki.kizule.ga/index.php(53): MediaWiki->run()
#8 /home/kizuletk/public_html/wiki.kizule.ga/index.php(46): wfIndexMain()
#9 {main}
2020-12-01 00:20:17 fw-cpanel01.fyfeweb.com kizuletk_wiki2-mw: [83214dde9f5e359227b7e727] /index.php/%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%BE:Duplicator   ErrorException from line 320 of /home/kizuletk/public_html/wiki.kizule.ga/extensions/Duplicator/Duplicator.page.php: PHP Notice: Undefined property: stdClass::$rev_user_text
#0 /home/kizuletk/public_html/wiki.kizule.ga/extensions/Duplicator/Duplicator.page.php(320): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /home/kizuletk/public_html/wiki.kizule.ga/extensions/Duplicator/Duplicator.page.php(114): SpecialDuplicator->duplicate(Title, Title, boolean)
#2 /home/kizuletk/public_html/wiki.kizule.ga/includes/specialpage/SpecialPage.php(607): SpecialDuplicator->execute(NULL)
#3 /home/kizuletk/public_html/wiki.kizule.ga/includes/specialpage/SpecialPageFactory.php(1183): SpecialPage->run(NULL)
#4 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(310): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#5 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(943): MediaWiki->performRequest()
#6 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(546): MediaWiki->main()
#7 /home/kizuletk/public_html/wiki.kizule.ga/index.php(53): MediaWiki->run()
#8 /home/kizuletk/public_html/wiki.kizule.ga/index.php(46): wfIndexMain()
#9 {main}

Change 644546 had a related patch set uploaded (by Zoranzoki21; owner: Zoranzoki21):
[mediawiki/extensions/Duplicator@master] Make extension compatible with the current content of revision table

https://gerrit.wikimedia.org/r/644546

Change 644546 had a related patch set uploaded (by Zoranzoki21; owner: Zoranzoki21):
[mediawiki/extensions/Duplicator@master] Make extension compatible with the current content of revision table

https://gerrit.wikimedia.org/r/644546

I think that I'm on good way to make extension works again. But I need help with fixing "duplicate entry".

dberror.log
Tue Dec 1 16:15:19 GMT 2020     fw-cpanel01.fyfeweb.com kizuletk_wiki2-mw       Error 1062 from SpecialDuplicator::duplicate, Duplicate entry '4' for key 'PRIMARY' (localhost) INSERT INTO `mwrevision` (rev_id,rev_page,rev_comment_id,rev_actor,rev_timestamp,rev_minor_edit,rev_deleted,rev_len,rev_parent_id,rev_sha1) VALUES ('4',7,'0','0','20201111140731','0','0','703',NULL,'n7v40tmajt7hyugzg481vuk0ahry8c4') localhost
#0 /home/kizuletk/public_html/wiki.kizule.ga/includes/libs/rdbms/database/Database.php(1658): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, integer, string, string)
#1 /home/kizuletk/public_html/wiki.kizule.ga/includes/libs/rdbms/database/Database.php(1227): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string,string, boolean)
#2 /home/kizuletk/public_html/wiki.kizule.ga/includes/libs/rdbms/database/Database.php(2343): Wikimedia\Rdbms\Database->query(string, string, integer)
#3 /home/kizuletk/public_html/wiki.kizule.ga/includes/libs/rdbms/database/Database.php(2323): Wikimedia\Rdbms\Database->doInsert(string, array, string)
#4 /home/kizuletk/public_html/wiki.kizule.ga/includes/libs/rdbms/database/DBConnRef.php(68): Wikimedia\Rdbms\Database->insert(string, array, string)
#5 /home/kizuletk/public_html/wiki.kizule.ga/includes/libs/rdbms/database/DBConnRef.php(369): Wikimedia\Rdbms\DBConnRef->__call(string, array)
#6 /home/kizuletk/public_html/wiki.kizule.ga/extensions/Duplicator/Duplicator.page.php(326): Wikimedia\Rdbms\DBConnRef->insert(string, array, string)
#7 /home/kizuletk/public_html/wiki.kizule.ga/extensions/Duplicator/Duplicator.page.php(114): SpecialDuplicator->duplicate(Title, Title, boolean)
#8 /home/kizuletk/public_html/wiki.kizule.ga/includes/specialpage/SpecialPage.php(607): SpecialDuplicator->execute(NULL)
#9 /home/kizuletk/public_html/wiki.kizule.ga/includes/specialpage/SpecialPageFactory.php(1183): SpecialPage->run(NULL)
#10 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(310): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#11 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(943): MediaWiki->performRequest()
#12 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(546): MediaWiki->main()
#13 /home/kizuletk/public_html/wiki.kizule.ga/index.php(53): MediaWiki->run()
#14 /home/kizuletk/public_html/wiki.kizule.ga/index.php(46): wfIndexMain()
#15 {main}
error.log
2020-12-01 16:15:19 fw-cpanel01.fyfeweb.com kizuletk_wiki2-mw: [fee28d9e41d751ad85036185] /index.php/%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%BE:Duplicator   ErrorException from line 303 of /home/kizuletk/public_html/wiki.kizule.ga/extensions/Duplicator/Duplicator.page.php: Use of Article::insertOn was deprecated in MediaWiki 1.35. [Called from SpecialDuplicator::duplicate]
#0 [internal function]: MWExceptionHandler::handleError(integer, string, string, string, array)
#1 /home/kizuletk/public_html/wiki.kizule.ga/includes/debug/MWDebug.php(329): trigger_error(string, integer)
#2 /home/kizuletk/public_html/wiki.kizule.ga/includes/debug/MWDebug.php(303): MWDebug::sendRawDeprecated(string, boolean, string)
#3 /home/kizuletk/public_html/wiki.kizule.ga/includes/debug/MWDebug.php(234): MWDebug::deprecatedMsg(string, string, string, integer)
#4 /home/kizuletk/public_html/wiki.kizule.ga/includes/GlobalFunctions.php(1029): MWDebug::deprecated(string, string, string, integer)
#5 /home/kizuletk/public_html/wiki.kizule.ga/includes/page/Article.php(2752): wfDeprecated(string, string)
#6 /home/kizuletk/public_html/wiki.kizule.ga/extensions/Duplicator/Duplicator.page.php(303): Article->insertOn(Wikimedia\Rdbms\MaintainableDBConnRef)
#7 /home/kizuletk/public_html/wiki.kizule.ga/extensions/Duplicator/Duplicator.page.php(114): SpecialDuplicator->duplicate(Title, Title, boolean)
#8 /home/kizuletk/public_html/wiki.kizule.ga/includes/specialpage/SpecialPage.php(607): SpecialDuplicator->execute(NULL)
#9 /home/kizuletk/public_html/wiki.kizule.ga/includes/specialpage/SpecialPageFactory.php(1183): SpecialPage->run(NULL)
#10 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(310): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#11 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(943): MediaWiki->performRequest()
#12 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(546): MediaWiki->main()
#13 /home/kizuletk/public_html/wiki.kizule.ga/index.php(53): MediaWiki->run()
#14 /home/kizuletk/public_html/wiki.kizule.ga/index.php(46): wfIndexMain()
#15 {main}
2020-12-01 16:15:19 fw-cpanel01.fyfeweb.com kizuletk_wiki2-mw: [fee28d9e41d751ad85036185] /index.php/%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%BE:Duplicator   ErrorException from line 324 of /home/kizuletk/public_html/wiki.kizule.ga/extensions/Duplicator/Duplicator.page.php: PHP Notice: Undefined property: stdClass::$row_parent_id
#0 /home/kizuletk/public_html/wiki.kizule.ga/extensions/Duplicator/Duplicator.page.php(324): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /home/kizuletk/public_html/wiki.kizule.ga/extensions/Duplicator/Duplicator.page.php(114): SpecialDuplicator->duplicate(Title, Title, boolean)
#2 /home/kizuletk/public_html/wiki.kizule.ga/includes/specialpage/SpecialPage.php(607): SpecialDuplicator->execute(NULL)
#3 /home/kizuletk/public_html/wiki.kizule.ga/includes/specialpage/SpecialPageFactory.php(1183): SpecialPage->run(NULL)
#4 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(310): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#5 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(943): MediaWiki->performRequest()
#6 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(546): MediaWiki->main()
#7 /home/kizuletk/public_html/wiki.kizule.ga/index.php(53): MediaWiki->run()
#8 /home/kizuletk/public_html/wiki.kizule.ga/index.php(46): wfIndexMain()
#9 {main}

I made patch with using content of the revision table on Toolforge:

MariaDB [srwiki_p]> SELECT * FROM revision LIMIT 10;
+--------+----------+----------------+-----------+----------------+----------------+-------------+---------+---------------+---------------------------------+
| rev_id | rev_page | rev_comment_id | rev_actor | rev_timestamp  | rev_minor_edit | rev_deleted | rev_len | rev_parent_id | rev_sha1                        |
+--------+----------+----------------+-----------+----------------+----------------+-------------+---------+---------------+---------------------------------+
|      1 |   196554 |         983243 |    252329 | 20030216205245 |              0 |           0 |     589 |
 0 | eb85zbde8xzz6nmuapm92su3eurs8bl |
|      2 |   196554 |             11 |    252330 | 20030224053913 |              0 |           0 |     596 |
 1 | rdzq34fo4d0yfr86wqm01lczspnj1i3 |
|      3 |   196554 |             11 |    252331 | 20030422203141 |              0 |           0 |     706 |
 2 | 6vy856qhgk0r8e1cfenwjixxegop92t |
|      4 |   196554 |             11 |    252331 | 20030422203450 |              0 |           0 |     854 |
 3 | l4ke3icsd2f3548gqz02g66rkfe8486 |
|      5 |   196554 |             11 |      2813 | 20030524072852 |              0 |           0 |     899 |
 4 | 1fts6gt9g9f2slceu255j2gszxzbxo4 |
|      6 |   196554 |         983244 |    252332 | 20030602103133 |              0 |           0 |     894 |
 5 | fmim4a7ree7rjac1isg9qkfxdjkgchn |
|      7 |        6 |         983245 |     16115 | 20030626010319 |              0 |           0 |     132 |
 0 | iajete28ncdsn7zdujv04nmyvx3bjk2 |
|      8 |   196554 |         983246 |    252333 | 20030602192701 |              0 |           0 |     889 |
 6 | c0fndrxrlvftxitm6dfpzncz0aav9v2 |
|      9 |   196554 |             11 |     16115 | 20030626011225 |              0 |           0 |     837 |
 8 | fcibe46v9eem8nr5ig88nx1spj8kakr |
|     10 |   196554 |             11 |     16115 | 20030626011604 |              1 |           0 |     889 |
 9 | cl9g6kso6d7qowp8wkpy6zwiazezy3o |
+--------+----------+----------------+-----------+----------------+----------------+-------------+---------+---------------+---------------------------------+
10 rows in set (0.00 sec)

MariaDB [srwiki_p]>

Thanks Kizule, I looked into fixing the extension in T268957 with that technique, but I think the issue lies in the revision now referencing the actor table (see this talk for an explanation).

In order for revisions to be duplicated, their actor information needs to be copied also. Someone with better comprehension of how this whole system works could provide us with some pointers. Maybe some committer to the MediaWiki core?

Kizule triaged this task as Medium priority.Dec 2 2020, 8:25 PM

Hello @Tinss. Yup, explanation from someone who knows more about "actor migration", would be great.

This has nothing to do with actor migration. You are trying to give two revisions the same revision ID, which doesn't work. (Actual actor migration doesn't need to be handled, as you can just blindly copy rev_actor from the old revision row in a similar way to how Duplicator pre-migration blindly copied rev_user and rev_user_text).

This has nothing to do with actor migration. You are trying to give two revisions the same revision ID, which doesn't work. (Actual actor migration doesn't need to be handled, as you can just blindly copy rev_actor from the old revision row in a similar way to how Duplicator pre-migration blindly copied rev_user and rev_user_text).

Yup, this makes sense, but I'm not sure how to fix it on way that it takes last (max) rev_id and then bump new one for +1.

Doesn't that just work magically if you don't specify any revision ID for the new revision?

Doesn't that just work magically if you don't specify any revision ID for the new revision?

I'm not sure because extension throws error.

Ok, from patch set 6 of patch https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Duplicator/+/644546, now just this one error shows, nothing else anymore. :)

dberror.log
Sun Dec 13 16:21:22 GMT 2020    fw-cpanel01.fyfeweb.com kizuletk_wiki2-mw       Error 1062 from SpecialDuplicator::duplicate, Duplicate entry '1' for key 'PRIMARY' (localhost) INSERT INTO `mwrevision` (rev_id,rev_page,rev_comment_id,rev_actor,rev_timestamp,rev_minor_edit,rev_deleted,rev_len,rev_parent_id,rev_sha1)VALUES ('1',14,'Копирано са [[Главна страна]], измена [[1]]','0','20201110122742','0','0','1031','0','s8x3mvxq9rxd8pfhamv33hqbvom577b') localhost
#0 /home/kizuletk/public_html/wiki.kizule.ga/includes/libs/rdbms/database/Database.php(1658): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, integer, string, string)
#1 /home/kizuletk/public_html/wiki.kizule.ga/includes/libs/rdbms/database/Database.php(1227): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
#2 /home/kizuletk/public_html/wiki.kizule.ga/includes/libs/rdbms/database/Database.php(2343): Wikimedia\Rdbms\Database->query(string, string, integer)
#3 /home/kizuletk/public_html/wiki.kizule.ga/includes/libs/rdbms/database/Database.php(2323): Wikimedia\Rdbms\Database->doInsert(string, array, string)
#4 /home/kizuletk/public_html/wiki.kizule.ga/includes/libs/rdbms/database/DBConnRef.php(68): Wikimedia\Rdbms\Database->insert(string, array, string)
#5 /home/kizuletk/public_html/wiki.kizule.ga/includes/libs/rdbms/database/DBConnRef.php(369): Wikimedia\Rdbms\DBConnRef->__call(string, array)
#6 /home/kizuletk/public_html/wiki.kizule.ga/extensions/Duplicator/Duplicator.page.php(326): Wikimedia\Rdbms\DBConnRef->insert(string, array, string)
#7 /home/kizuletk/public_html/wiki.kizule.ga/extensions/Duplicator/Duplicator.page.php(114): SpecialDuplicator->duplicate(Title, Title, boolean)
#8 /home/kizuletk/public_html/wiki.kizule.ga/includes/specialpage/SpecialPage.php(645): SpecialDuplicator->execute(NULL)
#9 /home/kizuletk/public_html/wiki.kizule.ga/includes/specialpage/SpecialPageFactory.php(1403): SpecialPage->run(NULL)
#10 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(310): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#11 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(945): MediaWiki->performRequest()
#12 /home/kizuletk/public_html/wiki.kizule.ga/includes/MediaWiki.php(548): MediaWiki->main()
#13 /home/kizuletk/public_html/wiki.kizule.ga/index.php(53): MediaWiki->run()
#14 /home/kizuletk/public_html/wiki.kizule.ga/index.php(46): wfIndexMain()
#15 {main}

@ashley

Change 644546 abandoned by Zoranzoki21:
[mediawiki/extensions/Duplicator@master] Make extension compatible with the MediaWiki 1.35 and newer

Reason:
Let's work on one by one option.

https://gerrit.wikimedia.org/r/644546