Business Central OnPrem sync-navtenant: the operation could not complete because a record was locked

technique
Member Posts: 21
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!?
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
Best Answers
-
Check in the SSMS if you have Change Tracking enabled for your database.Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-035 -
Slawek_Guzek - you are bang on the money thank you so much!!!
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...0
Answers
-
What about in the SQL server?
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 -VerboseFor help, do not use PM, use forum instead, perhaps other people have the same question, or better answers.0 -
Thanks but it now appears to be data related as I just exported all objects into a copy of the Demo DB from CU2 and everything works! So now I'm going to backup my working CU1 company, attempt to import it into CU2 and report back...0
-
Import failed.
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?0 -
If you go to SQL Management Studio and look in the activity monitor does any thing else using the database?For help, do not use PM, use forum instead, perhaps other people have the same question, or better answers.0
-
Check in the SSMS if you have Change Tracking enabled for your database.Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-035 -
Check if the database ins't in single-user mode.0
-
Slawek_Guzek - you are bang on the money thank you so much!!!
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...0 -
I'm trying to upgrade from nav2016 to CU03. The error
'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.0 -
The solution for upgrading to CU02 and CU03 was not disabling Change tracking for me.
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.
0 -
There is indeed an issue here starting with BC CU 02 to 05.
https://community.dynamics.com/business/b/businesscentraldevitpro/archive/2019/03/29/technical-upgrade-to-business-central-cumulative-updates-02-05-tenant-synchronization-issueKai Kowalewski0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions