Page MenuHomePhabricator

Can't create election: SecurePollContentHandler::makeContentFromElection() must be an instance of SecurePoll_Election, bool given
Closed, ResolvedPublic

Description

When i tried to create an election on testwiki with no encryption I got the following error. I have no idea if related to T209656

SecurePollContentHandler::makeContentFromElection() must be an instance of SecurePoll_Election, bool given
#0 /srv/mediawiki/php-1.33.0-wmf.4/extensions/SecurePoll/includes/pages/CreatePage.php(620): NO_FUNCTION_GIVEN()
#1 /srv/mediawiki/php-1.33.0-wmf.4/includes/htmlform/HTMLForm.php(663): SecurePoll_CreatePage->processInput(array, HTMLForm)
#2 /srv/mediawiki/php-1.33.0-wmf.4/includes/htmlform/HTMLForm.php(555): HTMLForm->trySubmit()
#3 /srv/mediawiki/php-1.33.0-wmf.4/extensions/SecurePoll/includes/pages/CreatePage.php(381): HTMLForm->tryAuthorizedSubmit()
#4 /srv/mediawiki/php-1.33.0-wmf.4/extensions/SecurePoll/includes/main/SpecialSecurePoll.php(72): SecurePoll_CreatePage->execute(array)
#5 /srv/mediawiki/php-1.33.0-wmf.4/includes/specialpage/SpecialPage.php(569): SecurePoll_SpecialSecurePoll->execute(string)
#6 /srv/mediawiki/php-1.33.0-wmf.4/includes/specialpage/SpecialPageFactory.php(558): SpecialPage->run(string)
#7 /srv/mediawiki/php-1.33.0-wmf.4/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#8 /srv/mediawiki/php-1.33.0-wmf.4/includes/MediaWiki.php(862): MediaWiki->performRequest()
#9 /srv/mediawiki/php-1.33.0-wmf.4/includes/MediaWiki.php(517): MediaWiki->main()
#10 /srv/mediawiki/php-1.33.0-wmf.4/index.php(42): MediaWiki->run()
#11 /srv/mediawiki/w/index.php(3): include(string)

Event Timeline

With X-Wikimedia-Debug, I get these logs:

2018-11-20 19:01:34 [W-RaDQpAIHsAAEW0C6YAAAAG] mwdebug1001 testwiki 1.33.0-wmf.4 DBQuery DEBUG: BEGIN {"method":"Wikimedia\\Rdbms\\Database::query (SecurePoll_CreatePage::processInput)","master":true,"runtime":0.00081896781921387}
2018-11-20 19:01:34 [W-RaDQpAIHsAAEW0C6YAAAAG] mwdebug1001 testwiki 1.33.0-wmf.4 DBQuery DEBUG: SELECT  el_entity  FROM `securepoll_elections`    WHERE el_title = 'Test 2090'  LIMIT 1   FOR UPDATE {"method":"SecurePoll_CreatePage::processInput","master":true,"runtime":0.00054383277893066}
2018-11-20 19:01:34 [W-RaDQpAIHsAAEW0C6YAAAAG] mwdebug1001 testwiki 1.33.0-wmf.4 DBQuery DEBUG: startAtomic: entering level 0 (SecurePoll_CreatePage::processInput)
2018-11-20 19:01:34 [W-RaDQpAIHsAAEW0C6YAAAAG] mwdebug1001 testwiki 1.33.0-wmf.4 DBQuery DEBUG: INSERT  INTO `securepoll_entity` (en_id,en_type) VALUES (NULL,'election') {"method":"SecurePoll_CreatePage::insertEntity","master":true,"runtime":0.00094103813171387}
2018-11-20 19:01:34 [W-RaDQpAIHsAAEW0C6YAAAAG] mwdebug1001 testwiki 1.33.0-wmf.4 DBQuery DEBUG: INSERT  INTO `securepoll_elections` (el_title,el_ballot,el_tally,el_primary_lang,el_start_date,el_end_date,el_auth_type,el_owner,el_entity) VALUES ('Test 2090','preferential','schulze','en','20901201000000','20901202000000','local','4382','697') {"method":"SecurePoll_CreatePage::processInput","master":true,"runtime":0.00058698654174805}
2018-11-20 19:01:35 [W-RaDQpAIHsAAEW0C6YAAAAG] mwdebug1001 testwiki 1.33.0-wmf.4 DBQuery DEBUG: REPLACE INTO `securepoll_properties` (pr_entity,pr_key,pr_value) VALUES ('697','encrypt-type','none'),('697','wikis','testwiki'),('697','wikis-val','testwiki'),('697','return-url',''),('697','disallow-change','0'),('697','voter-privacy','0'),('697','admins','Anomie'),('697','shuffle-questions','0'),('697','shuffle-options','0'),('697','must-rank-all','0') {"method":"SecurePoll_CreatePage::savePropertiesAndMessages","master":true,"runtime":0.00087499618530273}
2018-11-20 19:01:35 [W-RaDQpAIHsAAEW0C6YAAAAG] mwdebug1001 testwiki 1.33.0-wmf.4 DBQuery DEBUG: REPLACE INTO `securepoll_msgs` (msg_entity,msg_lang,msg_key,msg_text) VALUES ('697','en','title','Test 2090') {"method":"SecurePoll_CreatePage::savePropertiesAndMessages","master":true,"runtime":0.0012319087982178}
2018-11-20 19:01:35 [W-RaDQpAIHsAAEW0C6YAAAAG] mwdebug1001 testwiki 1.33.0-wmf.4 DBQuery DEBUG: INSERT  INTO `securepoll_entity` (en_id,en_type) VALUES (NULL,'question') {"method":"SecurePoll_CreatePage::insertEntity","master":true,"runtime":0.00049114227294922}
2018-11-20 19:01:35 [W-RaDQpAIHsAAEW0C6YAAAAG] mwdebug1001 testwiki 1.33.0-wmf.4 DBQuery DEBUG: REPLACE INTO `securepoll_questions` (qu_entity,qu_election,qu_index) VALUES ('698','697','1') {"method":"SecurePoll_CreatePage::processInput","master":true,"runtime":0.00070786476135254}
2018-11-20 19:01:35 [W-RaDQpAIHsAAEW0C6YAAAAG] mwdebug1001 testwiki 1.33.0-wmf.4 DBQuery DEBUG: REPLACE INTO `securepoll_properties` () VALUES () {"method":"SecurePoll_CreatePage::savePropertiesAndMessages","master":true,"runtime":0.00050210952758789}
2018-11-20 19:01:35 [W-RaDQpAIHsAAEW0C6YAAAAG] mwdebug1001 testwiki 1.33.0-wmf.4 DBQuery DEBUG: REPLACE INTO `securepoll_msgs` (msg_entity,msg_lang,msg_key,msg_text) VALUES ('698','en','text','Why?') {"method":"SecurePoll_CreatePage::savePropertiesAndMessages","master":true,"runtime":0.00080084800720215}
2018-11-20 19:01:35 [W-RaDQpAIHsAAEW0C6YAAAAG] mwdebug1001 testwiki 1.33.0-wmf.4 DBQuery DEBUG: INSERT  INTO `securepoll_entity` (en_id,en_type) VALUES (NULL,'option') {"method":"SecurePoll_CreatePage::insertEntity","master":true,"runtime":0.00096011161804199}
2018-11-20 19:01:35 [W-RaDQpAIHsAAEW0C6YAAAAG] mwdebug1001 testwiki 1.33.0-wmf.4 DBQuery DEBUG: REPLACE INTO `securepoll_options` (op_entity,op_election,op_question) VALUES ('699','697','698') {"method":"SecurePoll_CreatePage::processInput","master":true,"runtime":0.00062108039855957}
2018-11-20 19:01:35 [W-RaDQpAIHsAAEW0C6YAAAAG] mwdebug1001 testwiki 1.33.0-wmf.4 DBQuery DEBUG: REPLACE INTO `securepoll_properties` () VALUES () {"method":"SecurePoll_CreatePage::savePropertiesAndMessages","master":true,"runtime":0.0004880428314209}
2018-11-20 19:01:35 [W-RaDQpAIHsAAEW0C6YAAAAG] mwdebug1001 testwiki 1.33.0-wmf.4 DBQuery DEBUG: REPLACE INTO `securepoll_msgs` (msg_entity,msg_lang,msg_key,msg_text) VALUES ('699','en','text','Because') {"method":"SecurePoll_CreatePage::savePropertiesAndMessages","master":true,"runtime":0.00088596343994141}
2018-11-20 19:01:35 [W-RaDQpAIHsAAEW0C6YAAAAG] mwdebug1001 testwiki 1.33.0-wmf.4 DBQuery DEBUG: INSERT  INTO `securepoll_entity` (en_id,en_type) VALUES (NULL,'option') {"method":"SecurePoll_CreatePage::insertEntity","master":true,"runtime":0.0004270076751709}
2018-11-20 19:01:35 [W-RaDQpAIHsAAEW0C6YAAAAG] mwdebug1001 testwiki 1.33.0-wmf.4 DBQuery DEBUG: REPLACE INTO `securepoll_options` (op_entity,op_election,op_question) VALUES ('700','697','698') {"method":"SecurePoll_CreatePage::processInput","master":true,"runtime":0.00048279762268066}
2018-11-20 19:01:35 [W-RaDQpAIHsAAEW0C6YAAAAG] mwdebug1001 testwiki 1.33.0-wmf.4 DBQuery DEBUG: REPLACE INTO `securepoll_properties` () VALUES () {"method":"SecurePoll_CreatePage::savePropertiesAndMessages","master":true,"runtime":0.00037789344787598}
2018-11-20 19:01:35 [W-RaDQpAIHsAAEW0C6YAAAAG] mwdebug1001 testwiki 1.33.0-wmf.4 DBQuery DEBUG: REPLACE INTO `securepoll_msgs` (msg_entity,msg_lang,msg_key,msg_text) VALUES ('700','en','text','Why not?') {"method":"SecurePoll_CreatePage::savePropertiesAndMessages","master":true,"runtime":0.0009009838104248}
2018-11-20 19:01:35 [W-RaDQpAIHsAAEW0C6YAAAAG] mwdebug1001 testwiki 1.33.0-wmf.4 DBQuery DEBUG: endAtomic: leaving level 0 (SecurePoll_CreatePage::processInput)
2018-11-20 19:01:35 [W-RaDQpAIHsAAEW0C6YAAAAG] mwdebug1001 testwiki 1.33.0-wmf.4 DBQuery DEBUG: SELECT  *  FROM `securepoll_elections`    WHERE el_entity = '697'   {"method":"SecurePoll_DBStore::getElectionInfo","master":false,"runtime":0.061697006225586} 
2018-11-20 19:01:35 [W-RaDQpAIHsAAEW0C6YAAAAG] mwdebug1001 testwiki 1.33.0-wmf.4 fatal ERROR: [W-RaDQpAIHsAAEW0C6YAAAAG] /wiki/Special:SecurePoll/create   PHP Fatal Error from line 620 of /srv/mediawiki/php-1.33.0-wmf.4/extensions/SecurePoll/includes/pages/CreatePage.php: Argument 1 passed to SecurePollContentHandler::makeContentFromElection() must be an instance of SecurePoll_Election, bool given

It looks like it's starting an implicit transaction, doing a bunch of inserts in an atomic section, then trying to select that election from a replica before the transaction is committed.

Still happening on test-wiki, any updates on this?

Thanks for the ping.

I'm glad I was aware of the upcoming enwiki ArbCom elections that will need SecurePoll working or I might not have known this needs to be high priority.

Fawiki holds its elections on Votewiki too. Please see T230614. We will need SecurePoll working from late October until early November. Thanks.

Thanks, I wasn't aware of fawiki's elections.

Change 534467 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/extensions/SecurePoll@master] Use DB_MASTER to read back election after creation

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

Huji removed a project: Patch-For-Review.

Change 534467 merged by jenkins-bot:
[mediawiki/extensions/SecurePoll@master] Use DB_MASTER to read back election after creation

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