I've just recently upgraded from CU1 to CU2 of Business Central on-premises and now I can't synchronise the schema via Powershell & the NAV RTC will not run at all.
The error makes no sense as I've closed all sessions and other than the BC130 service nothing is accessing the database (other than my Powershell command).
The exact error is:
sync-navtenant : The operation could not complete because a record was locked by another user. Please retry the activity.
At line:1 char:1
+ sync-navtenant bc130
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (0:Int32) [Sync-NAVTenant], NavCommandException
+ FullyQualifiedErrorId : MicrosoftDynamicsNavServer$bc130,Microsoft.Dynamics.Nav.Management.Cmdlets.SyncNavTenant
This worked fine in CU1 but I have to use CU2 so I have the latest objects and application for 'Making Tax Digital'.
In CU2 I can still compile the tables 'with validation' perfectly.
But attempting to run the RTC produces the following error: 'The system is not accessible'.
This is a very frustrating show-stopper as I have no clue what is causing this & can't get past it. PLEASE help!?
0
Answers
Is anything using the NAV database?
Try running:
Sync-NAVTenant -ServerInstance 'XXX' -Mode CheckOnly -Verbose
if not error occurred then
Sync-NAVTenant -ServerInstance 'XXX' -Mode ForceSync -Verbose
SanderDk- I've just tried your suggestion and the CheckOnly executes fine, no errors but the ForceSync fails with the same message as before 'a record was locked by another user'
What can I try now?
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
When you open the old database with the new CU02 client and NAV performs the automatic database upgrade task it is enabling change tracking on the following tables...
Add-in
Object Metadata
NAV App Object Metadata
NAV App Tenant App
NAV App
NAV App Publish Reference
Debugger Breakpoint
By resetting these and turning off Change Tracking I can solve my issue.
I think this is a bug with Cumulative Update 2 as this doesn't occur with CU1 and I can't see why MS would make such a (stupid) deal breaking change...
'The operation could not complete because a record was locked by another user' when executing
sync-navtenant still occurs.
I tried to solve this by disabling changetracking as explained in previous post.
It seems to work fine, I can disable change tracking for the database after disabling it
for the 7 tables.
But now the following error pops up after sync-navtenant:
Change tracking is not enabled on table 'dbo.Object Metadata'.
Is this new to CU03, or am I missing something here?
.. After some searching I found out that the classic client sets the values during the upgrade.
AND the servicetier resets them at start-up. So disabling them in sql server is useless now.
Also sync-navtenant checks if the settings are on. No way around it anymore.
Hopefully this is a setting in the serverconfig file, but I haven't been able to find it yet.
After
Task 6: Convert the old database to the Business Central format
Perform the following:
-Start BC130 servicetier
-Open development environment as admin
-Compile all system tables (2000000000..) with the force (locked by another user error appears at company
table)
-Compile all system tables with force again (the error is gone)
-Stop BC130 servicetier
continue upgrade as usual.
Change tracking was never disabled.
https://community.dynamics.com/business/b/businesscentraldevitpro/archive/2019/03/29/technical-upgrade-to-business-central-cumulative-updates-02-05-tenant-synchronization-issue