Page MenuHomePhabricator

Exception when getting TTL export of a deleted entity
Closed, ResolvedPublicPRODUCTION ERROR

Description

This URL:

https://www.wikidata.org/wiki/Special:EntityData/Q19369930.ttl?nocache=1475267192776&flavor=dump

Produces:

[V@7KlwpAMFUAAL1bOdYAAABK] 2016-09-30 20:27:03: Fatal exception of type "HttpError"

Looks like it is caused by MediaWiki error handling mishandling HttpError and causing every HttpError to be HTTP code 500 instead of the code requested in the error itself.

Event Timeline

Smalyshev triaged this task as Unbreak Now! priority.Sep 30 2016, 8:29 PM

Message in the logstash from the same request, may be related:

Expectation (masterConns <= 0) by MediaWiki::main not met:
[connect to 10.64.16.144 (wikidatawiki)]
#0 /srv/mediawiki/php-1.28.0-wmf.20/includes/libs/rdbms/TransactionProfiler.php(156): TransactionProfiler->reportExpectationViolated()
#1 /srv/mediawiki/php-1.28.0-wmf.20/includes/libs/rdbms/loadbalancer/LoadBalancer.php(573): TransactionProfiler->recordConnection()
#2 /srv/mediawiki/php-1.28.0-wmf.20/includes/dao/DBAccessBase.php(61): LoadBalancer->getConnection()
#3 /srv/mediawiki/php-1.28.0-wmf.20/extensions/Wikidata/extensions/Wikibase/lib/includes/Store/Sql/WikiPageEntityMetaDataLookup.php(175): DBAccessBase->getConnection()
#4 /srv/mediawiki/php-1.28.0-wmf.20/extensions/Wikidata/extensions/Wikibase/lib/includes/Store/Sql/WikiPageEntityMetaDataLookup.php(76): Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup->selectRevisionInformationMultiple()
#5 /srv/mediawiki/php-1.28.0-wmf.20/extensions/Wikidata/extensions/Wikibase/lib/includes/Store/Sql/PrefetchingWikiPageEntityMetaDataAccessor.php(199): Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup->loadRevisionInformation()
#6 /srv/mediawiki/php-1.28.0-wmf.20/extensions/Wikidata/extensions/Wikibase/lib/includes/Store/Sql/PrefetchingWikiPageEntityMetaDataAccessor.php(164): Wikibase\Lib\Store\Sql\PrefetchingWikiPageEntityMetaDataAccessor->doFetch()
#7 /srv/mediawiki/php-1.28.0-wmf.20/extensions/Wikidata/extensions/Wikibase/lib/includes/Store/Sql/WikiPageEntityRevisionLookup.php(140): Wikibase\Lib\Store\Sql\PrefetchingWikiPageEntityMetaDataAccessor->loadRevisionInformation()
#8 /srv/mediawiki/php-1.28.0-wmf.20/extensions/Wikidata/extensions/Wikibase/lib/includes/Store/CachingEntityRevisionLookup.php(122): Wikibase\Lib\Store\WikiPageEntityRevisionLookup->getLatestRevisionId()
#9 /srv/mediawiki/php-1.28.0-wmf.20/extensions/Wikidata/extensions/Wikibase/lib/includes/Store/CachingEntityRevisionLookup.php(156): Wikibase\Lib\Store\CachingEntityRevisionLookup->getEntityRevision()
#10 /srv/mediawiki/php-1.28.0-wmf.20/extensions/Wikidata/extensions/Wikibase/lib/includes/Store/CachingEntityRevisionLookup.php(138): Wikibase\Lib\Store\CachingEntityRevisionLookup->fetchEntityRevision()
#11 /srv/mediawiki/php-1.28.0-wmf.20/extensions/Wikidata/extensions/Wikibase/repo/includes/LinkedData/EntityDataRequestHandler.php(350): Wikibase\Lib\Store\CachingEntityRevisionLookup->getEntityRevision()
#12 /srv/mediawiki/php-1.28.0-wmf.20/extensions/Wikidata/extensions/Wikibase/repo/includes/LinkedData/EntityDataRequestHandler.php(420): Wikibase\Repo\LinkedData\EntityDataRequestHandler->getEntityRevision()
#13 /srv/mediawiki/php-1.28.0-wmf.20/extensions/Wikidata/extensions/Wikibase/repo/includes/LinkedData/EntityDataRequestHandler.php(241): Wikibase\Repo\LinkedData\EntityDataRequestHandler->showData()
#14 /srv/mediawiki/php-1.28.0-wmf.20/extensions/Wikidata/extensions/Wikibase/repo/includes/Specials/SpecialEntityData.php(160): Wikibase\Repo\LinkedData\EntityDataRequestHandler->handleRequest()
#15 /srv/mediawiki/php-1.28.0-wmf.20/includes/specialpage/SpecialPage.php(522): Wikibase\Repo\Specials\SpecialEntityData->execute()
#16 /srv/mediawiki/php-1.28.0-wmf.20/includes/specialpage/SpecialPageFactory.php(584): SpecialPage->run()
#17 /srv/mediawiki/php-1.28.0-wmf.20/includes/MediaWiki.php(283): SpecialPageFactory::executePath()
#18 /srv/mediawiki/php-1.28.0-wmf.20/includes/MediaWiki.php(861): MediaWiki->performRequest()
#19 /srv/mediawiki/php-1.28.0-wmf.20/includes/MediaWiki.php(522): MediaWiki->main()
#20 /srv/mediawiki/php-1.28.0-wmf.20/index.php(43): MediaWiki->run()
#21 /srv/mediawiki/w/index.php(3): include()
#22 {main}

Exception backtrace: https://phabricator.wikimedia.org/P4139

SpecialPageFactory::executePath( Title::newFromText( 'Special:EntityData/Q19369930.json' ), new RequestContext );
Notice: Attempted to interpret unknown debugger command as PHP!

Hit a php exception : exception 'HttpError' with message 'No entity with ID Q19369930 was found.' in /srv/mediawiki/php-1.28.0-wmf.20/extensions/Wikidata/extensions/Wikibase/repo/includes/LinkedData/EntityDataRequestHandler.php:355
Stack trace:
#0 /srv/mediawiki/php-1.28.0-wmf.20/extensions/Wikidata/extensions/Wikibase/repo/includes/LinkedData/EntityDataRequestHandler.php(420): Wikibase\Repo\LinkedData\EntityDataRequestHandler->getEntityRevision()
#1 /srv/mediawiki/php-1.28.0-wmf.20/extensions/Wikidata/extensions/Wikibase/repo/includes/LinkedData/EntityDataRequestHandler.php(241): Wikibase\Repo\LinkedData\EntityDataRequestHandler->showData()
#2 /srv/mediawiki/php-1.28.0-wmf.20/extensions/Wikidata/extensions/Wikibase/repo/includes/Specials/SpecialEntityData.php(160): Wikibase\Repo\LinkedData\EntityDataRequestHandler->handleRequest()
#3 /srv/mediawiki/php-1.28.0-wmf.20/includes/specialpage/SpecialPage.php(522): Wikibase\Repo\Specials\SpecialEntityData->execute()
#4 /srv/mediawiki/php-1.28.0-wmf.20/includes/specialpage/SpecialPageFactory.php(584): SpecialPage->run()
#5 (1): SpecialPageFactory::executePath()
#6 (1): include()
#7 {main}

May be caused by commit 00bee029718f3215396e984d04b9450bc3872503. It looks like HttpError::report knows how to set proper error code, but is never called.

Additional issue: since HttpError::isLoggable() is false, on assumption that HttpError::report() call does the job, the exception does not show up in the logs at all. I suspect that may be the case for true 500 ones too.

Change 313626 had a related patch set uploaded (by BryanDavis):
MWExceptionHandler: Restore delegation to MWException::report

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

Not sure the patch is 100% correct but it fixes the issue for me.

Change 313627 had a related patch set uploaded (by Smalyshev):
MWExceptionHandler: Restore delegation to MWException::report

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

Change 313626 merged by jenkins-bot:
MWExceptionHandler: Restore delegation to MWException::report

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

Change 313627 merged by jenkins-bot:
MWExceptionHandler: Restore delegation to MWException::report

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

Mentioned in SAL (#wikimedia-operations) [2016-10-03T18:36:23Z] <catrope@tin> Synchronized php-1.28.0-wmf.20/includes/exception/MWExceptionHandler.php: Restore delegation to MWException::report (T147098) (duration: 00m 48s)

Smalyshev claimed this task.

Resolved now, 404 is back as it should be.

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:10 PM