Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Unanswered

DB Synch fails during data upgrade from AX2012 at step 3

Posted on by

Hello,

I'm attempting to run the data upgrade on a VM machine 10.0.32 version.

I copied the SQL database from AX2012R3 with customizations.

I keep getting this error when I run the upgrade script or when I run the db syncronization from Visual Studio

Log level - Error | AOS database sync failed. Microsoft.Dynamics.AX.Framework.Database.TableSyncException: Full sync did not complete successfully. Error: ArgumentNullException:Value cannot be null.
Parameter name: metadata
at Microsoft.Dynamics.Ax.Xpp.Utilities.ParameterHelper.Ensure(String parameterName, Object parameterValue)
at Microsoft.Dynamics.AX.Data.Management.View.ViewQueryNode..ctor(Int32 dataset, AxQuerySimple metadata)
at Microsoft.Dynamics.AX.Data.Management.View.ManagedSyncViewWorker.GetViewQueryNode(Int32 viewId, Boolean isDataEntityView)
at Microsoft.Dynamics.AX.Data.Management.View.ManagedSyncViewWorker.PopulateViewList(Int32 viewId)
at Microsoft.Dynamics.AX.Data.Management.View.ManagedSyncViewWorker.SortSyncRequest(IEnumerable`1 requests, Boolean isParallelSync)
at Microsoft.Dynamics.AX.Data.Management.View.ManagedSyncViewWorker.SyncAll(IProducerConsumerCollection`1 modifiedViewDependencies)
at Microsoft.Dynamics.AX.Data.Management.ManagedSyncWorkerManager.SyncAll()
at Microsoft.Dynamics.AX.Data.Management.ManagedSync.<SyncAll>b__21_0()
at Microsoft.Dynamics.AX.Data.Management.ManagedSync.EnsureMetadataProviderCacheCleared(Action action)
at Microsoft.Dynamics.AX.Data.Management.ManagedSync.SyncAll()
at Microsoft.Dynamics.AX.Framework.Database.Tools.LegacyCodepath.RunFullManagedSync(SyncOptions options, String sqlConnectionString, IMetadataProvider metadataProvider)
at Microsoft.Dynamics.AX.Framework.Database.Tools.LegacyCodepath.<>c__DisplayClass20_0.<RunFullTableSync>b__0()
at Microsoft.Dynamics.AX.Framework.Database.Tools.LegacyCodepath.ExecuteWithinAOS(SyncOptions syncOptions, String sqlConnectionString, IMetadataProvider metadataProvider, Func`1 func, Action`1 errorHandler).
at Microsoft.Dynamics.AX.Framework.Database.Tools.LegacyCodepath.<>c.<RunFullTableSync>b__20_1(Tuple`2 result)
at Microsoft.Dynamics.AX.Framework.Database.Tools.LegacyCodepath.ExecuteWithinAOS(SyncOptions syncOptions, String sqlConnectionString, IMetadataProvider metadataProvider, Func`1 func, Action`1 errorHandler)
at Microsoft.Dynamics.AX.Framework.Database.Tools.LegacyCodepath.RunFullTableSync(SyncOptions syncOptions, String sqlConnectionString, IMetadataProvider metadataProvider)
at Microsoft.Dynamics.AX.Framework.Database.Tools.SyncEngine.FullTableViewSync()
at Microsoft.Dynamics.AX.Framework.Database.Tools.SyncEngine.FullSync()
at Microsoft.Dynamics.AX.Framework.Database.Tools.SyncEngine.RunSync()
at Microsoft.Dynamics.AX.Framework.Database.Tools.SyncEngine.Run(String metadataDirectory, String sqlConnectionString, SyncOptions options)
Failed operation step '/DataUpgrade/DbSync/SyncSchema'
Process 'C:\AosService\PackagesLocalDirectory\bin\SyncEngine.exe' failed with exit code -1; see error logs for details.
at Microsoft.Dynamics.Servicing.DataUpgrade.Operations.Operation.RunProcess(String fileName, ArgumentsBuilder args)
at Microsoft.Dynamics.Servicing.DataUpgrade.Operations.OperationStep.Execute()

I've tried everything I can think of. 

is there a way to debug the db synch process to see where the actual failure is happening?

  • Carlo T Profile Picture
    Carlo T 30 on at
    RE: DB Synch fails during data upgrade from AX2012 at step 3

    Hi Anton,

    I finally found the cause. 

    It was bad xml from the upgrade tool.

    There were a few views that had no fields from AX.

    I removed those files and the synch completed successfully. 

    The error was not helpful enough.

    I used this XPath expression to parse all our files and to find the bad ones after I understood what to look for.

    //AxView/Fields[not(AxViewField)]

    Thank you for your help.

  • Anton Venter Profile Picture
    Anton Venter 18,779 Super User 2024 Season 2 on at
    RE: DB Synch fails during data upgrade from AX2012 at step 3

    What is the status of the database upgrade? What do you get if you execute this query? It's from this article: Monitoring the data upgrade.

    SELECT StartTime, EndTime, Steps, SubSteps, Status
    FROM [DBUPGRADE].[DATAUPGRADESTATUS]
    ORDER BY EndTime DESC

    Have you checked the runbook logs? Located in a sub-folder under the deployable package.

    There is also some log information about pre and post sync available here:

    select * from RELEASEUPDATESCRIPTSERRORLOG

  • CarloT Profile Picture
    CarloT on at
    RE: DB Synch fails during data upgrade from AX2012 at step 3

    I don't think the SYSGLOBALCONFIGURATION error is the problem.

    I think one of the customized views or query has invalid data but the error is very unhelpful.

    Any other suggestions where to look for error logs?

    Thank you.

  • Anton Venter Profile Picture
    Anton Venter 18,779 Super User 2024 Season 2 on at
    RE: DB Synch fails during data upgrade from AX2012 at step 3

    Hi Carlo,

    Since dbo.SYSGLOBALCONFIGURATION is a system table, perhaps Microsoft support can assist you with this?

  • CarloT Profile Picture
    CarloT on at
    RE: DB Synch fails during data upgrade from AX2012 at step 3

    And this error

    Initialization of Session performance counters failed. exception: The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly.

  • CarloT Profile Picture
    CarloT on at
    RE: DB Synch fails during data upgrade from AX2012 at step 3

    I found this also in the event viewer:

    [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Cannot insert duplicate key row in object 'dbo.SYSGLOBALCONFIGURATION' with unique index 'I_65472NAMEIDX'. The duplicate key value is*

     callStack at [aoskernel.dll]Microsoft.Dynamics.Ax.MSIL.Interop.GetManagedCallStack(basic_string<wchar_t\,std::char_traits<wchar_t>\,std::allocator<wchar_t> >* , Boolean truncateStackTrace) at [aoskernel.dll]Microsoft.Dynamics.Ax.Services.AOSAppDomainHelper.callGetManagedCallStack(basic_string<wchar_t\,std::char_traits<wchar_t>\,std::allocator<wchar_t> >* ) at callGetManagedCallStack(basic_string<wchar_t\,std::char_traits<wchar_t>\,std::allocator<wchar_t> >* ) at gopts(Int32 , Char** ) at gopts(Int32 , Char** ) at [aoskernel.dll]Microsoft.Dynamics.AX.AOS.StartupInternal(String[] Arguments) at [aoskernel.dll]Microsoft.Dynamics.AX.AOS.Startup() at Microsoft.Dynamics.AX.AosConfig.?A0x8043b1c4.GetAosConfig() at Microsoft.Dynamics.AX.AosConfig.?A0x8043b1c4.GetAosConfig() at [Microsoft.Dynamics.AX.AosConfig.dll]Microsoft.Dynamics.AX.AosConfig.Config.InitInternal() at [Microsoft.Dynamics.AX.AosConfig.dll]Microsoft.Dynamics.AX.AosConfig.Config.InitOnce(Boolean isOfflineMode) at [Microsoft.Dynamics.AX.Framework.Database.dll]Microsoft.Dynamics.AX.Framework.Database.Tools.LegacyCodepath.StartAosCode(SyncOptions syncOptions, String sqlConnectionString, IMetadataProvider metadataProvider) at [Microsoft.Dynamics.AX.Framework.Database.dll]Microsoft.Dynamics.AX.Framework.Database.Tools.LegacyCodepath.ExecuteWithinAOS(SyncOptions syncOptions, String sqlConnectionString, IMetadataProvider metadataProvider, Func`1 func, Action`1 errorHandler) at [Microsoft.Dynamics.AX.Framework.Database.dll]Microsoft.Dynamics.AX.Framework.Database.Tools.LegacyCodepath.RunFullTableSync(SyncOptions syncOptions, String sqlConnectionString, IMetadataProvider metadataProvider) at [Microsoft.Dynamics.AX.Framework.Database.dll]Microsoft.Dynamics.AX.Framework.Database.Tools.SyncEngine.FullTableViewSync() at [Microsoft.Dynamics.AX.Framework.Database.dll]Microsoft.Dynamics.AX.Framework.Database.Tools.SyncEngine.FullSync() at [Microsoft.Dynamics.AX.Framework.Database.dll]Microsoft.Dynamics.AX.Framework.Database.Tools.SyncEngine.RunSync() at [Microsoft.Dynamics.AX.Framework.Database.dll]Microsoft.Dynamics.AX.Framework.Database.Tools.SyncEngine.Run(String metadataDirectory, String sqlConnectionString, SyncOptions options) at [SyncEngine.exe]Microsoft.Dynamics.AX.Framework.Database.SyncEngineMain.Sync(Parameters parameters) at [SyncEngine.exe]Microsoft.Dynamics.AX.Framework.Database.SyncEngineMain.Main(String[] args)

     statement INSERT INTO SYSGLOBALCONFIGURATION (NAME,VALUE,SERVERID,SETTINGLEVEL,RECVERSION,RECID) VALUES (?,?,?,?,?,?)

  • CarloT Profile Picture
    CarloT on at
    RE: DB Synch fails during data upgrade from AX2012 at step 3

    Hello Anton, thank you for your reply.

    I checked the event viewer and it seems to give the same kind of info:

    Message">[DbSync: 7.0.30584.0] [Platform: 7.0.6801.37] [SourcePlatform: 7.0.6801.37]: Full sync did not complete successfully. Error: ArgumentNullException:Value cannot be null. Parameter name: metadata at Microsoft.Dynamics.Ax.Xpp.Utilities.ParameterHelper.Ensure(String parameterName, Object parameterValue) at Microsoft.Dynamics.AX.Data.Management.View.ViewQueryNode..ctor(Int32 dataset, AxQuerySimple metadata) at Microsoft.Dynamics.AX.Data.Management.View.ManagedSyncViewWorker.GetViewQueryNode(Int32 viewId, Boolean isDataEntityView) at Microsoft.Dynamics.AX.Data.Management.View.ManagedSyncViewWorker.PopulateViewList(Int32 viewId) at Microsoft.Dynamics.AX.Data.Management.View.ManagedSyncViewWorker.SortSyncRequest(IEnumerable`1 requests, Boolean isParallelSync) at Microsoft.Dynamics.AX.Data.Management.View.ManagedSyncViewWorker.SyncAll(IProducerConsumerCollection`1 modifiedViewDependencies) at Microsoft.Dynamics.AX.Data.Management.ManagedSyncWorkerManager.SyncAll() at Microsoft.Dynamics.AX.Data.Management.ManagedSync.<SyncAll>b__21_0() at Microsoft.Dynamics.AX.Data.Management.ManagedSync.EnsureMetadataProviderCacheCleared(Action action) at Microsoft.Dynamics.AX.Data.Management.ManagedSync.SyncAll() at Microsoft.Dynamics.AX.Framework.Database.Tools.LegacyCodepath.RunFullManagedSync(SyncOptions options, String sqlConnectionString, IMetadataProvider metadataProvider) at Microsoft.Dynamics.AX.Framework.Database.Tools.LegacyCodepath.<>c__DisplayClass20_0.<RunFullTableSync>b__0() at Microsoft.Dynamics.AX.Framework.Database.Tools.LegacyCodepath.ExecuteWithinAOS(SyncOptions syncOptions, String sqlConnectionString, IMetadataProvider metadataProvider, Func`1 func, Action`1 errorHandler).</

    I'm thinking there is a problem with a View maybe?

  • Anton Venter Profile Picture
    Anton Venter 18,779 Super User 2024 Season 2 on at
    RE: DB Synch fails during data upgrade from AX2012 at step 3

    Hi Carlo,

    Can you find a log file of the database sync? Perhaps in C:\AosService\PackagesLocalDirectory\bin\. Or have you looked in the Windows event viewer if there are any errors from SQL Server?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,188 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,030 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans