Hi Experts,
We have encountered the error below when upgrading the database from BC16.1 to BC 16.2. Previously the database is upgraded from BC15 to BC16.0, then we upgrade from BC16.0 to BC16.1 when released. We upgraded smoothly with no issue. Recently, we tried to upgrade the database to latest BC version(16.2) but hitting the error below when running this command: Sync-NAVTenant -ServerInstance BC161 -Tenant default -Mode Sync -Force
Upgrading the standard database has no issue. But hit the error when upgrading the customer database.
Any hint for this error is much appreciated. Thank you
Here is the error taken from EventViewer:
Message (ArgumentException): RootException: ArgumentException
An item with the same key has already been added.
ExceptionStackTrace:
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Microsoft.Dynamics.Nav.Runtime.Apps.CompanionTablePrimaryKeyFixer.GetTablesGroupsWithWrongPrimaryKey()
at Microsoft.Dynamics.Nav.Runtime.Apps.CompanionTablePrimaryKeyFixer.GetCommands()
at Microsoft.Dynamics.Nav.Runtime.NavSqlTenantPropertiesSync.Upgrade(NavSqlConnectionScope conScope)
at Microsoft.Dynamics.Nav.Runtime.NavSqlTenantPropertiesSync.Sync()
at Microsoft.Dynamics.Nav.Runtime.NavSqlDatabaseSync.SynchronizeTenantDatabase(NavSession session, SynchronizationSetup syncSetup, Boolean sortingPropertiesDifferent)