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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

SyncNavTenant error during upgrade

(0) ShareShare
ReportReport
Posted on by 259

Hey,

i Have a problem with upgrading to bc 16.2 from nav 2018. When i'm trying to synchronize the database, i get following error:

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)
at Microsoft.Dynamics.Nav.Runtime.NavSqlDatabaseSync.<>c__DisplayClass92_0.b__1(NavTenant tenant, NavSession systemSession)
at Microsoft.Dynamics.Nav.Runtime.NavTenant.Microsoft.Dynamics.Nav.Runtime.ITenantSessionHandler.RunTenantActionInSystemSession(Action`2 action, Boolean throwExceptions, Boolean useCurrentCulture, Boolean allowAppsDisabledMode, LanguageSetting language)
at Microsoft.Dynamics.Nav.Runtime.NavSqlDatabaseSync.EnsureDatabaseInSync(SynchronizationSetup syncSetup)
CallerStackTrace:
at Microsoft.Dynamics.Nav.Runtime.NavSqlDatabaseSync.EnsureDatabaseInSync(SynchronizationSetup syncSetup)
at Microsoft.Dynamics.Nav.Runtime.NavSqlDatabaseSync.<>c__DisplayClass119_0.b__0()
at Microsoft.Dynamics.Nav.Runtime.NavTaskFactory.<>c__DisplayClass1_0.b__0()
at System.Threading.Tasks.Task.Execute()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
at System.Threading.ThreadPoolWorkQueue.Dispatch()

Does anybody know how to solve it?

It does not provide any information, on which object it fails. 

I have the same question (0)
  • Suggested answer
    Marco Mels Profile Picture
    on at

    Hello,

    I believe this is a bug and resolved in a later CU. The error was found in SaaS while we upgraded to BC16.2. In BC16.4 we added an important fix:

    364762

    Fix an issue that could cause tenant synchronization requests to return without synchronizing.

    I would suggest if possible to test the upgrade to 16.4 instead to 16.2. Alterntively, you may want to raise a SR to Microsoft via your CSP.

    Thanks.

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

News and Announcements

Season of Giving Solutions is Here!

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,651

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 808 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 718 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans