Page MenuHomePhabricator

SecurePoll doing DB writes to securepoll_log on HTTP GET [M]
Closed, ResolvedPublicPRODUCTION ERROR

Description

Following on from T283280: Special:SecurePoll makes primary database connections on GET requests when getting UI messages or checking for election admins

Error
normalized_message
Expectation (writes <=) 0 by MediaWiki::main not met (actual: {actual}):
{query}
exception.trace
from /srv/mediawiki/php-1.37.0-wmf.18/includes/libs/rdbms/TransactionProfiler.php(444)
#0 /srv/mediawiki/php-1.37.0-wmf.18/includes/libs/rdbms/TransactionProfiler.php(280): Wikimedia\Rdbms\TransactionProfiler->reportExpectationViolated(string, Wikimedia\Rdbms\GeneralizedSql, integer)
#1 /srv/mediawiki/php-1.37.0-wmf.18/includes/libs/rdbms/database/Database.php(1501): Wikimedia\Rdbms\TransactionProfiler->recordQueryCompletion(Wikimedia\Rdbms\GeneralizedSql, double, boolean, integer)
#2 /srv/mediawiki/php-1.37.0-wmf.18/includes/libs/rdbms/database/Database.php(1383): Wikimedia\Rdbms\Database->executeQueryAttempt(string, string, boolean, string, integer)
#3 /srv/mediawiki/php-1.37.0-wmf.18/includes/libs/rdbms/database/Database.php(1308): Wikimedia\Rdbms\Database->executeQuery(string, string, integer)
#4 /srv/mediawiki/php-1.37.0-wmf.18/includes/libs/rdbms/database/Database.php(2433): Wikimedia\Rdbms\Database->query(string, string, integer)
#5 /srv/mediawiki/php-1.37.0-wmf.18/includes/libs/rdbms/database/Database.php(2413): Wikimedia\Rdbms\Database->doInsert(string, array, string)
#6 /srv/mediawiki/php-1.37.0-wmf.18/includes/libs/rdbms/database/DBConnRef.php(68): Wikimedia\Rdbms\Database->insert(string, array, string)
#7 /srv/mediawiki/php-1.37.0-wmf.18/includes/libs/rdbms/database/DBConnRef.php(373): Wikimedia\Rdbms\DBConnRef->__call(string, array)
#8 /srv/mediawiki/php-1.37.0-wmf.18/extensions/SecurePoll/includes/Pages/ListPage.php(122): Wikimedia\Rdbms\DBConnRef->insert(string, array, string)
#9 /srv/mediawiki/php-1.37.0-wmf.18/extensions/SecurePoll/includes/SpecialSecurePoll.php(70): MediaWiki\Extensions\SecurePoll\Pages\ListPage->execute(array)
#10 /srv/mediawiki/php-1.37.0-wmf.18/includes/specialpage/SpecialPage.php(646): MediaWiki\Extensions\SecurePoll\SpecialSecurePoll->execute(string)
#11 /srv/mediawiki/php-1.37.0-wmf.18/includes/specialpage/SpecialPageFactory.php(1365): SpecialPage->run(string)
#12 /srv/mediawiki/php-1.37.0-wmf.18/includes/MediaWiki.php(314): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, RequestContext)
#13 /srv/mediawiki/php-1.37.0-wmf.18/includes/MediaWiki.php(925): MediaWiki->performRequest()
#14 /srv/mediawiki/php-1.37.0-wmf.18/includes/MediaWiki.php(559): MediaWiki->main()
#15 /srv/mediawiki/php-1.37.0-wmf.18/index.php(53): MediaWiki->run()
#16 /srv/mediawiki/php-1.37.0-wmf.18/index.php(46): wfIndexMain()
#17 /srv/mediawiki/w/index.php(3): require(string)
#18 {main}

Query:

INSERT INTO `securepoll_log` (spl_timestamp,spl_election_id,spl_user,spl_type) VALUES ('X',N,...,N)
Impact
Notes

Details

Request URL
https://vote.wikimedia.org/wiki/Special:SecurePoll/list/883

Event Timeline

Reedy renamed this task from SecurePoll doing DB writes on HTTP GET to SecurePoll doing DB writes to securepoll_log on HTTP GET.Aug 12 2021, 9:18 PM
Reedy updated the task description. (Show Details)
ARamirez_WMF renamed this task from SecurePoll doing DB writes to securepoll_log on HTTP GET to SecurePoll doing DB writes to securepoll_log on HTTP GET [M].Aug 18 2021, 4:48 PM

Following up on today's AHT: Estimation & Triaging meeting:

This feature (record when a user views the list of votes) is necessary.

Manual:Job queue/For developers details the path forward:

…use a job for writing data in the context of a GET request.

Change 714701 had a related patch set uploaded (by STran; author: STran):

[mediawiki/extensions/SecurePoll@master] Convert inline logging on ListPage to a job

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

Change 714701 merged by jenkins-bot:

[mediawiki/extensions/SecurePoll@master] Convert inline logging on ListPage to a job

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

dom_walden added subscribers: jrbs, dom_walden.

According to logstash, I see that these errors stopped on https://vote.wikimedia.org on 1st Sept at ~17:21, which I think corresponds to when the train deployed to votewiki.

On beta, I can view the list page (Special:SecurePoll/list/<election id>) and see that action logged to Special:SecurePollLog.

It might be worth testing on production. So far, I have not heard any election admins having problems either with the list page or log page (although they may not have used the latter).

@jrbs If you have time, would you be able to confirm that you can view the voter list and then see the fact you just viewed the voter list recorded to the log?

Test Environment: https://vote.wikimedia.beta.wmflabs.org SecurePoll 3.0.0 (a86be99) 06:26, 2 September 2021.

@jrbs If you have time, would you be able to confirm that you can view the voter list and then see the fact you just viewed the voter list recorded to the log?

Yup, seems to work!