Page MenuHomePhabricator

html2wt: Argument of incorrect type passed to serializeFromParts()
Closed, ResolvedPublic

Description

URL: /w/rest.php/no.wikipedia.org/v3/transform/pagebundle/to/wikitext/Liste_over_Norges_barne-%2C_familie-%2C_likestillings-_og_inkluderingsministre/21852104
Error: Argument 3 passed to Wikimedia\Parsoid\Html2Wt\WikitextSerializer::serializeFromParts() must be of the type array, string given, called in /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Html2Wt/DOMHandlers/EncapsulatedContentHandler.php on line 46
Trace:

from /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Html2Wt/WikitextSerializer.php(921)
#0 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Html2Wt/DOMHandlers/EncapsulatedContentHandler.php(46): Wikimedia\Parsoid\Html2Wt\WikitextSerializer->serializeFromParts(Wikimedia\Parsoid\Html2Wt\SerializerState, Wikimedia\Parsoid\DOM\Compat\Element, string)
#1 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Html2Wt/WikitextSerializer.php(1251): Wikimedia\Parsoid\Html2Wt\DOMHandlers\EncapsulatedContentHandler->handle(Wikimedia\Parsoid\DOM\Compat\Element, Wikimedia\Parsoid\Html2Wt\SerializerState, boolean)
#2 [internal function]: Wikimedia\Parsoid\Html2Wt\WikitextSerializer->serializeNodeInternal(Wikimedia\Parsoid\DOM\Compat\Element, Wikimedia\Parsoid\Html2Wt\DOMHandlers\EncapsulatedContentHandler)
#3 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Html2Wt/WikitextSerializer.php(1343): call_user_func(array, Wikimedia\Parsoid\DOM\Compat\Element, Wikimedia\Parsoid\Html2Wt\DOMHandlers\EncapsulatedContentHandler)
#4 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Html2Wt/SerializerState.php(706): Wikimedia\Parsoid\Html2Wt\WikitextSerializer->serializeNode(Wikimedia\Parsoid\DOM\Compat\Element)
#5 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Html2Wt/DOMHandlers/TDHandler.php(66): Wikimedia\Parsoid\Html2Wt\SerializerState->serializeChildren(Wikimedia\Parsoid\DOM\Compat\Element, Closure)
#6 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Html2Wt/WikitextSerializer.php(1251): Wikimedia\Parsoid\Html2Wt\DOMHandlers\TDHandler->handle(Wikimedia\Parsoid\DOM\Compat\Element, Wikimedia\Parsoid\Html2Wt\SerializerState, boolean)
#7 [internal function]: Wikimedia\Parsoid\Html2Wt\WikitextSerializer->serializeNodeInternal(Wikimedia\Parsoid\DOM\Compat\Element, Wikimedia\Parsoid\Html2Wt\DOMHandlers\TDHandler)
#8 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Html2Wt/WikitextSerializer.php(1343): call_user_func(array, Wikimedia\Parsoid\DOM\Compat\Element, Wikimedia\Parsoid\Html2Wt\DOMHandlers\TDHandler)
#9 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Html2Wt/SerializerState.php(706): Wikimedia\Parsoid\Html2Wt\WikitextSerializer->serializeNode(Wikimedia\Parsoid\DOM\Compat\Element)
#10 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Html2Wt/DOMHandlers/TRHandler.php(38): Wikimedia\Parsoid\Html2Wt\SerializerState->serializeChildren(Wikimedia\Parsoid\DOM\Compat\Element)
#11 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Html2Wt/WikitextSerializer.php(1251): Wikimedia\Parsoid\Html2Wt\DOMHandlers\TRHandler->handle(Wikimedia\Parsoid\DOM\Compat\Element, Wikimedia\Parsoid\Html2Wt\SerializerState, boolean)
#12 [internal function]: Wikimedia\Parsoid\Html2Wt\WikitextSerializer->serializeNodeInternal(Wikimedia\Parsoid\DOM\Compat\Element, Wikimedia\Parsoid\Html2Wt\DOMHandlers\TRHandler)
#13 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Html2Wt/WikitextSerializer.php(1343): call_user_func(array, Wikimedia\Parsoid\DOM\Compat\Element, Wikimedia\Parsoid\Html2Wt\DOMHandlers\TRHandler)
#14 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Html2Wt/SerializerState.php(706): Wikimedia\Parsoid\Html2Wt\WikitextSerializer->serializeNode(Wikimedia\Parsoid\DOM\Compat\Element)
#15 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Html2Wt/DOMHandlers/JustChildrenHandler.php(21): Wikimedia\Parsoid\Html2Wt\SerializerState->serializeChildren(Wikimedia\Parsoid\DOM\Compat\Element)
#16 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Html2Wt/WikitextSerializer.php(1251): Wikimedia\Parsoid\Html2Wt\DOMHandlers\JustChildrenHandler->handle(Wikimedia\Parsoid\DOM\Compat\Element, Wikimedia\Parsoid\Html2Wt\SerializerState, boolean)
#17 [internal function]: Wikimedia\Parsoid\Html2Wt\WikitextSerializer->serializeNodeInternal(Wikimedia\Parsoid\DOM\Compat\Element, Wikimedia\Parsoid\Html2Wt\DOMHandlers\JustChildrenHandler)
#18 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Html2Wt/WikitextSerializer.php(1343): call_user_func(array, Wikimedia\Parsoid\DOM\Compat\Element, Wikimedia\Parsoid\Html2Wt\DOMHandlers\JustChildrenHandler)
#19 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Html2Wt/SerializerState.php(706): Wikimedia\Parsoid\Html2Wt\WikitextSerializer->serializeNode(Wikimedia\Parsoid\DOM\Compat\Element)
#20 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Html2Wt/DOMHandlers/TableHandler.php(39): Wikimedia\Parsoid\Html2Wt\SerializerState->serializeChildren(Wikimedia\Parsoid\DOM\Compat\Element)
#21 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Html2Wt/WikitextSerializer.php(1251): Wikimedia\Parsoid\Html2Wt\DOMHandlers\TableHandler->handle(Wikimedia\Parsoid\DOM\Compat\Element, Wikimedia\Parsoid\Html2Wt\SerializerState, boolean)
#22 [internal function]: Wikimedia\Parsoid\Html2Wt\WikitextSerializer->serializeNodeInternal(Wikimedia\Parsoid\DOM\Compat\Element, Wikimedia\Parsoid\Html2Wt\DOMHandlers\TableHandler)
#23 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Html2Wt/WikitextSerializer.php(1343): call_user_func(array, Wikimedia\Parsoid\DOM\Compat\Element, Wikimedia\Parsoid\Html2Wt\DOMHandlers\TableHandler)
#24 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Html2Wt/SerializerState.php(706): Wikimedia\Parsoid\Html2Wt\WikitextSerializer->serializeNode(Wikimedia\Parsoid\DOM\Compat\Element)
#25 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Html2Wt/SerializerState.php(732): Wikimedia\Parsoid\Html2Wt\SerializerState->serializeChildren(Wikimedia\Parsoid\DOM\Compat\Element, NULL)
#26 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Html2Wt/WikitextSerializer.php(1612): Wikimedia\Parsoid\Html2Wt\SerializerState->kickOffSerialize(Wikimedia\Parsoid\DOM\Compat\Element)
#27 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Html2Wt/SelectiveSerializer.php(236): Wikimedia\Parsoid\Html2Wt\WikitextSerializer->serializeDOM(Wikimedia\Parsoid\DOM\Compat\Element, boolean)
#28 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Core/WikitextContentModelHandler.php(168): Wikimedia\Parsoid\Html2Wt\SelectiveSerializer->serializeDOM(Wikimedia\Parsoid\DOM\Compat\Document)
#29 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Parsoid.php(285): Wikimedia\Parsoid\Core\WikitextContentModelHandler->fromDOM(Wikimedia\Parsoid\Config\Env, Wikimedia\Parsoid\Core\SelserData)
#30 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/extension/src/Rest/Handler/ParsoidHandler.php(827): Wikimedia\Parsoid\Parsoid->dom2wikitext(MWParsoid\Config\PageConfig, Wikimedia\Parsoid\DOM\Compat\Document, array, Wikimedia\Parsoid\Core\SelserData)
#31 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/extension/src/Rest/Handler/TransformHandler.php(133): MWParsoid\Rest\Handler\ParsoidHandler->html2wt(MWParsoid\Config\PageConfig, array, string)
#32 /srv/mediawiki/php-1.37.0-wmf.23/includes/Rest/Router.php(403): MWParsoid\Rest\Handler\TransformHandler->execute()
#33 /srv/mediawiki/php-1.37.0-wmf.23/includes/Rest/Router.php(330): MediaWiki\Rest\Router->executeHandler(MWParsoid\Rest\Handler\TransformHandler)
#34 /srv/mediawiki/php-1.37.0-wmf.23/includes/Rest/EntryPoint.php(165): MediaWiki\Rest\Router->execute(MediaWiki\Rest\RequestFromGlobals)
#35 /srv/mediawiki/php-1.37.0-wmf.23/includes/Rest/EntryPoint.php(130): MediaWiki\Rest\EntryPoint->execute()
#36 /srv/mediawiki/php-1.37.0-wmf.23/rest.php(31): MediaWiki\Rest\EntryPoint::main()
#37 /srv/mediawiki/w/rest.php(3): require(string)
#38 {main}

