Error - Invalid Path (Path too long)

When I create a new Process and try to execute it, this error pops up and Crash the UiPath.

invalid path ‘\?\C:\Users\gurde.gradle\caches\5.4.1\scripts-remapped\sync_ng_build_script_classpath_3plp7sf40psnra5c595azxqkz\8216xdmczgsh3zdodg0qqnb4p\cp_initdcd040730888da95d185715568c9cc57\classes\sync_ng_build_script_classpath_3plp7sf40psnra5c595azxqkz$_run_closure1$_closure2.class’ (path too long)

Error: LibGit2Sharp.LibGit2SharpException: invalid path ‘\?\C:\Users\gurde.gradle\caches\5.4.1\scripts-remapped\sync_ng_build_script_classpath_3plp7sf40psnra5c595azxqkz\8216xdmczgsh3zdodg0qqnb4p\cp_initdcd040730888da95d185715568c9cc57\classes\sync_ng_build_script_classpath_3plp7sf40psnra5c595azxqkz$_run_closure1$_closure2.class’ (path too long)
at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
at LibGit2Sharp.Core.Proxy.git_status_list_new(RepositoryHandle repo, GitStatusOptions options)
at LibGit2Sharp.RepositoryStatus…ctor(Repository repo, StatusOptions options)
at LibGit2Sharp.Repository.RetrieveStatus(StatusOptions options)
at UiPath.Studio.Plugin.Git.Services.Core.RepositoryStatusService.RetrieveStatus(String repositoryPath, StatusOptions options, Action2 sandboxedAction) at UiPath.Studio.Plugin.Git.Services.Core.ItemStatusService.UpdateCache(String workingDirectory, String path, IGetStatusOptions options) at UiPath.Studio.Plugin.Git.Services.Core.ItemStatusService.GetItemStatusCore(String workingDirectory, String path, IGetStatusOptions options) at UiPath.Studio.Plugin.Git.Services.Core.ItemStatusService.<>c__DisplayClass12_0.<GetItemStatusAsync>b__0() at UiPath.Studio.Plugin.Git.Services.Core.GitSession.<>c__DisplayClass15_01.b__1(IRepository _)
at UiPath.Studio.Plugin.Git.Services.Core.GitSession.ThreadSafeExecute[TResult](Func2 action, Func1 repoFactory)
at UiPath.Studio.Plugin.Git.Services.Core.GitSession.<>c__DisplayClass15_01.<ExecuteAsync>b__0(CancellationToken _) at UiPath.Shared.ProducerConsumerPair.<>c__DisplayClass18_01.b__0()
at System.Threading.Tasks.Task1.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- 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.Plugin.Git.Services.Core.GitSession.<ExecuteAsync>d__151.MoveNext()
— 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.Plugin.Git.Services.Core.ItemStatusService.d__12.MoveNext()
— 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.Plugin.Git.GitSourceControl.d__21.MoveNext()
— 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.SourceControl.Shared.Services.UI.BaseSourceControlUi`1.d__35.MoveNext()
— 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.SourceControl.SourceControlService.d__38.MoveNext()
— 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.SourceControl.SourceControlService.<>c__DisplayClass27_0.<<DocumentService_DocumentModified>b__0>d.MoveNext()
— 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.Services.DispatcherService.<>c__DisplayClass14_0.<b__0>d.MoveNext()
— 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.Services.DispatcherService.d__14.MoveNext()
— 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.SourceControl.SourceControlService.<DocumentService_DocumentModified>d__27.MoveNext()
— 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

Yes it is really too long. Either fix the root of the problem or try the configuration in Windows:

I understand it is long, And I can shorten it or move the file to some other location. The same was suggested with a similar problem on this forum, But the question is, If I shorten the path or move the file, where should I update that values? I have no idea why and how and where this location and file is being used in my process!

Please guide me in that!

Hi @gurdeep_singh, please give more information about your problems such as screenshot your designer screen or upload XAML here.

Hi @dunglt, Thanks for reaching out!

Let me share some screenshots, I have 3 screenshots here, 1 shows my design process, 2 shows my Error, 3 shows my file (To which this error is connected).

1: I have nothing in my design, from last few days, no matter what I design(develop), this error shows up, I just have Open Browser activity which launches a website, but this error shows up, no matter what is design.

2: This is not related to anything I am using in my process, it is related to some Gradle file, I have no clue why that file is getting mentioned over here.

3: In one of my screenshots, I have mentioned the file which is connected to this error, it is highlighted in Yellow.

(There is a similar error and the conversation went on the Uipath forum, here is the link to that Erreur: Exception: invalid path '\\?\C:\User, I don’t understand the solution, they say shorten the path length or change the location of the file, Yes I can do that, but where shall I update what I changed? I have no clue.)

The cause here seems to be caused by the Window cache or executor service.

Based on the screenshots, this workflow not doing anything and this is an academy demo project, I suggest you create a new project and copy this file to the new project. it may help.

If it helps you could take reference from this post. Long path tool in uipath - #15

post

Hi @dunglt, thanks for suggestion, I tried to copy this file to project folder, but I am still facing the issue, UiPath crash down when I execute the process to run!

Do you have any other solution?

Hi @Mira_Somo thanks for your reply!

Yes, I can shorten the path or relocate this file manually or through these tools you have mentioned. But the question is, once I shorten the path or relocate the file, the changes that has made by this, has to be updated somewhere right?

My UiPath is somehow connected to this file, hence it is throwing the error. So when I make changes (Shorten the path or relocate the file), where Am I supposed to make changes in UiPath, I am clueless here, how, where and why is this file is connected to my UiPath.

Thanks!

2 Likes

I have the same problem :confused:

@gurdeep_singh I removed the file and the problem was solved :smiley:

Not actually, UiPath doesn’t work well after deleting the files, the software got slow.