Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Suggested answer

DBSync error on Deploy from LCS

Posted on by 5

Having successfully deployed packages to our QA instance from LCS for quite a while, I started getting rollbacks after a minor change to a single class,

The logs indicate that the DBSync is failing based on several tables existing.

Exception: System.InvalidOperationException: Database execution failed: There is already an object named 'XPK_BRAZEMANRPTING' in the database.

This is what I've found so far :

'%Table Sync Failed for Table%' and errorMessage like '%There is already an object named%' The Internal SqlDictionary table and SQL schema are out of sync. There isn't enough information in the logs to understand how this state was reached.

Does anyone know how to fix this condition ?

Thanks,


Dave

  • Suggested answer
    id365font Profile Picture
    id365font 400 on at
    RE: DBSync error on Deploy from LCS

    Hello,

    It happened to us many times. But if you try to deploy the package again, it will success.

    It seems to be related to the preservicing and postservicing steps in the package deployment. We are in contact with Microsoft support in order to know the reason.

  • Dave@Packless Profile Picture
    Dave@Packless 5 on at
    RE: DBSync error on Deploy from LCS

    Hi Nathan,

    The deployment is being initiated manually from LCS.

    The DBSync is reporting multiple tables (57) as existing (they should be)

    The only change between the previous successful deploy and the failing ones now was a change to a class method.

     

    I found this in the logs , not sure if it’s the cause or just noise :

     

    05/13/2022 18:31:35: Encountered exception searching for code package version. Assuming schema is missing and sync is required. Exception is: System.Data.SqlClient.SqlException (0x80131904): Invalid object name 'SF.PRECHECKSYNCLOG'.

       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.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 Microsoft.Dynamics.AX.Deployment.Setup.DbOperations.IsSyncNeeded(String targetDbConnectionStringSqlAuth, SetupConfiguration config)

     

    Thanks for any help you can offer,


    Dave

  • Nathan Clouse AX Profile Picture
    Nathan Clouse AX 140 on at
    RE: DBSync error on Deploy from LCS

    Hey Dave,

         This can mean a few different issues but the root cause of this is typically from a table or index being delete then added (again) with the same name. Consider that in a dev environment if I delete "myTable" then add "myTable" again, chances are high the dbsync process would happen between the delete and add. in the T2 environment, it's trying to do both at the same time and it's getting it wrong. Check your changesets to see if there was a major change to a table/index that took place.

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,326 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,166 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans