Last modified: 2014-01-21 16:42:50 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T60996, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 58996 - Flow: intermittent: 'exception caught: failed insert'
Flow: intermittent: 'exception caught: failed insert'
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Flow (Other open bugs)
unspecified
All All
: High normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: browser-test-bug
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-12-27 16:17 UTC by Chris McMahon
Modified: 2014-01-21 16:42 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Flow exception (190.55 KB, image/png)
2013-12-27 16:17 UTC, Chris McMahon
Details

Description Chris McMahon 2013-12-27 16:17:17 UTC
Created attachment 14176 [details]
Flow exception

Seen in Chrome on beta labs 27 Dec: 

For logged in user
Upon clicking the button to save edited Post information
Get red error message 'exception caught: failed insert'

Screen shot attached, also see https://saucelabs.com/jobs/91190676b4e34594886a5a881073464a for video.
Comment 1 Bingle 2013-12-27 16:36:24 UTC
The WMF core features team tracks this bug on Mingle card https://mingle.corp.wikimedia.org/projects/flow/cards/660, but people from the community are welcome to contribute here and in Gerrit.
Comment 2 Chris McMahon 2013-12-27 16:39:08 UTC
link: http://en.wikipedia.beta.wmflabs.org/wiki/Talk:Flow_QA
Comment 3 spage 2013-12-27 22:20:04 UTC
(FYI to see beta labs errors, you need to be in the deployment-prep wmflabs project, then ssh deployment-bastion via bastion.wmflabs.org, then look in /data/project/logs .)

The test is the Selenium_user editing her own first post on her own new topic and submitting it.  It's failed on December 26 and December 27 with DB error: 
  Duplicate entry '<UUID thingy>' for key 'flow_revision_unique_parent' (10.4.0.53)

exception.log contains

2013-12-27 15:36:24 deployment-apache32 enwiki: [63f46b3a] /w/api.php   Exception from line 497 of /data/project/apache/common-local/php-master/extensions/Flow/includes/Data/ObjectManager.php: failed insert
#0 /data/project/apache/common-local/php-master/extensions/Flow/includes/Data/ObjectManager.php(469): Flow\Data\ObjectManager->insert(Object(Flow\Model\PostRevision))
#1 /data/project/apache/common-local/php-master/extensions/Flow/includes/Data/ObjectManager.php(167): Flow\Data\ObjectManager->put(Object(Flow\Model\PostRevision))
#2 /data/project/apache/common-local/php-master/extensions/Flow/includes/Block/Topic.php(296): Flow\Data\ManagerGroup->put(Object(Flow\Model\PostRevision))
#3 /data/project/apache/common-local/php-master/extensions/Flow/includes/WorkflowLoader.php(204): Flow\Block\TopicBlock->commit()
#4 /data/project/apache/common-local/php-master/extensions/Flow/includes/api/ApiFlow.php(59): Flow\WorkflowLoader->commit(Object(Flow\Model\Workflow), Array)
#5 /data/project/apache/common-local/php-master/includes/api/ApiMain.php(862): ApiFlow->execute()
#6 /data/project/apache/common-local/php-master/includes/api/ApiMain.php(387): ApiMain->executeAction()
#7 /data/project/apache/common-local/php-master/includes/api/ApiMain.php(358): ApiMain->executeActionWithErrorHandling()
#8 /data/project/apache/common-local/php-master/api.php(76): ApiMain->execute()

(I think Benny has a fix to actually print the exception details.)

The earlier exception.log error on 2013-12-26 15:29:43 is identical.

