Document is invalid- Unable to open the Workflow file

Hi Team,
Not able to open the xaml file before it is working fine but now I’m facing the problem that not able to open the document and it is throwing an error that document is invalid.

Please check the logs and provide the solution as soon as possible.

Logs…

21.10.5+Branch.support-v21.10.Sha.369f46199a0fa6287d86ab2534b6896019db01bc

Unexpected end of file while parsing Name has occurred. Line 654, position 48.

Error: System.Xml.XmlException: Unexpected end of file while parsing Name has occurred. Line 654, position 48.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.ParseQName(Boolean isQName, Int32 startOffset, Int32& colonPos)
at System.Xml.XmlTextReaderImpl.ThrowTagMismatch(NodeData startTag)
at System.Xml.XmlTextReaderImpl.ParseEndElement()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r)
at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options)
at System.Xml.Linq.XDocument.Load(String uri)
at UiPath.Studio.Plugin.Workflow.Document.XamlDocumentReader.ReadAsync(String path)
at UiPath.Studio.Core.Services.PersistableServiceBase3.GetFactoryByPath(String path) at UiPath.Studio.Core.Services.PersistableServiceBase3.ResolveFactory(OpenInformation openInfo)
at UiPath.Studio.Core.Services.PersistableServiceBase3.OpenAsync(OpenInformation openInfo) at UiPath.Studio.Shell.ViewModels.MainWindowViewModel.OpenEntryPoint() at UiPath.Studio.App.Desktop.MVVM.Commands.TaskCommand3.Execute(TExecuteParameter parameter, Boolean ignoreCanExecuteCheck)
at System.Threading.Tasks.Task.<>c.b__140_0(Object state)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler), HResult -2146232000

@loginerror
@Palaniyappan
@ppr
@Yoichi
@supermanPunch
@Steven_McKeering
@postwick

Hi,

It seems your file is corrupted…
You might be able to restore if you have backup or published package etc.

Regards,

1 Like

Hi @Dhanush_Naik1 ,

You can try deleting the project.json file and open the project again and try the same

Hi! @Yoichi

Thanks for the reply. i don’t have ay backup file to restore.

can we restore the original file?

Regards,

Hi,

For now, can you try the following steps?
In File Explorer, select the xaml file, then right click - Property - Previous Version tab.
If there is previous file(s), you might be able to restore.

Or, if we can add end tags manually to the xaml file, it might be able to restore partially.

Regards,

Hi!

We tried the same. but there were no previous versions. could you please tell me the case of having the corrupted file.

Regards,

Hello @Dhanush_Naik1 ,

Did you made any configuration changes or changes in project.json file?

Also is there any other xaml file available in your project? If yes are you facing the same error for that as well?

Hi,

I think the only way is to add end tags for partially recovering.
If possible, can you share the xaml file?

Regards,

Hi @Dhanush_Naik1

If you open the xaml file with a Notepad (or any other text editor), what is the current content?
Any chance you could share the file with us (even if privately via a private message to me)?

Could you also let us know what is the most probably cause of the corruption (as in, when was it working and what could have changed in the meantime that it stopped working)?

1 Like

was any packages upgraded / downgraded or a project target template change done?
can you share the xaml and the project json.

In a lot of cases we achieved good results with repairing on XAML level within text editor.

From message we would assume that on line 654 a name property / element is to check

Hi! @ppr

Yes, we did tried the upgrade and downgrade the packages in the main xaml. and also deleted the json. still didn’t worked.

Thanks for the reply…

Regards,

when you can share (feel free to do it as private message) we can have a look on it

Hi!

Yes @Yoichi, we opened it in the visual studio and tried adding the end tag also but didn’t resolved yet…

any other solutions for this…

Regards,

Hi,

As @loginerror and @ppr mentioned, is there any chance you could share the xaml file, even using private message? It’s difficult for us to consider ways without seeing the actual contents of the xaml file…

Regards,

Hi @Dhanush_Naik1 ,

Is it a Particular xaml file having the problem, or all of the xaml files in the Project Folder ?

@Dhanush_Naik1
Just a first feedback. The XAML is broken and on the end contant is lost, so XML tags are not closed properly.

Lets try what can be recovered, but needs some hacking

have send you as PM a part recovered XAML, Sadly there was some losts.

1 Like

Hi! @ppr,

Thanks for taking time to recover it. anyways 90% of the data has been lost.

Thanks a lot for your efforts…

Regards,

Hi! @supermanPunch,

I am using REFramework… in that i have lost the initAllApplications xaml got corrupted…

Regards,

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.