Page MenuHomePhabricator

zhwiki: MediaWiki\Storage\NameTableAccessException: No insert possible but primary DB didn't give us a record for 'SecurePoll' in 'content_models'
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
  • mwversion: 1.45.0-wmf.13
  • timestamp: 2025-08-11T21:28:14.275Z
  • phpversion: 8.1.33
  • reqId: 1c5fa06c-0e9b-4c12-9bbd-0534fc2a501b
  • Find reqId in Logstash
normalized_message
[{reqId}] {exception_url}   MediaWiki\Storage\NameTableAccessException: No insert possible but primary DB didn't give us a record for 'SecurePoll' in 'content_models'
FrameLocationCall
from/srv/mediawiki/php-1.45.0-wmf.13/includes/Storage/NameTableStore.php(405)
#0/srv/mediawiki/php-1.45.0-wmf.13/includes/Storage/NameTableStore.php(165)MediaWiki\Storage\NameTableStore->store(string)
#1/srv/mediawiki/php-1.45.0-wmf.13/includes/Revision/RevisionStore.php(972)MediaWiki\Storage\NameTableStore->acquireId(string)
#2/srv/mediawiki/php-1.45.0-wmf.13/includes/Revision/RevisionStore.php(711)MediaWiki\Revision\RevisionStore->insertContentRowOn(MediaWiki\Revision\SlotRecord, Wikimedia\Rdbms\DatabaseMySQL, string)
#3/srv/mediawiki/php-1.45.0-wmf.13/includes/Revision/RevisionStore.php(669)MediaWiki\Revision\RevisionStore->insertSlotOn(Wikimedia\Rdbms\DatabaseMySQL, int, MediaWiki\Revision\SlotRecord, MediaWiki\Page\PageIdentityValue, array)
#4/srv/mediawiki/php-1.45.0-wmf.13/includes/Revision/RevisionStore.php(482)MediaWiki\Revision\RevisionStore->insertRevisionInternal(MediaWiki\Revision\MutableRevisionRecord, Wikimedia\Rdbms\DatabaseMySQL, MediaWiki\User\User, MediaWiki\CommentStore\CommentStoreComment, MediaWiki\Page\PageIdentityValue, int, int)
#5/srv/mediawiki/php-1.45.0-wmf.13/includes/libs/rdbms/database/Database.php(2337)MediaWiki\Revision\RevisionStore->MediaWiki\Revision\{closure}(Wikimedia\Rdbms\DatabaseMySQL, string)
#6/srv/mediawiki/php-1.45.0-wmf.13/includes/libs/rdbms/database/DBConnRef.php(127)Wikimedia\Rdbms\Database->doAtomicSection(string, Closure)
#7/srv/mediawiki/php-1.45.0-wmf.13/includes/libs/rdbms/database/DBConnRef.php(754)Wikimedia\Rdbms\DBConnRef->__call(string, array)
#8/srv/mediawiki/php-1.45.0-wmf.13/includes/Revision/RevisionStore.php(490)Wikimedia\Rdbms\DBConnRef->doAtomicSection(string, Closure)
#9/srv/mediawiki/php-1.45.0-wmf.13/includes/Storage/PageUpdater.php(1576)MediaWiki\Revision\RevisionStore->insertRevisionOn(MediaWiki\Revision\MutableRevisionRecord, Wikimedia\Rdbms\DBConnRef)
#10/srv/mediawiki/php-1.45.0-wmf.13/includes/Storage/PageUpdater.php(986)MediaWiki\Storage\PageUpdater->doCreate(MediaWiki\CommentStore\CommentStoreComment)
#11/srv/mediawiki/php-1.45.0-wmf.13/extensions/SecurePoll/includes/TranslationRepo.php(94)MediaWiki\Storage\PageUpdater->saveRevision(MediaWiki\CommentStore\CommentStoreComment)
#12/srv/mediawiki/php-1.45.0-wmf.13/extensions/SecurePoll/includes/Pages/TranslatePage.php(267)MediaWiki\Extension\SecurePoll\TranslationRepo->setTranslation(MediaWiki\Extension\SecurePoll\Entities\Election, array, string, MediaWiki\User\User, string)
#13/srv/mediawiki/php-1.45.0-wmf.13/extensions/SecurePoll/includes/Pages/TranslatePage.php(111)MediaWiki\Extension\SecurePoll\Pages\TranslatePage->doSubmit(string)
#14/srv/mediawiki/php-1.45.0-wmf.13/extensions/SecurePoll/includes/SpecialSecurePoll.php(61)MediaWiki\Extension\SecurePoll\Pages\TranslatePage->execute(array)
#15/srv/mediawiki/php-1.45.0-wmf.13/includes/specialpage/SpecialPage.php(725)MediaWiki\Extension\SecurePoll\SpecialSecurePoll->execute(string)
#16/srv/mediawiki/php-1.45.0-wmf.13/includes/specialpage/SpecialPageFactory.php(1727)MediaWiki\SpecialPage\SpecialPage->run(string)
#17/srv/mediawiki/php-1.45.0-wmf.13/includes/actions/ActionEntryPoint.php(499)MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, MediaWiki\Context\RequestContext)
#18/srv/mediawiki/php-1.45.0-wmf.13/includes/actions/ActionEntryPoint.php(143)MediaWiki\Actions\ActionEntryPoint->performRequest()
#19/srv/mediawiki/php-1.45.0-wmf.13/includes/MediaWikiEntryPoint.php(198)MediaWiki\Actions\ActionEntryPoint->execute()
#20/srv/mediawiki/php-1.45.0-wmf.13/index.php(58)MediaWiki\MediaWikiEntryPoint->run()
#21/srv/mediawiki/w/index.php(3)require(string)
#22{main}
Impact

The community planned to hold a local election, but during early testing, it was discovered that the translation feature was not working.
This meant that voting could not proceed due to incomplete interface text.

Notes

Looks related to T399372: enwiki: MediaWiki\Storage\NameTableAccessException: No insert possible but primary DB didn't give us a record for 'SecurePoll' in 'content_models'

I got the same error message when creating a poll, but after refreshing the page, the poll magically appeared in the Special:SecurePoll list. But in this case, refreshing page doesn't really help.

Steps to reproduce:

  1. Go to Special:SecurePoll
  2. Choose 翻译 (Translate)
  3. Choose zh-cn
  4. Enter translated strings
  5. Click 更新 (Update)

Details

MediaWiki Version
1.45.0-wmf.13
Request URL
https://zh.wikipedia.org/w/index.php?title=Special:SecurePoll/translate/431/zh-cn&action=submit

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

@Novem_Linguae Could you please take a look at this? It seems there’s an issue when saving JSON configs under Mediawiki:SecurePoll/*, nothing appears to be saved.

This is because of T399633. The AUTO_INCREMENT value needs to be manually set.

@Zabe Can you help with fixing the auto increment for the zhwiki.content_models table?

Aklapper renamed this task from SecurePoll MediaWiki\Storage\NameTableAccessException Error on zhwiki to MediaWiki\Storage\NameTableAccessException: No insert possible but primary DB didn't give us a record for 'SecurePoll' in 'content_models'.Aug 12 2025, 9:08 AM
Aklapper updated the task description. (Show Details)

Or maybe I shouldn't have marked this as a dup per last comments? Hmm.

Mentioned in SAL (#wikimedia-operations) [2025-08-12T09:17:36Z] <zabe> manually insert 'SecurePoll' into zhwiki.content_models # T401641

Novem_Linguae renamed this task from MediaWiki\Storage\NameTableAccessException: No insert possible but primary DB didn't give us a record for 'SecurePoll' in 'content_models' to zhwiki: MediaWiki\Storage\NameTableAccessException: No insert possible but primary DB didn't give us a record for 'SecurePoll' in 'content_models'.Aug 12 2025, 9:23 AM

Yeah, probably best to keep this as a separate ticket. Individual wikis will need these fixed to unbreak SecurePoll faster than we can mass fix every instance of this. I think putting the mass cleanup ticket as the parent ticket is probably best. I'll go ahead and do that now.

@Stang It looks like Zabe fixed the database. Can you confirm that this bug is no longer reproducible? If so feel free to close this ticket.

Stang claimed this task.
Stang reassigned this task from Stang to Zabe.
Stang moved this task from Extensions/Skins to Closed on the Chinese-Sites board.