Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Joseph 59 posts 140 karma points
    Jul 28, 2015 @ 02:36
    Joseph
    0

    UFRecords table getting blown away after each deployment

    I have just upgraded an Umbraco 7.2.5 website from Umbraco Forms 4.1.1 to 4.1.4 and have run into an odd issue - since Umbraco Forms has been upgraded, each time the website is deployed (we use Octopus for all deployments), the UFRecords table is blown away and I've to restore the database from a backup to be able to retain form submissions.

    I can confirm that that appears to be the only table that is affected - UFRecordFields, UFRecordDataString, etc all appear to be fine after a deployment.

    I have tried restarting the website and recycling the app but that does not appear to trigger the clearing of the UFRecords table. All Octopus Deploy is effectively doing is copying across the website package and updating IIS so that it points to the new location.

    I should also note that AppData, Media and Data (which normally sits within AppPlugins/UmbracoForms/) are set up as virtual directories on IIS so that this content can be retained across Octopus deployments.

    My question: what in all of this could be blowing the UFRecords data away? It is slightly annoying that a database backup/restore needs to be a part of each deployment currently.

  • Comment author was deleted

    Aug 03, 2015 @ 09:27

    Hmmm no idea why that would happen, there is no code in there that would blow away tables, is it the data that is cleared or the entire table that is dropped?

  • Joseph 59 posts 140 karma points
    Aug 03, 2015 @ 20:10
    Joseph
    0

    The table is still there, it just doesn't have any data in it.

  • Comment author was deleted

    Aug 04, 2015 @ 07:14

    Just checked the code and there is no delete statement in there, only way the records get deleted is when you delete the form, but I suppose the form is still intact?

  • Joseph 59 posts 140 karma points
    Aug 05, 2015 @ 03:46
    Joseph
    0

    I've just noticed the following in the UmbracoTraceLog:

    2015-07-28 14:20:00,296 [111] INFO  Umbraco.Core.Persistence.Database - [Thread 28] Create Table sql -1:
     CREATE TABLE [UFRecords] ([Id] INTEGER NOT NULL IDENTITY(1,1),
    [Form] UniqueIdentifier NOT NULL,
    [Created] DATETIME NOT NULL,
    [Updated] DATETIME NOT NULL,
    [CurrentPage] UniqueIdentifier NULL,
    [UmbracoPageId] INTEGER NULL,
    [IP] NVARCHAR(255) NULL,
    [MemberKey] NVARCHAR(255) NULL,
    [UniqueId] UniqueIdentifier NOT NULL,
    [State] NVARCHAR(50) NULL,
    [RecordData] NTEXT NOT NULL)
    2015-07-28 14:20:00,301 [111] INFO  Umbraco.Core.Persistence.Database - [Thread 28] Primary Key sql -1:
     ALTER TABLE [UFRecords] ADD CONSTRAINT [PK_UFRecords] PRIMARY KEY CLUSTERED ([Id])
    2015-07-28 14:20:00,304 [111] INFO  Umbraco.Core.Persistence.Database - [Thread 28] New table 'UFRecords' was created
    2015-07-28 14:20:00,313 [111] INFO  Umbraco.Core.Persistence.UmbracoDatabase - [Thread 28]    at System.Data.SqlClient.SqlConnection.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.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteNonQuery()
       at Umbraco.Core.Persistence.PetaPocoCommandExtensions.<>c__DisplayClass1.<ExecuteNonQueryWithRetry>b__0()
       at Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func)
       at Umbraco.Core.Persistence.Database.Execute(String sql, Object[] args)
    2015-07-28 14:20:00,315 [111] ERROR Umbraco.Forms.Web.Installer.InstallHelper - [Thread 28] Install failed
    System.Data.SqlClient.SqlException (0x80131904): Could not drop object 'UFRecordFields' because it is referenced by a FOREIGN KEY constraint.
       at System.Data.SqlClient.SqlConnection.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.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteNonQuery()
       at Umbraco.Core.Persistence.PetaPocoCommandExtensions.<>c__DisplayClass1.<ExecuteNonQueryWithRetry>b__0()
       at Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func)
       at Umbraco.Core.Persistence.Database.Execute(String sql, Object[] args)
       at Umbraco.Core.Persistence.PetaPocoExtensions.CreateTable(Database db, Boolean overwrite, Type modelType)
       at Umbraco.Forms.Web.Installer.InstallHelper.InstallDataBase()
       at Umbraco.Forms.Web.Installer.InstallHelper.SilentInstall()
    ClientConnectionId:88416258-4b65-4d62-91e0-f8a210e7d99c
    Error Number:3726,State:1,Class:16
    

    Does this help?

  • Joseph 59 posts 140 karma points
    Aug 04, 2015 @ 20:29
    Joseph
    0

    Yep form is still there...

  • Comment author was deleted

    Aug 05, 2015 @ 12:09

    Aha that is helpfull, do you remove the install marker by any chance on the deploy, it's in \App_Plugins\UmbracoForms\installed

  • Joseph 59 posts 140 karma points
    Aug 05, 2015 @ 20:21
    Joseph
    0

    Hi Tim

    The install marker is certainly there. Should it be?

  • Paul Bowen 11 posts 76 karma points
    Sep 30, 2015 @ 19:47
    Paul Bowen
    0

    Hi Tim,

    I need to carry out a deployment on a site today (the same one Joseph is talking about) with this issue and the only workaround we have is to backup the database, deploy with Octopus then restore the database.

    I've checked and there is an empty installed file in *\App_Plugins\UmbracoForms* - as Joseph asks - that needs to be there I take it?

    The only folder we retain with a virtual directory when deploying is the \App_Plugins\UmbracoForms\Data folder - the rest of the UmbracoForms folder is replaced with that from source in effect. Can you see any issue with this? Is there something else that tells Umbraco to reinstall the forms?

    Thanks, Paul

  • Carl Jackson 139 posts 478 karma points
    Oct 05, 2015 @ 16:15
    Carl Jackson
    0

    to get around the issue we add the "installed" file to sourec control and deploy it.

    As long as the database has the tables from the original install then form records are not deleted.

    No documentation on this and we did have an issue with it!

  • Paul Bowen 11 posts 76 karma points
    Oct 05, 2015 @ 19:37
    Paul Bowen
    1

    Hi Carl,

    I did some testing the weekend and found exactly the same solution. We actually had the installed (and version files for that matter) included in our source control fine. However we use TeamCity to build package our sites and that uses a nuspec definition to create a nuget package.

    Our entry for the App_Plugins folder was:

    <file src="App_Plugins\**.*" target="App_Plugins" />
    

    ...which meant it would include all files, but only if they had a file extension so the installed file wasn't being packaged as it has no extension and therefore not deployed when Octopus ran.

    When I changed the nuspec definition to just ** I.e.:

    <file src="App_Plugins\**" target="App_Plugins" 
    

    ...then the files were included and UmbracoForms stopped installing each time and all was right with the World again.

  • Carl Jackson 139 posts 478 karma points
    Oct 06, 2015 @ 08:31
    Carl Jackson
    0

    Hi Paul, I'll keep this in mind.

    At the moment we deploy with MSbuild scripts so we just need to ensure that the files are included in the solution and they get deployed.

    Thanks

    Carl

  • Emilio 1 post 71 karma points
    Oct 20, 2016 @ 19:26
    Emilio
    0

    I'm still having this problem. Each time I run the InstallDatabase even the table UFRecords exists it get overriden with a new blank version. Is there a way to preserve the values in each provision?. Thanks Emilio

Please Sign in or register to post replies

Write your reply to:

Draft