Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forms: Duplicate form key stored in database #402

Closed
ronaldbarendse opened this issue Sep 15, 2020 · 40 comments
Closed

Forms: Duplicate form key stored in database #402

ronaldbarendse opened this issue Sep 15, 2020 · 40 comments

Comments

@ronaldbarendse
Copy link

ronaldbarendse commented Sep 15, 2020

Apparently it's possible to store form data multiple times using the same key in the UFForms table:

UFForms

Reproduction

Bug summary

After adding a new workflow to a form and trying to save it, I got a validator error (forgot to enter an email subject), I fixed this and saved the form again. The save button changed from the progress/loading animation to a cross and none of the forms loaded anymore, because an exception.

Specifics

Umbraco Forms 8.5.3
Umbraco 8.6.4

System.InvalidOperationException: Sequence contains more than one matching element
   at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   at Umbraco.Forms.Web.Editors.FormSecurityController.GetByUserId(Int32 userId)

Expected result

I would expect the key column to be unique, so this can't happen in the first place. As an additional bonus, making it an unique index will speed up the lookup (especially if you have a lot of forms). Besides that, it should always check whether the form already exists in the database!


This item has been added to our backlog AB#8286

@ronaldbarendse
Copy link
Author

To fix the exception, I've manually copied the data from the Definition column of the last saved row (ID 9) back to the first one (ID 6) and removed the duplicate. This ensures the same ID, created and updates dates are kept and the incorrecly added row is deleted...

@nul800sebastiaan nul800sebastiaan added state/sprint-candidate We're trying to get this in a sprint at HQ in the next few weeks type/bug labels Sep 15, 2020
@ronaldbarendse ronaldbarendse changed the title Duplicate form stored in database Duplicate form key stored in database Sep 15, 2020
@ronaldbarendse
Copy link
Author

After encountering the same issue, I've compared the data in the Definition column (as all other colums were the same):

The first row (with ID 6) contained:

"Id":0,
"Key":"7e1365db-406c-44d6-95ca-4b966167879b",
"CreateDate":"2020-07-23T14:33:08.29Z",
"UpdateDate":"2020-09-18T14:31:43.2475711+02:00"

And the dulicate row:

"Id":6,
"Key":"7e1365db-406c-44d6-95ca-4b966167879b",
"CreateDate":"2020-07-23T14:33:08.29Z",
"UpdateDate":"2020-09-18T14:31:43.2085948+02:00"

So it looks like both rows are updated, but the duplicate is saved first (looking at the UpdateDate) and also contains the original numeric ID of the row 😕

@azure-devops-sync azure-devops-sync bot changed the title Duplicate form key stored in database Forms: Duplicate form key stored in database Sep 21, 2020
@lukehook
Copy link

lukehook commented Oct 2, 2020

@ronaldbarendse I experienced this exact same issue in Umbraco Cloud. I also couldn't delete the row from the SQL database as I didn't have significant permissions (or it was kicking off about something). The kind fellas at Umbraco Cloud Support removed the entry for me but my experience was EXACTLY the same.

