Violation of primary key error after ARS upgrade

I just upgrade ARS from version 7.3 to 7.4.1 in our test environment. After upgrade, the upgrade configuration came up (in place upgrade). Changed database and click next. It is failing with error

Violation of PRIMARY KEY constraint 'PK_ARServices_objectGUID'. Cannot insert duplicate key in object 'dbo_ARServices'. The duplicate key value is ......

  • Hi Akingbade

    Can you confirm how Active Roles is configured in your environment? IE, is it Standalone, or setup as a Publisher/Subscriber?

    Also have you logged an SR with support?

    Kind regards

    Stu

  • Hello Stu

    Thanks for the reply. I havent logged it. Was hoping someone have seen the error before.

    It is a standalone server with 2 admin service. 1 web server not on the same.

    Thanks

    Akin

  • Hi Akingbade

    I've not seen this error before unfortunately, I'd ask for your environment setup to check if it might be something to do with Pub/Sub (as in that use case, you'd have to return the setup to standalone before the upgrade).

    I'd recommend that you log an SR, our support team may have seen this before, or be able to escalate to R&D as appropriate.

    Sorry I couldn't help further.

    Stu

  • Hi

    I was also performing an upgrate from 7.3 to 7.41 and got the same error. This is what the log file says:

    [2020-04-28T10:48:03.159] [<not set>]: Performing configuration database upgrade..

    [2020-04-28T10:48:03.197] [<not set>]: [InsertArServiceRecord] :Error Generated. Details: System.Data.SqlClient.SqlException (0x80131904): Violation of PRIMARY KEY constraint 'PK_ARServices_objectGUID'. Cannot insert duplicate key in object 'dbo.ARServices'. The duplicate key value is (7bc3ef08-5299-40a1-b8a8-0befb5c417fe).
    The statement has been terminated.
    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& usedCache, Boolean asyncWrite, Boolean inRetry)
    at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
    at ActiveRoles.Service.Configuration.Database.UpdateDatabaseAction.InsertArServiceRecord(DatabaseParameters dbConnection, String SourceDb, String DestinationDb)
    ClientConnectionId:7547cb09-4d21-447d-87b1-2aa4a5546d9c
    Error Number:2627,State:1,Class:14

    [2020-04-28T10:48:03.197] [<not set>]: [Error] [ArsBaseCommand.ProcessRecord]: Violation of PRIMARY KEY constraint 'PK_ARServices_objectGUID'. Cannot insert duplicate key in object 'dbo.ARServices'. The duplicate key value is (7bc3ef08-5299-40a1-b8a8-0befb5c417fe).
    The statement has been terminated.

  • Hi Staffan

    Have you tried doing a clean install, then importing the configuration and History from your old instance?

    However, I would recommend you log an Service Request with support.