Event Timeline

Right, I noticed the same thing as well that day when I looked at this. So, my thought was that this was probably some client that had a bug. I assumed this is not VE ... but, yes, I only have speculation, no answers.

I found this in Logstash (I couldn't use the Phacility option there because the payload was too large).

my thought was that this was probably some client that had a bug

Did you check the user agent?

I looked for this error message in logstash but didn't come up with anything

The user agent is useless since all requests come proxied through RESTBase and afaik, RESTBase doesn't pass it along unless something has changed there. I'll look for the req in logstash later and see if I can find it.

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

[mediawiki/services/parsoid@master] Raise a client error if data-mw->parts is not an array

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

Arlolra triaged this task as Medium priority.Sep 23 2021, 10:38 PM
Arlolra moved this task from Needs Triage to Bugs & Crashers on the Parsoid board.

Change 723323 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Raise a client error if data-mw->parts is not an array

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

Arlolra claimed this task.

I looked for this error message in logstash but didn't come up with anything

reqid a2ccafae-ab11-44eb-862a-1fb324305ff3
https://logstash.wikimedia.org/app/discover#/doc/logstash-*/logstash-deploy-2021.09.20?id=EA7YAnwB1RMACsoSB2pP

Change 724142 had a related patch set uploaded (by Sbailey; author: Sbailey):

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

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

Change 724142 merged by jenkins-bot:

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

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

  NODES
Bugs 2
INTERN 10
Note 1
Project 4