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

Unable to synchronize database - D365FO

(0) ShareShare
ReportReport
Posted on by

Hi All,

We are unable to synchronize database in DEV environment,

DEV version is : 

Application release : Microsoft Dynamics 365 for Finance and Operations (10.0.15)
Platform release : Update39 (7.0.5816.35651)
Version: 10.0.15 (10.0.644.10015)

Getting the below error:

Severity Code Description Project File Line Suppression State
Error -- MAINTAINLICENSE 4 is Operations. We update MAINTAINLICENSE only if existing MAINTAINLICENSE is operations and set to Finance (8), SCM (9), Retail (10) 0
Error -- While updating we also consider Privilege in LicensePrivileges.json is unique. 0
Error --- End of inner exception stack trace --- 0
Error --cleanup before populating data 0
Error AS 0
Error at Microsoft.Dynamics.AX.Framework.Database.Synchronize.InitialSchemaSync.RunSync() 0
Error at Microsoft.Dynamics.AX.Framework.Database.Synchronize.InitialSchemaSync.ScriptRegion.Execute(SqlConnection connection, SqlTransaction transaction) 0
Error at Microsoft.Dynamics.AX.Framework.Database.Synchronize.InitialSchemaSync.ScriptRegion.ExecuteCommand(SqlCommand cmd) 0
Error at Microsoft.Dynamics.AX.Framework.Database.Tools.StaticSchema.RunStaticUpdate(String sqlConnectionString, String binDir, Boolean skipRegionHashing) 0
Error at Microsoft.Dynamics.AX.Framework.Database.Tools.SyncEngine.FullSync() 0
Error at Microsoft.Dynamics.AX.Framework.Database.Tools.SyncEngine.InitialSchemaSync() 0
Error at Microsoft.Dynamics.AX.Framework.Database.Tools.SyncEngine.Run(String metadataDirectory, String sqlConnectionString, SyncOptions options) 0
Error at Microsoft.Dynamics.AX.Framework.Database.Tools.SyncEngine.RunSync() 0
Error at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() 0
Error at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) 0
Error at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite) 0
Error at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) 0
Error at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) 0
Error at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) 0
Error BEGIN 0
Error CASE WHEN JMAP.SKUNAME = 'Finance' AND RL.MAINTAINLICENSE = 4 THEN 8 0
Error ClientConnectionId:df308a3f-6966-4fb5-b0ec-6c6989e7f363 0
Error ELSE RL.MAINTAINLICENSE 0
Error END, 0
Error END; 0
Error Error Number:213,State:1,Class:16 ---> System.Data.SqlClient.SqlException: Column name or number of supplied values does not match table definition. 0
Error FROM SECURITYPRIVILEGE SP 0
Error Initialize schema failed. Microsoft.Dynamics.AX.Framework.Database.TableSyncException: Failed during InitialSchema at command: 0
Error INSERT INTO SECURITYROLEPRIVILEGERESOURCELICENSEMAP 0
Error JOIN SECURITYRESOURCEPRIVILEGEPERMISSIONS RP 0
Error LEFT JOIN LICENSINGSERVICEPLANSPRIVILEGE JMAP 0
Error LEFT JOIN SECURITYMENUITEMLICENSES RL 0
Error LEFT JOIN SECURITYROLEPRIVILEGEEXPLODEDGRAPH PRMAP 0
Error ON JMAP.PRIVILEGEIDENTIFIER = SP.IDENTIFIER AND JMAP.ISUNIQUE = 1 0
Error ON PRMAP.SECURITYPRIVILEGE = SP.RECID 0
Error ON RL.IDENTIFIER = RP.AOTNAME 0
Error ON SP.IDENTIFIER = RP.PRIVILEGEIDENTIFIER AND SECURABLETYPE IN (1,2,3) 0
Error RL.MENUITEMTYPE, 0
Error RL.VIEWLICENSE 0
Error RP.AOTNAME, 0
Error SELECT DISTINCT PRMAP.SECURITYROLE, 0
Error SP.IDENTIFIER, 0
Error SP.RECID, 0
Error syncengine.exe exited with code -1. 1
Error TRUNCATE TABLE SECURITYROLEPRIVILEGERESOURCELICENSEMAP 0
Error WHEN JMAP.SKUNAME = 'Retail' AND RL.MAINTAINLICENSE = 4 THEN 10 0
Error WHEN JMAP.SKUNAME = 'SCM' AND RL.MAINTAINLICENSE = 4 THEN 9 0
Error WHERE RL.MENUITEMTYPE IS NOT NULL 0
Error [MAINTAINLICENSE] = 0
Error \nCREATE PROCEDURE [DBO].[LICENSING_POPULATEROLEPRIVILEGELICENSEMAP] 0
Error \n\nException message: System.Data.SqlClient.SqlException (0x80131904): Column name or number of supplied values does not match table definition. 0

Please advise us how we can sync the database.
 

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    300,911 Super User 2025 Season 2 on at

    Hi Akbarpasha,

    Can you tell what change was done to this environment before this issue occured? E.g. Did you deploy customizations or are you trying to update this environment to a higher standard version? Or probably you refreshed the database from a production environment?

  • Akbarpasha Profile Picture
    on at

    Hi Andre,

    We have refreshed dev with UAT database, which is having higher version compare to Dev.

    Regards,

    Akbar

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    300,911 Super User 2025 Season 2 on at

    Hi Akbar,

    According to the documentation about database movements, the version number of the application should be the same. As you mention that the UAT has a higher version, then this is your culprit. You can update the DEV environment to the same version as your UAT and try again.

    Check the documentation here: Refresh database - Finance & Operations | Dynamics 365 | Microsoft Docs

  • Akbarpasha Profile Picture
    on at

    Thank you Andre for the information,

    We are trying to apply the service update 10.0.20 to DEV environment which is similar to UAT but it is getting failed at step 57, below is the error info:

    "GlobalUpdate script for service model: RetailServer on machine: dev*******",

    tried below link , but it is still getting failed:

       

    Please advise us how can we resolve this error to apply service update.

    Regards,

    Akbar

  • André Arnaud de Calavon Profile Picture
    300,911 Super User 2025 Season 2 on at

    Hi Akbar,

    Did you have a look at the details in the error logs? Anyway, probably deploying a new DEV environment based on 10.0.20, restore the database from the old DEV environment; connect to DevOps and get latest would be easier.

  • Akbarpasha Profile Picture
    on at

    Thank you Andre for your inputs.

    If we deploy new Dev VM, will it charge anything to client?

    If we deploy new Dev VM, can we refresh database from UAT instead of taking old dev database restore.

    Please provide your inputs.

    Regards,

    Akbar

  • André Arnaud de Calavon Profile Picture
    300,911 Super User 2025 Season 2 on at

    Hi Akbar,

    The first question depends on where the VM will be deployed. Is it on the customers tenant or your organizations tenant? If it is on the customers tenant, then it would have additional cost until you remove the old VM.

    If the platform and application version of UAT is the same as the new Dev VM, then you can use this database and ignore the old dev database. Ensure you will get latest from DevOps Repos, build your models and synchronize the database before you continue working with the new VM.

  • Suggested answer
    Suresh M. Parmar Profile Picture
    340 on at

    Hello Akbar,

    If you are not using Retail in your system please follow the link below,

    Update Error: GlobalUpdate script for service model RetailServer

    Thanks,

    Suresh Parmar

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