Page MenuHomePhabricator

Fatal exception of type "Flow\Exception\UnknownWorkflowIdException" on frwikisource
Open, Needs TriagePublicPRODUCTION ERROR

Description

Going to https://fr.wikisource.org/wiki/Sujet:V2sosurdvt1n2ldi?uselang=en returns me the MediaWiki error:

[XR5FFApAICgAAJbtjBgAAABT] 2019-07-04 18:27:32: Fatal exception of type "Flow\Exception\UnknownWorkflowIdException"

I believe that a proper 404 page should be returned instead.

Event Timeline

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

The Growth-Team will work on this during our next sprint.

There is strangely no record of this fatal in Logstash. And the response code is HTTP 400 instead of the expected HTTP 500 for fatal exceptions and internal errors. This suggests that perhaps the exception is already caught and this page already rendered by Flow (and not by the catch-all handler MW core).

If so, then this isn't a production error, but rather just a confusing error message that needs improvement (e.g. not using the fatal error template, and possibly a different 40x code indeed).

Given that this is not a production error for @Krinkle, the Growth-Team determined this is not as urgent as we originally thought

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

I observed this exception on a wiki (1.37.1 with Flow REL1_37 99a2d9f9dcbd8) with the stacktrace below.

[cd09e461d67f4c4a77f09d31] /Sujet:Ts0bgk6uy35e6x6s Flow\Exception\UnknownWorkflowIdException: The requested workflow does not exist on this wiki.

Backtrace:

from /mediawiki/extensions/Flow/includes/WorkflowLoaderFactory.php(127)
#0 /mediawiki/extensions/Flow/includes/WorkflowLoaderFactory.php(103): Flow\WorkflowLoaderFactory->loadWorkflowById()
#1 /mediawiki/extensions/Flow/includes/Actions/FlowAction.php(100): Flow\WorkflowLoaderFactory->createWorkflowLoader()
#2 /mediawiki/extensions/Flow/includes/Actions/ViewAction.php(27): Flow\Actions\FlowAction->showForAction()
#3 /mediawiki/extensions/Flow/includes/Actions/FlowAction.php(50): Flow\Actions\ViewAction->showForAction()
#4 /mediawiki/includes/MediaWiki.php(543): Flow\Actions\FlowAction->show()
#5 /mediawiki/includes/MediaWiki.php(320): MediaWiki->performAction()
#6 /mediawiki/includes/MediaWiki.php(930): MediaWiki->performRequest()
#7 /mediawiki/includes/MediaWiki.php(564): MediaWiki->main()
#8 /mediawiki/index.php(53): MediaWiki->run()
#9 /mediawiki/index.php(46): wfIndexMain()
#10 {main}

After searching UnknownWorkflowIdException in Flow codebase, the two only occurences of this exception are either:

  1. when the workflow does not exist (code),
  2. when the workflow does not correspond to the local wiki (code).

My case was the second one, and indeed it was after I renamed the database, so I applied T168389#3362928.


I don’t have access to Wikimedia’s Flow database (not visible in Quarry in frwikisource_p, I guess it is in a separate database), but anyone with access could execute the following SQL (to be adapted to select frwikisource) to search the missing workflow:

SELECT * FROM flow_workflow WHERE workflow_id = 0x05aee0c5fc82d7d57183b6;

05aee0c5fc82d7d57183b6 is the hex value of base36 v2sosurdvt1n2ldi, converted using Flow\Model\UUID::create( 'v2sosurdvt1n2ldi' )->getHex().

Also the HTTP code 400 is because:

  • Flow\Exception\UnknownWorkflowIdException inherits from Flow\Exception\InvalidInputException,
  • whose method getStatusCode returns 400,
  • and in parent class Flow\Exception\FlowException method reportHTML there is $this->output->setStatusCode( $this->getStatusCode() );

About exception handling in Flow, there is also T64176, quite old now.

kostajh moved this task from Triaged but Future to Needs Discussion on the Growth-Team board.
kostajh subscribed.

Seeing a bunch of these on hewiki this week (example).