I was editing a workflow to change an email value, I hit save, cta changed to a cross (Sidenote, I feel this UX needs to be clearer as it's not that obvious unless you're paying attention that something hasn't worked) - then reloading the forms page just broke entirely as there were duplicate entries.

Might not be useful, but this was the error in the repeater when a duplicate entry was found in the DB

image (7)

@seekingcode18
Copy link

I have also faced this issue on Umbraco Cloud. Support was able to delete the duplicate for me but it's only a temporary fix. Whenever I update a workflow, the entire form is duplicated and thus becomes unusable. I wonder if checking for a duplicate ID when the form is saved or updated in the database would help address this..?

@seekingcode18
Copy link

Incidentally, the workflows themselves seem to duplicate. Last time I logged in, there was only one of these and now there are four.

image

@nul800sebastiaan
Copy link
Member

@ronaldbarendse I only just now saw that the problem Definition here is showing a very slight but interesting difference: #402 (comment)

image

So the update time is merely 4 milliseconds different. Could it be that there was an app pool recycle when saving the Form? I'm thinking it might be related to the fixes with did with unsubscribing from event handlers: umbraco/Umbraco-CMS#8815

I notice you're on 8.6.4, can @seekingcode18 and @lukehook confirm they were also on 8.6.4 when this happened?

I'm thinking that an overlapping application pool might be the cause here, so both app pools still processed the Save action which is what caused a duplicate to be added? Although.. hmm, well then the int identifiers wouldn't be so far apart I guess.

@seekingcode18
Copy link

@nul800sebastiaan I'm on Umbraco 8.8.0 and Forms 8.5.3

@ronaldbarendse
Copy link
Author

@nul800sebastiaan The chances of an application recycle and saving the form at the same time are astronomically small. Because I've already encountered this multiple times myself and others have reported it too, this would also make that very unlikely.

The main issue is that it's currently technically possible to store the same form in different rows, so either the Key column should get an unique index or the Id column should be dropped in favour of using the GUID identifier.

@nul800sebastiaan
Copy link
Member

It's really not that small since we apparently have for a long time not been shutting down the old app pool in a timely manner, the overlap between app pools might actually be quite long.

Yes, I know what the technical problem is, but that doesn't give me a cause of the issue, of course we need to prevent duplicate keys from being able to exist. I would really like to repro this issue while we work on a fix and so far it's not been possible to repro.

@seekingcode18 could you show what your database looks like in the UFWorkflows column, I would love to see the Definition column most of all for those duplicates. This might be sensitive info so if you want you can mail it to me at sj @ umbraco. dk (remove spaces).

@seekingcode18
Copy link

@nul800sebastiaan unfortunately I don't have the site or db on my machine as I've been working with it in Umbraco Cloud and Kudu. Would it be helpful if I add you to the project instead? I can try and get the db working locally but it may take a couple of days as I haven't done that with Umbraco before.

Steps to reproduce for me are: open a form in the backend, edit a workflow, and save a workflow. When I try to access any forms again, it throws that error.

@nul800sebastiaan
Copy link
Member

@seekingcode18 Ah, that would work for me too, can you invite me on that email address then I can have a look to see what is stored at least. Thanks!

@seekingcode18
Copy link

@nul800sebastiaan will do, thank you for looking into it!

@lukehook
Copy link

@nul800sebastiaan apologies I can't quite remember the version it was when I received the error. Forms 8.6.3 maybe?! It was an Umbraco Cloud project so has autograded since.

If it makes a difference, the errors occurred immediately after activating Forms in the Database. It was the first time I had edited a workflow (the razor email one if it helps to be specific) since 'migrating' or activating it. I no longer work on the solution but I think it's been fine since.

I don't know if this correlates to anyone elses experience but thought it worth mentioning in case it's something that occurs as a consequence of them being added to the database (whatever is involved in that)

@nul800sebastiaan
Copy link
Member

@seekingcode18 Good news/bad news! I can now reproduce the problem 100% on your database. That's also the bad news. 🙈

But this helps a lot, now we can look into what the cause is, thanks so far!

Can you please delete me from your project again, I have what I need now! 👍

@nul800sebastiaan
Copy link
Member

@ronaldbarendse Did you also happen to have a duplicate workflow in your DB when you encountered this, I can repro by having a workflow that has the same key as another workflow.

@ronaldbarendse
Copy link
Author

@nul800sebastiaan I haven't encountered the same issue with workflows, but the issue is probably similar, as it also uses an auto-incremented integer primary key.

@ronaldbarendse
Copy link
Author

I only just now saw that the problem Definition here is showing a very slight but interesting difference: #402 (comment)

I would argue the different IDs are more interesting, as I already noted in that same comment:

So it looks like both rows are updated, but the duplicate is saved first (looking at the UpdateDate) and also contains the original numeric ID of the row

In any case, it's strange to have both ID and Key as columns and also be part of the JSON stored in the definition.

@ronaldbarendse
Copy link
Author

ronaldbarendse commented Oct 23, 2020

Because having a duplicate form key completely breaks both the back-office and front-end and this can be caused by an editor simply saving a form (e.g. after adding a workflow), I've manually added the following unique indexes to prevent this from happening:

CREATE UNIQUE INDEX IX_UFDataSource_Key ON UFDataSource([Key]);
CREATE UNIQUE INDEX IX_UFForms_Key ON UFForms([Key]);
CREATE UNIQUE INDEX IX_UFPrevalueSource_Key ON UFPrevalueSource([Key]);
CREATE UNIQUE INDEX IX_UFWorkflows_Key ON UFWorkflows([Key]);

When Forms tries to save the duplicate key, the database will now throw an exception. The changes are already saved to the original row (in the case I tested), so this can be used as a workaround 🎉 No need to wait for the release that fixes this and no more manually removing the duplicate rows!

Looking at the stack-trace of this exception, you can see the FormService.Save() calls FormRepository.PersistNewItem(), instead of PersistUpdatedItem():

System.Data.SqlClient.SqlException (0x80131904): Cannot insert duplicate key row in object 'dbo.UFForms' with unique index 'IX_UFForms_Key'. The duplicate key value is (7e1365db-406c-44d6-95ca-4b966167879b).
The statement has been terminated.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteScalar()
   at StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteScalar() in C:\projects\dotnet\src\MiniProfiler.Shared\Data\ProfiledDbCommand.cs:line 335
   at Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand.<ExecuteScalar>b__32_0() in D:\a\1\s\src\Umbraco.Core\Persistence\FaultHandling\RetryDbConnection.cs:line 214
   at Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand.<>c__DisplayClass33_0`1.<Execute>b__0() in D:\a\1\s\src\Umbraco.Core\Persistence\FaultHandling\RetryDbConnection.cs:line 222
   at Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func) in D:\a\1\s\src\Umbraco.Core\Persistence\FaultHandling\RetryPolicy.cs:line 172
   at Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand.Execute[T](Func`1 f) in D:\a\1\s\src\Umbraco.Core\Persistence\FaultHandling\RetryDbConnection.cs:line 219
   at Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand.ExecuteScalar() in D:\a\1\s\src\Umbraco.Core\Persistence\FaultHandling\RetryDbConnection.cs:line 214
   at NPoco.Database.ExecuteScalarHelper(DbCommand cmd)
   at NPoco.DatabaseTypes.SqlServerDatabaseType.ExecuteInsert[T](Database db, DbCommand cmd, String primaryKeyName, Boolean useOutputClause, T poco, Object[] args)
   at NPoco.Database.InsertImp[T](PocoData pocoData, String tableName, String primaryKeyName, Boolean autoIncrement, T poco)
   at NPoco.Database.Insert[T](String tableName, String primaryKeyName, Boolean autoIncrement, T poco)
   at NPoco.Database.Insert[T](T poco)
   at Umbraco.Forms.Core.Persistence.Repositories.Implement.FormRepository.PersistNewItem(IFormEntity entity)
   at Umbraco.Core.Cache.DefaultRepositoryCachePolicy`2.Create(TEntity entity, Action`1 persistNew) in D:\a\1\s\src\Umbraco.Core\Cache\DefaultRepositoryCachePolicy.cs:line 96
   at Umbraco.Core.Persistence.Repositories.Implement.RepositoryBase`2.Save(TEntity entity) in D:\a\1\s\src\Umbraco.Core\Persistence\Repositories\Implement\RepositoryBaseOfTIdTEntity.cs:line 138
   at Umbraco.Forms.Core.Services.BaseService`4.Save(TEntity entity, TType item)
   at Umbraco.Forms.Core.Services.FormService.Save(IFormEntity entity, Form form)
   at Umbraco.Forms.Core.Services.BaseService`4.Insert(TType item)
   at Umbraco.Forms.Core.Data.Storage.FormStorageProxy.InsertForm(Form form, String directory, Boolean ignoreFieldCondtionRules)
   at Umbraco.Forms.Web.Editors.FormController.SaveForm(FormDesign formData)

@robertjf
Copy link

robertjf commented Nov 5, 2020

I'm experiencing the same issue with latest Umbraco Forms and UmbracoCMS (8.9.0 and 8.5.4) on a new Cloud project using database storage for the forms.

EDIT: Forgot to mention - this is in my local dev environment for the cloud project, the code hasn't been pushed to Cloud yet.

@seekingcode18
Copy link

Hello, I was wondering if there are any updates about when this might be close to being fixed?

@ronaldbarendse
Copy link
Author

I've just had a project on Umbraco Cloud (Umbraco 8.9.1, Forms 8.5.5, Deploy 3.5.1) that had more than 15.000 rows in the UFForms table, while it only had 8 different forms!

I've removed all the duplicate rows using the following SQL query (only keeping the first/lowest integer ID):

SELECT 0 -- Set rowcount to 1
WHILE (@@ROWCOUNT > 0)
BEGIN
    DELETE FROM UFForms WHERE Id IN (SELECT MAX(Id) FROM UFForms GROUP BY [Key] HAVING COUNT([Key]) > 1);
END

@ronaldbarendse
Copy link
Author

And to check whether you have any duplicate rows, you can run the following SQL query:

SELECT [Key], COUNT([Key]) FROM UFDataSource GROUP BY [Key];
SELECT [Key], COUNT([Key]) FROM UFForms GROUP BY [Key];
SELECT [Key], COUNT([Key]) FROM UFPrevalueSource GROUP BY [Key];
SELECT [Key], COUNT([Key]) FROM UFWorkflows GROUP BY [Key];

@ronaldbarendse
Copy link
Author

The large amount of duplicate UFForms rows seem to be caused by thousands of Umbraco cache instructions that saved duplicate forms, instead of updating it. I only managed to remove all duplicate rows and add the unique indexes after restarting the environment (stopping the site). After that, the log was flooded with the following exceptions:

System.Data.SqlClient.SqlException (0x80131904): Cannot insert duplicate key row in object 'dbo.UFForms' with unique index 'IX_UFForms_Key'. The duplicate key value is (b770862c-1d0b-4a6e-b974-5c9bc57dd72e).
The statement has been terminated.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteScalar()
   at StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteScalar() in C:\projects\dotnet\src\MiniProfiler.Shared\Data\ProfiledDbCommand.cs:line 335
   at Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand.<ExecuteScalar>b__32_0()
   at Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand.<>c__DisplayClass33_0`1.<Execute>b__0()
   at Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func)
   at Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand.Execute[T](Func`1 f)
   at Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand.ExecuteScalar()
   at NPoco.Database.ExecuteScalarHelper(DbCommand cmd)
   at NPoco.DatabaseTypes.SqlServerDatabaseType.ExecuteInsert[T](Database db, DbCommand cmd, String primaryKeyName, Boolean useOutputClause, T poco, Object[] args)
   at NPoco.Database.InsertImp[T](PocoData pocoData, String tableName, String primaryKeyName, Boolean autoIncrement, T poco)
   at NPoco.Database.Insert[T](String tableName, String primaryKeyName, Boolean autoIncrement, T poco)
   at NPoco.Database.Insert[T](T poco)
   at Umbraco.Forms.Core.Persistence.Repositories.Implement.FormRepository.PersistNewItem(IFormEntity entity)
   at Umbraco.Core.Cache.DefaultRepositoryCachePolicy`2.Create(TEntity entity, Action`1 persistNew)
   at Umbraco.Core.Persistence.Repositories.Implement.RepositoryBase`2.Save(TEntity entity)
   at Umbraco.Forms.Core.Services.BaseService`4.Save(TEntity entity, TType item)
   at Umbraco.Forms.Core.Services.FormService.Save(IFormEntity entity, Form form)
   at Umbraco.Forms.Core.Services.BaseService`4.Insert(TType item)
   at Umbraco.Forms.Core.Data.Storage.FormStorageProxy.SaveToFile(Form form, Guid id, String directory)
   at Umbraco.Forms.Core.Cache.FormCacheRefresher.Refresh(String jsonPayload)
   at Umbraco.Core.Sync.ServerMessengerBase.DeliverLocal(ICacheRefresher refresher, MessageType messageType, IEnumerable`1 ids, String json)
   at Umbraco.Core.Sync.ServerMessengerBase.Deliver(ICacheRefresher refresher, MessageType messageType, IEnumerable`1 ids, String json)
   at Umbraco.Core.Sync.ServerMessengerBase.PerformRefresh(ICacheRefresher refresher, String jsonPayload)
   at Umbraco.Web.Cache.DistributedCache.RefreshByJson(Guid refresherGuid, String jsonPayload)
   at Umbraco.Forms.Core.Cache.FormsDistributedCacheExtensions.RefreshFormsCache(DistributedCache dc, Form form)
   at Umbraco.Forms.Web.Controllers.UmbracoFormsController.PrePopulateForm(Form form, ControllerContext context, FormViewModel formViewModel, Record record)
   at Umbraco.Forms.Web.Controllers.UmbracoFormsController.GetFormModel(Guid formId, Nullable`1 recordId, String theme)
   at Umbraco.Forms.Web.Controllers.UmbracoFormsController.RenderForm(Guid formId, Nullable`1 recordId, String theme, Boolean includeScripts)

I've removed all rows in the umbracoCacheInstruction table and restarted the site to get it back up, but it keeps adding the cache instructions and trying to save the duplicate rows! This is a major bug/issue and does also increase all database queries/storage on Umbraco Cloud!

@hfloyd
Copy link

hfloyd commented Nov 19, 2020

I'm experiencing a similar issue. When I make any change to a form, it saves a second duplicated record and I'm unable to open any forms or entries in the back-office until I manually delete one of the duplicates in the database.

Umbraco Cloud
Umbraco 8.9.1
Forms 8.5.5
Deploy 3.5.1

Also, I am seeing the duplicated workflows:
image

@glombek
Copy link

glombek commented Nov 23, 2020

Similar issue here

Umbraco 8.9.1
Forms 8.5.5
Deploy 3.5.1

@warrenbuckley
Copy link

This has been fixed by this PR - https://github.com/umbraco/Umbraco-Deploy/pull/460 and was due to a combination of Forms and Deploy together.

This fix is done in the Deploy codebase and is fixed in the DLL Umbraco.Deploy.Forms.dll which should be in the next release of Deploy.

@hfloyd
Copy link

hfloyd commented Nov 24, 2020

@warrenbuckley Thanks!!!! Any ETA on that Deploy release?

@warrenbuckley
Copy link

warrenbuckley commented Nov 24, 2020

I can't tell you when the next Deploy release is due @hfloyd but perhaps my lovely colleague @filipbech may be able to give you some insight.

However as an alternative here is a CI build of this PR, the fix is contained in bin/Umbraco.Deploy.Forms.dll

UmbracoDeploy.v3.5.1-alpha10642.zip

@hfloyd
Copy link

hfloyd commented Nov 24, 2020

@warrenbuckley / @filipbech would it be safe for me to use this file and push it to Cloud? Or will that screw up the automated Update process once the official release is ready?

@filipbech
Copy link

We don't have a date set yet - best guess would be next week!

@hfloyd
Copy link

hfloyd commented Nov 24, 2020

Thanks, @filipbech . Would it be safe for me to use this file in the meantime?

@filipbech
Copy link

I don't know... sorry

@umbrabot umbrabot removed the state/sprint-candidate We're trying to get this in a sprint at HQ in the next few weeks label Nov 25, 2020
@hfloyd
Copy link

hfloyd commented Jan 19, 2021

@filipbech & @nul800sebastiaan

I am still seeing this issue on a live Cloud site:
Umbraco 8.10.1
Forms 8.6.0
Deploy 3.5.3

Saving the Form via the back-office UI is adding duplicated records to the table, and duplicating the workflows on the form.
image

@hfloyd
Copy link

hfloyd commented Feb 16, 2021

@umbrabot reopen

@hfloyd
Copy link

hfloyd commented Feb 16, 2021

@nul800sebastiaan @filipbech @warrenbuckley

Guys, This is KILLING me! Still a problem on a live site. I am caught in an evil UI loop - I have duplicated workflows sending dupe emails (Client not loving this...), when I attempt to delete the extra workflows, then I have to SAVE the form - which then adds the extra form record to the damn db, which then kills the UI, and if I run the manual SQL to kill the extra form record, the extra workflows are present again. I was finally able to delete the extra workflows via SQL Server, but I am concerned that re-saving a form will bring them back again.

REOPEN THIS ISSUE, PLEASE. IT IS NOT FIXED

Umbraco 8.11.1
Forms 8.6.0
Deploy 3.5.3
Umbraco Id

@filipbech filipbech reopened this Feb 17, 2021
@nul800sebastiaan
Copy link
Member

That sounds awful, sorry to hear @hfloyd! Could you please contact Cloud support with the project alias and give them access to it so we can have a look. I suspect the underlying issue might be fixed, but we've caused the data to be incorrect so that might need fixing and then it should be fine for you, not sure.

Make sure to refer support to this issue and ask them to escalate it to second level support, then we can take it from there!

@hfloyd
Copy link

hfloyd commented Feb 17, 2021

Thanks, @nul800sebastiaan
Sorry I was freaking out yesterday. It was just so frustrating.
Yesterday I did use SQL Server Management Studio to go into the DB directly and delete duplicated records in the [UFWorkflows] table.
I checked the site again today, and made a small change to a workflow and saved it. It seems that it was the existence of the the duplicated workflows had been causing my problems yesterday, because I was able to save without the same problem today. If it comes up again I will follow your advice and reach out directly to Cloud support.

So, for anyone coming across this problem - If you had a previous version of forms installed, and the update didn't fix the issue, check the [UFWorkflows] tables for existing duplicates and delete them from that table directly.

@nul800sebastiaan
Copy link
Member

I get it, super frustrating! 😬

Let's leave this open for a bit longer to make sure the issues have actually been fixed and don't re-occur. The offer is still open to reach out and let support access your site/db for an extra pair of eyes if you run into more problems!

@hfloyd
Copy link

hfloyd commented Feb 17, 2021

Thanks, @nul800sebastiaan . Will do :-)

@AndyButland
Copy link

Will close this now as having implemented the data integrity keys and constraints in 8.7 we should have resolved the root of the issue - that the database allowed duplicates. It now doesn't and will avoid an installation getting into the state that causes the problems described in this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests