Page MenuHomePhabricator

Flow\Exception\NoParserException when reading or editing flow board
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error message
[YBHOSQpAAMAAAhVRoXwAAAEO] Caught exception of type Flow\Exception\NoParserException
Impact

Can't read (click on Edit button to see wikicode) nor save (using API) this specific Flow board.
https://fr.wikipedia.org/wiki/Discussion_utilisateur:Signimu

Notes

Looks a resurrection of T249705: Intermittent internal API errors with Flow. Hence boldly cc-ing @kostajh.

Details

Request ID
YBHOSQpAAMAAAhVRoXwAAAEO
Request URL
https://fr.wikipedia.org/w/api.php?action=flow&format=json&submodule=view-header&uselang=fr&page=Discussion_utilisateur%3ASignimu&vhformat=wikitext
Stack Trace
2021-01-27 20:34:17 [YBHOSQpAAMAAAhVRoXwAAAEO] mw1388 frwiki 1.36.0-wmf.27 exception ERROR: [YBHOSQpAAMAAAhVRoXwAAAEO] /w/api.php?action=flow&format=json&submodule=view-header&uselang=fr&page=Discussion_utilisateur%3ASignimu&vhformat=wikitext   Flow\Exception\NoParserException: Request to parsoid for "html" to "wikitext" conversion of content connected to title "Discussion_utilisateur:Signimu" failed: 404 {"exception_id":"YBHOSQpAAMAAAhVRoXwAAAEO","exception_url":"/w/api.php?action=flow&format=json&submodule=view-header&uselang=fr&page=Discussion_utilisateur%3ASignimu&vhformat=wikitext","caught_by":"entrypoint"} 
[Exception Flow\Exception\NoParserException] (/srv/mediawiki/php-1.36.0-wmf.27/extensions/Flow/includes/Conversion/Utils.php:172) Request to parsoid for "html" to "wikitext" conversion of content connected to title "Discussion_utilisateur:Signimu" failed: 404
  #0 /srv/mediawiki/php-1.36.0-wmf.27/extensions/Flow/includes/Conversion/Utils.php(66): Flow\Conversion\Utils::parsoid(string, string, string, Title)
  #1 /srv/mediawiki/php-1.36.0-wmf.27/extensions/Flow/includes/Model/AbstractRevision.php(433): Flow\Conversion\Utils::convert(string, string, string, Title)
  #2 /srv/mediawiki/php-1.36.0-wmf.27/extensions/Flow/includes/Templating.php(159): Flow\Model\AbstractRevision->getContent(string)
  #3 /srv/mediawiki/php-1.36.0-wmf.27/extensions/Flow/includes/Formatter/RevisionFormatter.php(289): Flow\Templating->getContent(Flow\Model\Header, string)
  #4 /srv/mediawiki/php-1.36.0-wmf.27/extensions/Flow/includes/Block/HeaderBlock.php(331): Flow\Formatter\RevisionFormatter->formatApi(Flow\Formatter\FormatterRow, DerivativeContext)
  #5 /srv/mediawiki/php-1.36.0-wmf.27/extensions/Flow/includes/Block/HeaderBlock.php(229): Flow\Block\HeaderBlock->renderRevisionApi(string)
  #6 /srv/mediawiki/php-1.36.0-wmf.27/extensions/Flow/includes/Api/ApiFlowBaseGet.php(33): Flow\Block\HeaderBlock->renderApi(array)
  #7 /srv/mediawiki/php-1.36.0-wmf.27/extensions/Flow/includes/Api/ApiFlow.php(108): Flow\Api\ApiFlowBaseGet->execute()
  #8 /srv/mediawiki/php-1.36.0-wmf.27/includes/api/ApiMain.php(1612): Flow\Api\ApiFlow->execute()
  #9 /srv/mediawiki/php-1.36.0-wmf.27/includes/api/ApiMain.php(592): ApiMain->executeAction()
  #10 /srv/mediawiki/php-1.36.0-wmf.27/includes/api/ApiMain.php(563): ApiMain->executeActionWithErrorHandling()
  #11 /srv/mediawiki/php-1.36.0-wmf.27/api.php(90): ApiMain->execute()
  #12 /srv/mediawiki/php-1.36.0-wmf.27/api.php(45): wfApiMain()
  #13 /srv/mediawiki/w/api.php(3): require(string)
  #14 {main}

Event Timeline

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

Can someone import from logstash stack trace linked to this Request ID before it disappear?

Parsoid returns an http status code unequal to 200, which seems 404 here. That is not a Flow fault and needs some investigation on parsoid site?

Request is:

		$url = '/restbase/local/v1/transform/' . $from . '/to/' . $to . '/' .
			urlencode( $prefixedDbTitle );
		$request = [
			'method' => 'POST',
			'url' => $url,
			'body' => $params,
			'headers' => [
				'Accept' =>
					sprintf(
						'text/html; charset=utf-8; profile="https://www.mediawiki.org/wiki/Specs/HTML/%s"',
						self::PARSOID_VERSION
					),
				'User-Agent' => 'Flow-MediaWiki/' . MW_VERSION,
			],
		];

When requesting the api, the exception is still shown, but it works for other pages on frwiki - https://fr.wikipedia.org/w/api.php?action=flow&format=json&submodule=view-header&uselang=fr&page=Discussion_utilisateur%3ANemo_Le_Poisson&vhformat=wikitext

https://fr.wikipedia.org/wiki/Discussion_utilisateur:Signimu
https://fr.wikipedia.org/wiki/Discussion_utilisateur:Nemo_Le_Poisson

The discussion page looks longer than the other page. Maybe it more about a timeout on parsoid site not reporting correctly back to flow. But it showing up on index.php

Tgr added a subscriber: Tgr.

Seems like there's nothing to do here on the Flow side. Let us know if that's incorrect.

Krinkle added subscribers: Arlolra, Krinkle.

I'm re-tagging Parsoid. I'm aware this undoes @Arlolra's earlier change. I'm doing this because that was done based on the initial task filing which tagged Parsoid without a clear reason. There have since been two comments making the connection explicit, and also Growth team ruling out Flow as cause, so I'm doing this to avoid the task being in limbo.

Sorry, I might have just looked at the stack and missed the Request to parsoid for "html" to "wikitext" conversion of content connected to title "Discussion_utilisateur:Signimu" failed

Parsoid is indeed returning a 404. A live edit on scandium returns Not an available content version.,

arlolra@scandium:/srv/parsoid-testing/extension/src/Rest/Handler$ time curl -x scandium.eqiad.wmnet:80 http://fr.wikipedia.org/w/rest.php/fr.wikipedia.org/v3/page/html/Discussion_utilisateur:Signimu
{"message":"Error: exception of type MediaWiki\\Revision\\RevisionAccessException: Not an available content version.","exception":{"id":"Yi@PggVYfxmx@fg6w6xakwAAAA0","type":"MediaWiki\\Revision\\RevisionAccessException","file":"/srv/parsoid-testing/extension/src/Config/PageConfigFactory.php","line":141,"message":"Not an available content version.","code":0,"url":"/w/rest.php/fr.wikipedia.org/v3/page/html/Discussion_utilisateur:Signimu","caught_by":"other","backtrace":[{"file":"/srv/parsoid-testing/extension/src/Rest/Handler/ParsoidHandler.php","line":360,"function":"create","class":"MWParsoid\\Config\\PageConfigFactory","type":"->","args":["Title","User","NULL","NULL","NULL","array"]},{"file":"/srv/parsoid-testing/extension/src/Rest/Handler/ParsoidHandler.php","line":412,"function":"createPageConfig","class":"MWParsoid\\Rest\\Handler\\ParsoidHandler","type":"->","args":["Title","NULL","NULL","NULL"]},{"file":"/srv/parsoid-testing/extension/src/Rest/Handler/PageHandler.php","line":83,"function":"tryToCreatePageConfig","class":"MWParsoid\\Rest\\Handler\\ParsoidHandler","type":"->","args":["array"]},{"file":"/srv/mediawiki/php-1.38.0-wmf.25/includes/Rest/Router.php","line":414,"function":"execute","class":"MWParsoid\\Rest\\Handler\\PageHandler","type":"->","args":[]},{"file":"/srv/mediawiki/php-1.38.0-wmf.25/includes/Rest/Router.php","line":338,"function":"executeHandler","class":"MediaWiki\\Rest\\Router","type":"->","args":["MWParsoid\\Rest\\Handler\\PageHandler"]},{"file":"/srv/mediawiki/php-1.38.0-wmf.25/includes/Rest/EntryPoint.php","line":167,"function":"execute","class":"MediaWiki\\Rest\\Router","type":"->","args":["MediaWiki\\Rest\\RequestFromGlobals"]},{"file":"/srv/mediawiki/php-1.38.0-wmf.25/includes/Rest/EntryPoint.php","line":132,"function":"execute","class":"MediaWiki\\Rest\\EntryPoint","type":"->","args":[]},{"file":"/srv/mediawiki/php-1.38.0-wmf.25/rest.php","line":31,"function":"main","class":"MediaWiki\\Rest\\EntryPoint","type":"::","args":[]},{"file":"/srv/mediawiki/w/rest.php","line":3,"args":["string"],"function":"require"}]},"httpCode":500,"httpReason":"Internal Server Error"}

which points at this commit https://github.com/wikimedia/parsoid/commit/1931567d6c74ff2ddf754013e427320a650c7ec4

I suppose one of these things is true about the revision and maybe that shouldn't be suppressing it?
public const PAGE_UNAVAILABLE = RevisionRecord::DELETED_TEXT | RevisionRecord::DELETED_USER | RevisionRecord::DELETED_RESTRICTED;

Change 770580 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/services/parsoid@master] Use the check from RevisionRecord::getContent

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

Arlolra triaged this task as Medium priority.
Arlolra moved this task from Needs Triage to Bugs & Crashers on the Parsoid board.

Change 770580 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Use the check from RevisionRecord::getContent

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

Should go out with the train next week

I suppose one of these things is true about the revision and maybe that shouldn't be suppressing it?
public const PAGE_UNAVAILABLE = RevisionRecord::DELETED_TEXT | RevisionRecord::DELETED_USER | RevisionRecord::DELETED_RESTRICTED;

Which of these turned out to be the case? Could this be related to T302081? (Another question is: is it possible that "this was visible from flow" was the actual bug, and the revision in question *should* have been restricted?)

Which of these turned out to be the case?

I didn't try to find out. Instead, I looked at the RevisionRecord implementation in core and a call to getContent() with an audience of RevisionRecord::FOR_PUBLIC only considered RevisionRecord::DELETED_TEXT, which is analogous to what we do. I assume it's RevisionRecord::DELETED_RESTRICTED though.

Could this be related to T302081?

It's definitely related in the sense that we should do an audit of all the exposed endpoints to see if this check is applied uniformly.

(Another question is: is it possible that "this was visible from flow" was the actual bug, and the revision in question *should* have been restricted?)

It's possible, but given the people who have looked into this task above and concluded that Parsoid should be permitting access, I feel reasonably assured.

Change 772510 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.16.0-a1

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

Change 772510 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.16.0-a1

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