dberror.log contains:
  Fri Dec 27 15:36:24 UTC 2013
  deployment-apache32
  enwiki
  Flow\Data\RevisionStorage::insert
  10.4.0.53
  1062
  Duplicate entry '^E^LÊÓ^Wý4¹@^]^B^V>92^?' for key 'flow_revision_unique_parent' (10.4.0.53)
  INSERT  INTO `flow_revision`
         (rev_id,rev_user_id,rev_user_text,rev_parent_id,
rev_change_type,rev_type,rev_content,rev_flags,rev_mod_state,rev_mod_user_id,rev_mod_user_text,rev_mod_timestamp,rev_mod_reason,rev_last_edit_id,rev_edit_user_id,rev_edit_user_text)
  VALUES (
          '^E^LÒÌ^\¥4¹@^]^B^V>92^?',
          '820',
          'Selenium user',
          '^E^LÊÓ^Wý4¹@^]^B^V>92^?',
          'flow-edit-post',
          'post',
          '-Ʊ\nÂ0^P\0Ðݯ8ºt<89>õ®iÒTj^G^Gg^G7q<88>^<84><80>p!  ^T^QÿÝÅ7½9^Aûê·Éç\"<91>^Oí§  á<92><9b>ý^U<95>Ó\n^UÞ¾ír^T~<83><áô<92>^U.<92>â^C;\"íHOÎØÁ^Q\ZÓÃ=ËZB®¡T^H^\ëæ,ÿ^EÆn\ZFCco  ¬EDMó.-?',
          'utf-8,gzip,html',
          '',NULL,NULL,NULL,NULL,'^E^LÒÌ^\¥4¹@^]^B^V>92^?',
          '820',
          'Selenium user'
  )

and the earlier error has a similar dberror.log line: the inserted rev_parent_id triggers 
  Duplicate entry '^E^L¶' for key 'flow_revision_unique_parent' (10.4.0.53)

(^the actual parent_id is longer but the dberror log message is confused by the funky UUID characters; this might be part of the problem?
Comment 4 spage 2013-12-28 01:32:45 UTC
This is an edit conflict.  It happens when overlapping Flow browser tests both try to edit the first post on a board.

The api.log contains (URL decoded)

2013-12-27 15:36:24 deployment-apache32 enwiki: API POST 
Selenium_user 162.222.73.153 T=439ms 
format=json action=flow flowaction=edit-post workflow=050ccad317f534b9401d02163e39327f params={"topic":
  {"postId":"050ccad317fd34b9401d02163e39327f",
   "content":"Body of Flow Topic0.11381398564810552 browsertest edit\nPost edited0.4848066854649976"}
} token=abfff42f2b6779b57593fea823a02f72+\ render=true

2013-12-27 15:36:24 deployment-apache32 enwiki: API POST 
Selenium_user 162.222.73.155 T=261ms 
format=json action=flow flowaction=edit-post workflow=050ccad317f534b9401d02163e39327f params={"topic":
  {"postId":"050ccad317fd34b9401d02163e39327f",
   "content":"Body of Flow Topic0.11381398564810552 browsertest edit\nPost edited0.947517256600031"}
} token=2e411023ff7ca5f37a6a74793562d0cf+\ render=true

I.e. two different IPs both editing the same post. One succeeds, the other reports the API error. It should report an edit conflict to the user.

I filed bug 59011 for the browser test to avoid the possible edit conflict.
Comment 5 Chris McMahon 2013-12-30 15:25:15 UTC
Is there a story to handle edit conflict gracefully?
Comment 6 Quiddity 2013-12-30 19:54:18 UTC
(In reply to comment #5)
> Is there a story to handle edit conflict gracefully?

Yup, currently in-dev by Matthias, according to https://mingle.corp.wikimedia.org/projects/flow/cards/318
Comment 7 Quiddity 2013-12-31 02:38:13 UTC
I'm getting the same error message ("An error occurred. The error message received was: Exception Caught: failed insert") when I try to "restore" Spage's post here: https://www.mediawiki.org/w/index.php?title=Talk:Sandbox&workflow=050bcc286f7e63ea2e7090b11c26f43c#flow-post-050bf86d5a12f77986f090b11c278532
Comment 8 Quiddity 2013-12-31 02:42:50 UTC
(In reply to comment #7)

Hmm, my Special:Contributions claims that I successfully unhid the post:

"02:34, 31 December 2013 (topic | history) . . (0)‎ . . Quiddity (WMF) (talk | contribs | block) restored a comment (Unfoo! (useful comment, unhiding for access))."

But the post is still hidden, and there's no new entry in the Topic-History https://www.mediawiki.org/w/index.php?title=Talk:Sandbox&workflow=050bcc286f7e63ea2e7090b11c26f43c&action=topic-history
Comment 9 Gerrit Notification Bot 2014-01-08 23:18:01 UTC
Change 106449 had a related patch set uploaded by EBernhardson:
Track the root of a post tree explicitly

https://gerrit.wikimedia.org/r/106449
Comment 10 Gerrit Notification Bot 2014-01-21 16:42:50 UTC
Change 106449 merged by jenkins-bot:
Track the root of a post tree explicitly

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links