st2flow icon indicating copy to clipboard operation
st2flow copied to clipboard

Orquesta workflow: Saving the definition again results in dup key error

Open m4dcoder opened this issue 6 years ago • 6 comments

I modified the workflow metadata (try something different on the input parameter) and tried to save the workflow again. st2flow returns a DB error saying the workflow already exists.

m4dcoder avatar Mar 11 '19 19:03 m4dcoder

Saw this happen once but am having trouble replicating. @m4dcoder if you can replicate, please post the steps.

bmomberger-bitovi avatar Mar 19 '19 03:03 bmomberger-bitovi

Here's steps from Nick:

  • Go to Actions tab
  • Select a pack that you want to put your new workflow in
  • Press the + button
  • When EWC comes up, fill out the Name and Entry Point fields
  • Click Save
  • Edit the Description field
  • Click Save
  • Error Error saving workflow.: Tried to save duplicate unique keys (E11000 duplicate key error collection: st2.action_d_b index: uid_1 dup key: { : "action:default:nicktest3" })

Have not tested this myself

LindsayHill avatar Apr 12 '19 17:04 LindsayHill

I can replicate it relatively easily myself:

Select a pack that you want to put your new workflow in Press the + button When EWC comes up, fill out the Name and Entry Point fields Click Save Add a few actions and link them in a sequence Click Save

Error saving workflow.: Tried to save duplicate unique keys (E11000 duplicate key error collection: st2.action_d_b index: uid_1 dup key: { : "action:training:sequence1" })

I can provide a system in a faulty state if needed.

blourdel avatar Apr 29 '19 09:04 blourdel

This was fixed in v3.0.0, but not 100%.

There is still a race / edge case if you click save button twice in quick succession before workflow gets saved and actions re fetched. See https://github.com/StackStorm/st2flow/pull/355#issuecomment-486566778 for details.

Which version are you using?

Kami avatar Apr 29 '19 10:04 Kami

I am using st2 3.0dev (2f5fa9b), on Python 2.7.12

Compared to #355 : in my case I did not act quickly and once you are in trouble the only workaround is to save under a different name.

blourdel avatar Apr 29 '19 13:04 blourdel

It looks like you are using old version (2f5fa9b is 13 days old and doesn't include fixes we made for v3.0.0 mid to late last week (you can also confirm st2flow package version by doing dpkg -l |grep st2flow).

Please try upgrading - v3.0.0 stable is now out so you can directly upgrade to latest enterprise stable packages.

Kami avatar Apr 29 '19 14:04 Kami