umbraco / Umbraco.Forms.Issues

Public issue tracker for Umbraco Forms
30 stars 0 forks source link

Plan failed at step 44949e12-e4ef-42c0-949b-67286b946fe0 #1292

Closed Wiggee11 closed 1 month ago

Wiggee11 commented 2 months ago

We have migrated a number of websites from Umbraco 10 and Umbraco 13 and when running the Umbraco Forms migrations we are now seeing this error quite frequently.

Plan failed at step 44949e12-e4ef-42c0-949b-67286b946fe0

Because the migrations run on start up, this error is logged every time the app starts because the migration cannot complete.

Specifics

Umbraco 13.3.0 Umbraco Forms 13.0.2


This item has been added to our backlog AB#43983

AndyButland commented 2 months ago

It looks like it's trying to update the "insert form" macro on this migration step. Do you happen to see any other errors in the logs just before this that might indicate why this is being triggered please?

git-wizard commented 1 month ago

@AndyButland So i've been looking into this, however, since forms isn't open source it's been a little difficult. I found where it fails the migration:

image

Latest site I've upgraded is on Umbraco Forms 13.2.1, Umbraco 13.4.1

The else gets hit here, even though there is already a RedirectToPageId in the cmsMacroProperty table. Our sites have all had this issue so far when we first deploy to staging/ live. Only now have we actually experienced issues in the front end and backoffice due to this though.

The RedirectToPageId macro has the uniquePropertyId of A7817FA7-BE9A-42E8-BB8C-089186CE7516 and when it get's to that method above, it gets to the else and breaks when it tries to add the same property (with a different guid) to byId.Properties

This results in the "Plan failed at step 44949e12-e4ef-42c0-949b-67286b946fe0" error that we're seeing in each of our site upgrades recently.

I could see in our logs that the last migration being run before the error was within the AddRedirectToPageIdToMacro.

I manually updated the uniquePropertyId to the guid in the UpdateFormMacro method 2B134A1A-AAEE-42B1-8277-AD8FFDCC70A3. This resulted in the issue being resolved for the time being, but we don't want to have to do this for every deployment, especially on live.

AndyButland commented 1 month ago

Thanks for the debugging on this. So it seems clear why there's an error - and we can fix this by having a check not just for the expected key but also for the alias, and then avoid adding it if it's already there.

I'm a bit confused why the RedirectToPageId macro property exists with a different key in your installation. As you can see we create this in the migration with a specified key. But perhaps if the macro is resaved or some other CMS operation occurs, the key can get updated.

AndyButland commented 1 month ago

We'll include this in the next patch release for Forms 13.

git-wizard commented 1 month ago

That's great thank you.