Page MenuHomePhabricator

Caught exception of type Flow\Exception\DataModelException when trying to submit on MediaWiki.org
Closed, ResolvedPublicPRODUCTION ERROR

Description

Steps to replicate the issue (include links if applicable):

Log for extension (getContext not working)
To be short, I'm not really a developer but our project is suffering from a lack of them so I'm trying to work on something myself. The RequestSSL extension must interact with the ManageWiki extension in order to update the server name in ManageWiki. This is done via RemoteWiki. The issue I am having is that ManageWiki has a log for all actions but when done by RemoteWiki it doesn't so a manual log needs to be added. 
I've tried to add this manual log like this, but it doesn't work (see error below). Please let me know what I'm doing wrong.

Function that isn't working: https://pastebin.com/iJv6QHMH

Error: https://pastebin.com/hDVxS8AK

Relevant files are:
https://github.com/Reception123/RequestSSL/blob/main/includes/RequestSSLManager.php (the logging method isn't included there since it doesn't work)

https://github.com/Reception123/RequestSSL/blob/main/includes/RequestSSLViewer.php

What happens?:

[0a336a7f-0d05-4f5d-b2b6-b15319d05ecd] Caught exception of type Flow\Exception\DataModelException

(No further stacktrace since this is on a WMF wiki)

What should have happened instead?:
The thread should've been submitted

Software version (skip for WMF-hosted wikis like Wikipedia):
MediaWiki

Other information (browser name/version, screenshots, etc.):

[Exception Flow\Exception\DataModelException] (/srv/mediawiki/php-1.41.0-wmf.12/extensions/Flow/includes/Model/AbstractRevision.php:600) Content not given in storage format html
  #0 /srv/mediawiki/php-1.41.0-wmf.12/extensions/Flow/includes/Model/AbstractRevision.php(585): Flow\Model\AbstractRevision->setContentRaw(array)
  #1 /srv/mediawiki/php-1.41.0-wmf.12/extensions/Flow/includes/Model/PostRevision.php(182): Flow\Model\AbstractRevision->setContent(string, string, MediaWiki\Title\Title)
  #2 /srv/mediawiki/php-1.41.0-wmf.12/extensions/Flow/includes/Block/TopicListBlock.php(145): Flow\Model\PostRevision->reply(Flow\Model\Workflow, User, string, string)
  #3 /srv/mediawiki/php-1.41.0-wmf.12/extensions/Flow/includes/Block/TopicListBlock.php(104): Flow\Block\TopicListBlock->create()
  #4 /srv/mediawiki/php-1.41.0-wmf.12/extensions/Flow/includes/Block/AbstractBlock.php(145): Flow\Block\TopicListBlock->validate()
  #5 /srv/mediawiki/php-1.41.0-wmf.12/extensions/Flow/includes/SubmissionHandler.php(121): Flow\Block\AbstractBlock->onSubmit(array)
  #6 /srv/mediawiki/php-1.41.0-wmf.12/extensions/Flow/includes/WorkflowLoader.php(62): Flow\SubmissionHandler->handleSubmit(Flow\Model\Workflow, DerivativeContext, array, string, array)
  #7 /srv/mediawiki/php-1.41.0-wmf.12/extensions/Flow/includes/Api/ApiFlowBasePost.php(20): Flow\WorkflowLoader->handleSubmit(DerivativeContext, string, array)
  #8 /srv/mediawiki/php-1.41.0-wmf.12/extensions/Flow/includes/Api/ApiFlow.php(101): Flow\Api\ApiFlowBasePost->execute()
  #9 /srv/mediawiki/php-1.41.0-wmf.12/includes/api/ApiMain.php(1913): Flow\Api\ApiFlow->execute()
  #10 /srv/mediawiki/php-1.41.0-wmf.12/includes/api/ApiMain.php(889): ApiMain->executeAction()
  #11 /srv/mediawiki/php-1.41.0-wmf.12/includes/api/ApiMain.php(860): ApiMain->executeActionWithErrorHandling()
  #12 /srv/mediawiki/php-1.41.0-wmf.12/api.php(95): ApiMain->execute()
  #13 /srv/mediawiki/php-1.41.0-wmf.12/api.php(48): wfApiMain()

Event Timeline

It has been noted in # mediawiki on IRC just a minute ago that another user has also received the same error.

Reedy changed the subtype of this task from "Bug Report" to "Production Error".Jun 6 2023, 7:08 PM
Ladsgroup triaged this task as Unbreak Now! priority.Jun 6 2023, 7:17 PM
Ladsgroup subscribed.

It seems likely that this was caused by https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Flow/+/923648/, but it is not obvious to me what exactly is happening.

I see about 60 of these in logstash over the last 24 hours https://logstash.wikimedia.org/goto/08e6a3ee643b0e801b4f05ce69ac2124, all coming from mediawiki.org (which makes sense, since wmf.12 is only on group0 so far).

The issue is triggered by line breaks in the message. The reason is a missing "dotall" modifier on a regex. We should have a patch ready for backport in an hour or two.

Change 927994 had a related patch set uploaded (by D3r1ck01; author: Derick Alangi):

[mediawiki/extensions/Flow@master] Conversion: Fix regex for body extraction of HTML

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

Change 927700 had a related patch set uploaded (by D3r1ck01; author: Derick Alangi):

[mediawiki/extensions/Flow@wmf/1.41.0-wmf.12] Conversion: Fix regex for body extraction of HTML

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

Change 927995 had a related patch set uploaded (by Richika Rana; author: Richika Rana):

[mediawiki/extensions/Flow@master] Enable 'single-line' mode in preg_match for wikitextToHTML regex

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

Change 927994 abandoned by D3r1ck01:

[mediawiki/extensions/Flow@master] Conversion: Fix regex for body extraction of HTML

Reason:

Going forward with https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Flow/+/927995 as it has test cases.

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

Change 927700 abandoned by D3r1ck01:

[mediawiki/extensions/Flow@wmf/1.41.0-wmf.12] Conversion: Fix regex for body extraction of HTML

Reason:

Going forward with https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Flow/+/927995 as it comes with mocha test.

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

Change 927702 had a related patch set uploaded (by D3r1ck01; author: Richika Rana):

[mediawiki/extensions/Flow@wmf/1.41.0-wmf.12] Enable 'single-line' mode in preg_match for wikitextToHTML regex

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

Change 927995 merged by jenkins-bot:

[mediawiki/extensions/Flow@master] Enable 'multi-line' mode in preg_match() for wikitextToHTML regex

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

Change 927702 merged by jenkins-bot:

[mediawiki/extensions/Flow@wmf/1.41.0-wmf.12] Enable 'multi-line' mode in preg_match() for wikitextToHTML regex

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

Mentioned in SAL (#wikimedia-operations) [2023-06-07T14:01:23Z] <lucaswerkmeister-wmde@deploy1002> Started scap: Backport for [[gerrit:927702|Enable 'multi-line' mode in preg_match() for wikitextToHTML regex (T338264)]]

Mentioned in SAL (#wikimedia-operations) [2023-06-07T14:02:59Z] <lucaswerkmeister-wmde@deploy1002> d3r1ck01 and lucaswerkmeister-wmde: Backport for [[gerrit:927702|Enable 'multi-line' mode in preg_match() for wikitextToHTML regex (T338264)]] synced to the testservers: mwdebug1001.eqiad.wmnet, mwdebug1002.eqiad.wmnet, mwdebug2001.codfw.wmnet, mwdebug2002.codfw.wmnet

Mentioned in SAL (#wikimedia-operations) [2023-06-07T14:10:39Z] <lucaswerkmeister-wmde@deploy1002> Finished scap: Backport for [[gerrit:927702|Enable 'multi-line' mode in preg_match() for wikitextToHTML regex (T338264)]] (duration: 09m 16s)

We confirm after deployment that the issue has been fixed. I'll leave this to train conductors to re-triage and resolve after checking logs. Thanks to all deployers esp. @LucasWerkmeister for helping to deploy the patch today.

jeena claimed this task.
jeena subscribed.

It appears that the issue has been resolved.