See fatal monitor from scandium to find a number of instances of this from recent roundtrip test runs. This error always manifests invalid offsets into the $pieces array in the loop (lines 1423, 1424, 1470 of WikitextSerializer.php).
Here are some possible test pages:
- eswiki:Selecci%C3%B3n%20de%20f%C3%BAtbol%20de%20Guatemala
- enwiki:Moons of Pluto
- enwiki:/Von_Mises_yield_criterion
This may be reproducible by running the roundtrip-test.js script on scandium. You are unlikely to be able to reproduce this locally via the bin/parse.php script since the code paths involved in compute the regexps are different and may not have the bug. Alternatively, you can do a Special:Export of the pages from the production wikis and Special:Import those onto your local wiki and run tests locally.
/w/rest.php/es.wikipedia.org/v3/transform/pagebundle/to/wikitext/Selecci%C3%B3n%20de%20f%C3%BAtbol%20de%20Guatemala ErrorException from line 1423 of /srv/deployment/parsoid/deploy/src/src/Html2Wt/WikitextSerializer.php: PHP Notice: Undefined offset: 50
#0 /srv/deployment/parsoid/deploy/src/src/Html2Wt/WikitextSerializer.php(1423): MWExceptionHandler::handleError(integer, string, string, integer, array) #1 /srv/deployment/parsoid/deploy/src/src/Html2Wt/WikitextSerializer.php(1650): Parsoid\Html2Wt\WikitextSerializer->stripUnnecessaryIndentPreNowikis() #2 /srv/deployment/parsoid/deploy/src/src/WikitextContentModelHandler.php(99): Parsoid\Html2Wt\WikitextSerializer->serializeDOM(DOMElement) #3 /srv/deployment/parsoid/deploy/src/src/Parsoid.php(105): Parsoid\WikitextContentModelHandler->fromHTML(Parsoid\Config\Env, DOMDocument, NULL) #4 /srv/deployment/parsoid/deploy/src/extension/src/Rest/Handler/ParsoidHandler.php(671): Parsoid\Parsoid->html2wikitext(MWParsoid\Config\PageConfig, Parsoid\PageBundle, array, NULL) #5 /srv/deployment/parsoid/deploy/src/extension/src/Rest/Handler/TransformHandler.php(62): MWParsoid\Rest\Handler\ParsoidHandler->html2wt(Parsoid\Config\Env, array, string) #6 /srv/mediawiki/php-1.34.0-wmf.21/includes/Rest/Router.php(270): MWParsoid\Rest\Handler\TransformHandler->execute() #7 /srv/mediawiki/php-1.34.0-wmf.21/includes/Rest/Router.php(254): MediaWiki\Rest\Router->executeHandler(MWParsoid\Rest\Handler\TransformHandler) #8 /srv/mediawiki/php-1.34.0-wmf.21/includes/Rest/EntryPoint.php(82): MediaWiki\Rest\Router->execute(MediaWiki\Rest\RequestFromGlobals) #9 /srv/mediawiki/php-1.34.0-wmf.21/includes/Rest/EntryPoint.php(68): MediaWiki\Rest\EntryPoint->execute() #10 /srv/mediawiki/php-1.34.0-wmf.21/rest.php(28): MediaWiki\Rest\EntryPoint::main() #11 /srv/mediawiki/w/rest.php(3): require(string) #12 {main}