Sync-NAVTenant crashes for database converted from NAV2013

iponomarev
Member Posts: 6
Hello,
I am doing NAV2009 to NAV2015 upgrade. I got fully upgraded tables and data for NAV2013 (7.0) and I am trying to convert the result to NAV2015 (8.0) format. I am opening the database in finsql, all is going well, then I am invoking Sync-NAVTenant and getting the following:
I have tried to do this from finsql --- all the same, but there is some more information in Application Log:
Where is that character? What's the XML file? ](*,) Have tried the full upgrade process several times, pretty sure that everything is ok on NAV2013 (7.0) level --- and can't go on further to NAV2015...
I am doing NAV2009 to NAV2015 upgrade. I got fully upgraded tables and data for NAV2013 (7.0) and I am trying to convert the result to NAV2015 (8.0) format. I am opening the database in finsql, all is going well, then I am invoking Sync-NAVTenant and getting the following:
Sync-NAVTenant : "§", hexadecimal value 0x15, is an invalid character., line 196, position 226. строка:1 знак:1 + Sync-NAVTenant + ~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (0:Int32) [Sync-NAVTenant], NavCom mandException + FullyQualifiedErrorId : MicrosoftDynamicsNavServer$SONY2015-2,Microsoft. Dynamics.Nav.Management.Cmdlets.SyncNavTenant
I have tried to do this from finsql --- all the same, but there is some more information in Application Log:
Server instance: S5-2015 User: IVAN_VAIO\Ivan Type: System.Xml.XmlException LineNumber: 196 LinePosition: 226 Message: "§", hexadecimal value 0x15, is an invalid character., line 196, position 226. StackTrace: в System.Xml.XmlTextReaderImpl.Throw(String res, String[] args) в System.Xml.XmlTextReaderImpl.ParseAttributeValueSlow(Int32 curPos, Char quoteChar, NodeData attr) в System.Xml.XmlTextReaderImpl.ParseAttributes() в System.Xml.XmlTextReaderImpl.ParseElement() в System.Xml.XmlTextReaderImpl.ParseElementContent() в System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace) в System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) в System.Xml.XmlDocument.Load(XmlReader reader) в Microsoft.Dynamics.Nav.Runtime.NavSqlMetadata.GetTableMetadataFromAppDatabase(Int32 tableId, NCLMetaTable& table, NavBLOB& rawMetadata, NavText& newHash) в Microsoft.Dynamics.Nav.Runtime.NavSqlDatabaseSync.GetTableChanges(Boolean sortingPropertiesChanged, Boolean databaseConvertedFromNav2013) в Microsoft.Dynamics.Nav.Runtime.NavSqlDatabaseSync.SynchronizeTenantDatabase(NavSession session, SyncMode syncMode) в Microsoft.Dynamics.Nav.Runtime.NavTenant.Microsoft.Dynamics.Nav.Runtime.ITenantSessionHandler.RunTenantActionInSystemSession(Action`2 action, Boolean throwExceptions) в Microsoft.Dynamics.Nav.Runtime.NavSqlDatabaseSync.EnsureDatabaseInSync(SyncMode syncMode) в Microsoft.Dynamics.Nav.Runtime.NavSqlDatabaseSync.<>c__DisplayClass48.<StartSyncProcessIfNotAlreadyStarted>b__46() в System.Threading.Tasks.Task.Execute() --- Конец трассировка стека из предыдущего расположения, где возникло исключение --- в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) в Microsoft.Dynamics.Nav.Runtime.NavSqlDatabaseSync.StartSyncProcessIfNotAlreadyStarted(SyncMode syncMode) в Microsoft.Dynamics.Nav.Runtime.NavTenantManagementTasks.SynchronizeTenantDatabase(String tenantId, SyncMode syncMode, Boolean async) в SyncInvokeSynchronizeTenantDatabase(Object , Object[] , Object[] ) в System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) в Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.ErrorMappingCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs) Source: System.Xml HResult: -2146232000
Where is that character? What's the XML file? ](*,) Have tried the full upgrade process several times, pretty sure that everything is ok on NAV2013 (7.0) level --- and can't go on further to NAV2015...
0
Answers
-
As you figured out the error says that NAV ran into an invalid character, being hexadecimal value 0x15.
I had this also recently and was wondering the same: what XML file is containing this. What it appeared to be in my case was the MenuSuite 1090 (so for our add-on) that contained an invalid XML character in the Name property of one of the menusuite nodes.
XML does not allow all characters. Google for something like "XML invalid characters" and you will see.
How did I find out in what XML file, i.e. what C/SIDE object, this is to be found?
As I am working with TFS as our source control system, I have all C/SIDE objects in .txt files in one directory. From TFs I can do a directory search using regular expressions. This is the expression (using hex values) I used to find the object file(s) containing illegal XML characters: [\x00-\x08\x0B\x0C\x0E-\x1F]
hope this can help you.1 -
Thank you for your suggestion! However I do not work with TFS, when I just export all objects in one .txt file I cannot find anything suspicious, nothing that matches your regexp. Does TFS download objects code the other way than simple Export?0
-
iponomarev wrote:Does TFS download objects code the other way than simple Export?iponomarev wrote:Nothing that matches your regexp.0
-
Sorry, did you explicitly search for the character your error message is mentioning?
Yes, sure, I did! Full text export and rigorous notepad++ and grep search!
Don't know what to do now. I will try to erase objects and run Sync-NAVTenant on subsets of objects, maybe this can help to find out which object causes error (if the problem is in objects at all).0 -
Thank you Luc for absolutely correct suggestion, the problem is solved now!
Yes, the right way to solve the problem was exporting all objects in .txt file and searching. But in my case I had to search for another symbol, not 0x15. It was Cyrillic (Russian) letter 'с' unintentionally used instead of Latin 'c' in one of identifiers. Both letters look the same, but they are different characters.
It seems that NAV2009 and NAV2013 work fine with 'с', but NAV2015 doesn't want to. Three working days lost for just one erroneous keystroke.
Regards,
Ivan0 -
iponomarev wrote:Thank you Luc for absolutely correct suggestion, the problem is solved now!iponomarev wrote:Yes, the right way to solve the problem was exporting all objects in .txt file and searching. But in my case I had to search for another symbol, not 0x15. It was Cyrillic (Russian) letter 'с' unintentionally used instead of Latin 'c' in one of identifiers. Both letters look the same, but they are different characters.iponomarev wrote:Three working days lost for just one erroneous keystroke.
Still on my list to write a blog post on my issue. Started already but not yet finished. Glad I could be of use to you.
Please mark this posted as solved.0 -
How did you find out?
1. Deleted approximately one half of tables and tried Sync-NAVTenant. It worked without the error, hence the broken one was in the deleted half! Repeated this step several times...
2. Exported a 'suspicious' subset of tables, used a long regexp [^a-zA-Z=.,;...... and searched for every unusual character... And here it is!0 -
=D> :thumbsup:
BTW: have written a blog post on my findings [url-http://dynamicsuser.net/blogs/vanvugt/archive/2015/04/18/hunting-mr-x-uhhh-0x1c.aspx]here[/url].0 -
Instead, open text file in notepad and search for Non-ASCII characters. Go to "Search" -> Search ASCII.0
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