Options

Sync-NAVTenant crashes for database converted from NAV2013

iponomareviponomarev Member Posts: 6
edited 2015-04-15 in NAV Three Tier
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:
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...

Answers

  • Options
    lvanvugtlvanvugt Member Posts: 774
    edited 2015-04-18
    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.
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
  • Options
    iponomareviponomarev Member Posts: 6
    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?
  • Options
    lvanvugtlvanvugt Member Posts: 774
    iponomarev wrote:
    Does TFS download objects code the other way than simple Export?
    No. Export is done exactly the same way. I was just mentioning it as the "method" I used for searching in the objects.
    iponomarev wrote:
    Nothing that matches your regexp.
    Sorry, did you explicitly search for the character your error message is mentioning?
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
  • Options
    iponomareviponomarev Member Posts: 6
    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).
  • Options
    iponomareviponomarev Member Posts: 6
    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,

    Ivan
  • Options
    lvanvugtlvanvugt Member Posts: 774
    iponomarev wrote:
    Thank you Luc for absolutely correct suggestion, the problem is solved now!
    Ivan, you are welcome.
    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.
    How did you find out?
    iponomarev wrote:
    Three working days lost for just one erroneous keystroke.
    It took me two days to find, indeed frustrating.
    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.
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
  • Options
    iponomareviponomarev Member Posts: 6
    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!
  • Options
    lvanvugtlvanvugt Member Posts: 774
    =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].
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
  • Options
    ravinder_waldiaravinder_waldia Member Posts: 2
    Instead, open text file in notepad and search for Non-ASCII characters. Go to "Search" -> Search ASCII.
Sign In or Register to comment.