v2.2 Install Failure

PDinCAPDinCA Posts: 642 Silver 1
Prior version was the 0.9 Beta.

Install is to clean up the now unusable 0.9 artifacts to start with.

Log file content follows:

2017-08-07 16:52:22.212 -07:00 [Information] SQL Clone server version 2.2.0.7634
2017-08-07 16:52:22.258 -07:00 [Information] Running as XXX\yyy on XXX
2017-08-07 16:52:22.833 -07:00 [Information] Found client endpoint at net.tcp://127.0.0.1:22222/activationplugin/
2017-08-07 16:52:22.855 -07:00 [Information] Starting "Server Software Update Monitor"
2017-08-07 16:52:22.860 -07:00 [Information] Started "Server Software Update Monitor"
2017-08-07 16:52:22.863 -07:00 [Information] Starting "Server License Status Monitor"
2017-08-07 16:52:22.863 -07:00 [Information] Started "Server License Status Monitor"
2017-08-07 16:52:23.802 -07:00 [Warning] Encountered an error and will retry in 00:00:02
System.Data.SqlClient.SqlException (0x80131904): The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_Operations_Agents_AgentId". The conflict occurred in database "SQLClone_Config", table "dbo.Agents", column 'Id'.
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 Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, String executeMethod, IReadOnlyDictionary`2 parameterValues, Boolean closeConnection)
at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IEnumerable`1 migrationCommands, IRelationalConnection connection)
at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
at RedGate.SqlClone.DataAccess.SqlServer.SqlCloneContextProvider.MigrateDatabase()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at RedGate.SqlClone.Common.ActionRunner.<RetryAndBackoff>d__4`1.MoveNext()
ClientConnectionId:0e0f8052-a786-476b-91d7-fa050f3e10a2
Error Number:547,State:0,Class:16
2017-08-07 16:52:24.250 -07:00 [Information] Redgate Client capability version: 2
2017-08-07 16:52:24.250 -07:00 [Information] Redgate Client capability version: 2
2017-08-07 16:52:24.483 -07:00 [Information] Preparing to perform check for updates
Jesus Christ: Lunatic, liar or Lord?
Decide wisely...
Tagged:

Comments

  • GrahamHGrahamH Posts: 13 Bronze 5
    Thanks for reporting this and giving some good detail - it really helps in diagnosing the issue. That foreign key is a reasonably recent addition so we may find that in the beta it was possible to violate its constraint. We'll try to reproduce the issue and get back to you with a course of action.
  • owen.hallowen.hall Posts: 57 Silver 4
    edited August 8, 2017 5:27PM
    It sounds like there is an Operation row in SqlClone_Config.dbo.Operations where the AgentId field refers to an Agent ID that doesn't exist in SqlClone_Config.dbo.Agents.

    The foreign key we've introduced essentially says 'if an operation is associated with an agent, that agent must actually have existed at some point'. So, when Clone tries to perform the migration and apply that new constraint, it fails.

    The best bet is to run some SQL updates on the data so that there's no such inconsistency and the migration can go ahead - if you get in touch with support@red-gate.com about this, we can help devise a path forward.
    Software Engineer
    Redgate Software
Sign In or Register to comment.