Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate entry '0-id_' for key 'PRIMARY' #3

Open
jaideraf opened this issue Apr 29, 2024 · 1 comment
Open

Duplicate entry '0-id_' for key 'PRIMARY' #3

jaideraf opened this issue Apr 29, 2024 · 1 comment

Comments

@jaideraf
Copy link

Setup

  • MW version: 1.39.6
  • PHP version: 7.4.3
  • DB (MySQL etc.): MariaDB 10.3.39
  • IDG version: 1.0.0 (ce6889b)

Issue

When I use {{#next_number:}} I get the following error:

Stacktrace

[b965727e1d16d676b2a2cd40] /w/index.php?title=Wikincat:Home&action=submit Wikimedia\Rdbms\DBQueryError: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading or after adding a new extension?

Please see https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Upgrading and https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:How_to_debug for more information.

Error 1062: Duplicate entry '0-id_' for key 'PRIMARY'
Function: Wikimedia\Rdbms\Database::insert
Query: INSERT INTO `page_props` (pp_page,pp_propname,pp_value) VALUES (-42,'id_',1)
Backtrace:

from .../w/includes/libs/rdbms/database/Database.php(1618)
#0 .../w/includes/libs/rdbms/database/Database.php(1602): Wikimedia\Rdbms\Database->getQueryException()
#1 .../w/includes/libs/rdbms/database/Database.php(1576): Wikimedia\Rdbms\Database->getQueryExceptionAndLog()
#2 .../w/includes/libs/rdbms/database/Database.php(952): Wikimedia\Rdbms\Database->reportQueryError()
#3 .../w/includes/libs/rdbms/database/Database.php(1838): Wikimedia\Rdbms\Database->query()
#4 .../w/includes/libs/rdbms/database/DBConnRef.php(103): Wikimedia\Rdbms\Database->insert()
#5 .../w/includes/libs/rdbms/database/DBConnRef.php(382): Wikimedia\Rdbms\DBConnRef->__call()
#6 .../w/extensions/IdGenerator/src/PackagePrivate/PagePropsIdGenerator.php(65): Wikimedia\Rdbms\DBConnRef->insert()
#7 .../w/extensions/IdGenerator/src/PackagePrivate/PagePropsIdGenerator.php(25): IdGenerator\PackagePrivate\PagePropsIdGenerator->generateNewId()
#8 .../w/extensions/IdGenerator/src/IdGeneratorSetup.php(30): IdGenerator\PackagePrivate\PagePropsIdGenerator->getNewId()
#9 .../w/includes/parser/Parser.php(3437): IdGenerator\IdGeneratorSetup::IdGenerator\{closure}()
#10 .../w/includes/parser/Parser.php(3122): Parser->callParserFunction()
#11 .../w/includes/parser/PPFrame_Hash.php(275): Parser->braceSubstitution()
#12 .../w/includes/parser/Parser.php(2951): PPFrame_Hash->expand()
#13 .../w/includes/parser/Parser.php(4636): Parser->replaceVariables()
#14 .../w/includes/parser/Parser.php(4601): Parser->pstPass2()
#15 .../w/includes/content/WikitextContentHandler.php(225): Parser->preSaveTransform()
#16 .../w/includes/content/Transform/ContentTransformer.php(46): WikitextContentHandler->preSaveTransform()
#17 .../w/includes/EditPage.php(4534): MediaWiki\Content\Transform\ContentTransformer->preSaveTransform()
#18 .../w/includes/EditPage.php(4438): EditPage->doPreviewParse()
#19 .../w/includes/EditPage.php(3144): EditPage->getPreviewText()
#20 .../w/includes/EditPage.php(779): EditPage->showEditForm()
#21 .../w/includes/actions/EditAction.php(73): EditPage->edit()
#22 .../w/includes/actions/SubmitAction.php(38): EditAction->show()
#23 .../w/includes/MediaWiki.php(542): SubmitAction->show()
#24 .../w/includes/MediaWiki.php(322): MediaWiki->performAction()
#25 .../w/includes/MediaWiki.php(904): MediaWiki->performRequest()
#26 .../w/includes/MediaWiki.php(562): MediaWiki->main()
#27 .../w/index.php(50): MediaWiki->run()
#28 .../w/index.php(46): wfIndexMain()
#29 {main}
@JeroenDeDauw
Copy link
Member

I guess something changed in recent MW versions in how this key is built. 0-id_ suggests the -42 is turned into 0. Maybe the DB schema changed from allowing signed numbers to being an unsigned column.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants