web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

DBSync error on Deploy from LCS

(0) ShareShare
ReportReport
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

I have the same question (0)
  • Nathan Clouse AX Profile Picture
    140 on at

    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.

  • Dave@Packless Profile Picture
    5 on at

    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

  • Suggested answer
    id365font Profile Picture
    398 on at

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 660 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 549 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 307 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans