ERROR: UiPath.Studio.Contracts.RecoverableException: The item '\Main.xaml' could not be opened: Document is invalid

Hi,

Facing an error when trying to open the project Main.xaml file (file didn’t shut down unexpectedly/didn’t face any problems up to this point). Other sequences within that same project are opening fine.

I have already tried deleting the JSON file, restarting system, copying the Main.xaml file to a new project. Nothing has worked.

I have been working on this project for quite a while and would kindly appreciate any suggestion on how to recover this file.

Details:
Studio 2018.4.4
Enterprise Edition
Windows Installer

License Provider: Orchestrator

Microsoft Windows 10 Enterprise 64-bit
.NET Framework Version 4.7.2 or later

Error detail:
image

18.4.4+Branch.support/v2018.4.Sha.f763d4ae80fa90017d15cf7fd8625d0b338b8116

The item ‘\\shared\Main.xaml’ could not be opened: Document is invalid.

Cannot open item: UiPath.Studio.Contracts.RecoverableException: The item ‘\Main.xaml’ could not be opened: Document is invalid. —> System.IO.InvalidDataException: Document is invalid
at UiPath.Studio.Plugin.Workflow.WorkflowHandling.DesignerWrapper.InitRootActivity(String filename) in D:\a\1\s\Studio\UiPath.Studio.Plugin.Workflow\WorkflowHandling\DesignerWrapperInit.cs:line 247
at UiPath.Studio.Plugin.Workflow.WorkflowHandling.DesignerWrapper.Load(String fileName) in D:\a\1\s\Studio\UiPath.Studio.Plugin.Workflow\WorkflowHandling\DesignerWrapperInit.cs:line 72
at UiPath.Studio.Plugin.Workflow.Services.DesignerFileService.<>c__DisplayClass10_0.b__0() in D:\a\1\s\Studio\UiPath.Studio.Plugin.Workflow\Services\DesignerFileService.cs:line 107
at UiPath.Studio.Shared.MVVM.Services.DispatcherExtensions.Invoke(Dispatcher dispatcher, Action action, Boolean onlyBeginInvokeWhenNoAccess) in D:\a\1\s\Studio\UiPath.Studio.Shared\MVVM\Services\Extensions\DispatcherExtensions.cs:line 121
at UiPath.Studio.Shared.MVVM.Services.DispatcherService.Invoke(Action action, Boolean onlyInvokeWhenNoAccess) in D:\a\1\s\Studio\UiPath.Studio.Shared\MVVM\Services\DispatcherService.cs:line 162
at UiPath.Studio.Plugin.Workflow.Services.DesignerFileService.Load(String fileName) in D:\a\1\s\Studio\UiPath.Studio.Plugin.Workflow\Services\DesignerFileService.cs:line 88
at UiPath.Studio.Plugin.Workflow.Services.Interfaces.IDesignerFileService.Load(String fileName)
at UiPath.Studio.Plugin.Workflow.Services.DesignerFileServiceProxy.Load(String fileName) in D:\a\1\s\Studio\UiPath.Studio.Plugin.Workflow\Services\Proxies\DesignerFileServiceProxy.cs:line 20
at UiPath.Studio.Plugin.Workflow.WorkflowDocument…ctor(String path, IDesignerFileService designerFileService, IExtendedFileSystem fileSystem, IDesignerViewService designerViewService) in D:\a\1\s\Studio\UiPath.Studio.Plugin.Workflow\Document\WorkflowDocument.cs:line 53
at UiPath.Studio.Plugin.Workflow.WorkflowDocumentFactory.OpenAsync(String path) in D:\a\1\s\Studio\UiPath.Studio.Plugin.Workflow\Document\WorkflowDocumentFactory.cs:line 253
at UiPath.Studio.Core.Services.PersistableServiceBase3.<OnOpenAsync>d__15.MoveNext() in D:\a\1\s\Studio\UiPath.Studio.Core\CommonServices\PersistableServiceBase.cs:line 188 --- End of inner exception stack trace --- at UiPath.Studio.Core.Services.PersistableServiceBase3.d__15.MoveNext() in D:\a\1\s\Studio\UiPath.Studio.Core\CommonServices\PersistableServiceBase.cs:line 198
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.Studio.Shell.Services.DocumentService.d__45.MoveNext() in D:\a\1\s\Studio\UiPath.Studio.Shell\Services\DocumentService.cs:line 354
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.Studio.Core.Services.PersistableServiceBase3.<OpenAsync>d__8.MoveNext() in D:\a\1\s\Studio\UiPath.Studio.Core\CommonServices\PersistableServiceBase.cs:line 0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at UiPath.Studio.Shell.ViewModels.Project.FileProjectItemViewModel.<OpenExecute>d__11.MoveNext() in D:\a\1\s\Studio\UiPath.Studio.Shell\ViewModels\Project\FileProjectItemViewModel.cs:line 73 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at UiPath.Studio.Shell.ViewModels.Project.FileSystemProjectItemViewModelBase.<<-ctor>b__9_0>d.MoveNext() in D:\a\1\s\Studio\UiPath.Studio.Shell\ViewModels\Project\FileSystemProjectItemViewModelBase.cs:line 59 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at UiPath.Studio.Shared.MVVM.Commands.TaskCommand3.d__35.MoveNext() in D:\a\1\s\Studio\UiPath.Studio.Shared\MVVM\Commands\TaskCommand.cs:line 282
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.b__6_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 -2146233088

Hi, welcome to the community!
So do you remember the last action you did on this project before the problem started? Do you usually leave the Studio open to work the next day or you are used to always close before you leave working? Usually when we open the Studio checks the file and asks if we want to recover the file, but if you dont, then it will become impossible to recover again…

Hi bcorrea,

Thanks for your prompt response. I recall I have executed the project, added one invoke process activity and clicked save. Cannot remember whether I closed UiPath before shutting down the laptop but I haven’t done anything different than in the last 6 months so this comes as a surprise to me. I didn’t get any notification whether I’d like to recover any files.

my ITD team were able to retrieve a backup. Thanks for your help. Nevertheless, this UiPath data corruption behaviour is worrying.

1 Like

@def2302

FWiW, I have used UIPath for the past year and this has never happened. The only time an issue came up is when I changed something I shouldn’t have - but even in that case I was able to edit the XML file and was back in business.