Page MenuHomePhabricator

Exception "Flow workflow is for different page" when opting out on wikis with Flow on all user talk pages and Beta Feature available
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

Request ID: W7fMPwrAADcAAFwumHYAAAAX

message
[{exception_id}] {exception_url}   Flow\Exception\InvalidDataException from line 130 of /srv/mediawiki/php-1.32.0-wmf.24/extensions/Flow/includes/WorkflowLoaderFactory.php: Flow workflow is for different page
trace
 #0 /srv/mediawiki/php-1.32.0-wmf.24/extensions/Flow/includes/WorkflowLoaderFactory.php(103): Flow\WorkflowLoaderFactory->loadWorkflowById(Title, Flow\Model\UUID)
#1 /srv/mediawiki/php-1.32.0-wmf.24/extensions/Flow/includes/Content/BoardContent.php(245): Flow\WorkflowLoaderFactory->createWorkflowLoader(Title, Flow\Model\UUID)
#2 /srv/mediawiki/php-1.32.0-wmf.24/extensions/Flow/includes/Content/BoardContent.php(223): Flow\Content\BoardContent->getWorkflowLoader(Title)
#3 /srv/mediawiki/php-1.32.0-wmf.24/extensions/Flow/includes/Content/BoardContent.php(173): Flow\Content\BoardContent->generateHtml(Title, User)
#4 /srv/mediawiki/php-1.32.0-wmf.24/includes/Revision/RenderedRevision.php(217): Flow\Content\BoardContent->getParserOutput(Title, integer, ParserOptions, boolean)
#5 /srv/mediawiki/php-1.32.0-wmf.24/includes/Revision/RevisionRenderer.php(170): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string)
#6 /srv/mediawiki/php-1.32.0-wmf.24/includes/Revision/RevisionRenderer.php(123): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, array)
#7 [internal function]: Closure$MediaWiki\Revision\RevisionRenderer::getRenderedRevision#2(MediaWiki\Revision\RenderedRevision, array)
#8 /srv/mediawiki/php-1.32.0-wmf.24/includes/Revision/RenderedRevision.php(176): call_user_func(Closure$MediaWiki\Revision\RevisionRenderer::getRenderedRevision#2;5958, MediaWiki\Revision\RenderedRevision, array)
#9 /srv/mediawiki/php-1.32.0-wmf.24/includes/jobqueue/jobs/CategoryMembershipChangeJob.php(242): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#10 /srv/mediawiki/php-1.32.0-wmf.24/includes/jobqueue/jobs/CategoryMembershipChangeJob.php(219): CategoryMembershipChangeJob->getCategoriesAtRev(WikiPage, Revision, string)
#11 /srv/mediawiki/php-1.32.0-wmf.24/includes/jobqueue/jobs/CategoryMembershipChangeJob.php(176): CategoryMembershipChangeJob->getExplicitCategoriesChanges(WikiPage, Revision, NULL)
#12 /srv/mediawiki/php-1.32.0-wmf.24/includes/jobqueue/jobs/CategoryMembershipChangeJob.php(142): CategoryMembershipChangeJob->notifyUpdatesForRevision(Wikimedia\Rdbms\LBFactoryMulti, WikiPage, Revision)
#13 /srv/mediawiki/php-1.32.0-wmf.24/extensions/EventBus/includes/JobExecutor.php(65): CategoryMembershipChangeJob->run()
#14 /srv/mediawiki/rpc/RunSingleJob.php(67): JobExecutor->execute(array)
#15 {main}

Impact

This occurred when going to ca.wikiquote.org, enabling Flow as a beta feature, leaving the board empty, then disabling Flow.

In getParserOutput(), there's a try/catch block:

try {
	global $wgUser;
	$user = $options ? $options->getUser() : $wgUser;
	$parserOutput = $this->generateHtml( $title, $user );
} catch ( UnknownWorkflowIdException $e ) {
        // Workflow does not yet exist (may be in the process of being created)
	$parserOutput = new ParserOutput();
}

However, UnknownWorkflowIdException is never thrown, InvalidDataException is.

Event Timeline

Krinkle renamed this task from Flow workflow is for different page when opting out of Flow on wikis where Flow is enabled for all user talk pages, and beta opt-in is available to Exception "Flow workflow is for different page" when opting out on wikis with Flow on all user talk pages and Beta Feature available.Oct 9 2018, 6:16 PM
Krinkle moved this task from Untriaged to Older on the Wikimedia-production-error board.

Change 468061 had a related patch set uploaded (by Kosta Harlan; owner: Kosta Harlan):
[mediawiki/extensions/Flow@master] Catch the correct exception in getParserOutput()

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

Change 468061 merged by jenkins-bot:
[mediawiki/extensions/Flow@master] Catch any exception in getParserOutput()

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

This occurred when going to ca.wikiquote.org, enabling Flow as a beta feature, leaving the board empty, then disabling Flow.

I just did this on ca.wikiquote.org, and no exception thrown! (Or rather, the InvalidDataException is caught and the code continues as it should.)

Of course, you can't actually opt-in/opt-out since Flow is on by default for all user talk pages, but at least you don't get this error any more.

I just did this on ca.wikiquote.org, and no exception thrown! (Or rather, the InvalidDataException is caught and the code continues as it should.)

IIRC, I've heard that the error happen on the first activation, but not on the next ones.

Etonkovidova claimed this task.
Etonkovidova subscribed.

Tested in betalabs, testwiki (wmf.1), and cawiki (wmf.1). I checked for users that never had User talk page and selectively checked for users that had User talk page with some content.

(1) cawiki (wmf.1) no errors are displayed. Opt-in/opt-out on empty User talk pages correctly displays respectively empty Flow board or a normal wiki page.

(2) testwiki (wmf.1) Quite easy to trigger the error which goes away if User talk page is reload. The steps in the task description reliably reproduce the issue. However, there are old users who had User talk pages (either Flow or text) with content and upon opting in for Flow would see the error.
I got an impression that it's related to specifics of caching on testwiki. Sometime when you opt-in for Flow and go to User talk page, you still see the previous text page. Reloading the page brings Flow board. What causes to display previous text page vs error - I could not see the pattern.

(3) betalabs
The only jarring thing in betalabs, it's that opting out of Flow will display a message of previously deleted text-based User page which is incorrect.

I am inclined to close this task - the cases of the error should be minimal now (or not existent).

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