Path to long error

Hello Guys
I’m currently studying how to use UI Studio and I have been encountering an error code that has been spamming me.
Error Code:
Error: LibGit2Sharp.LibGit2SharpException: invalid path ‘\?\C:\Users\Millow\AppData\Local\JetBrains\IdeaIC2021.1\index\shared\shared.index.hashes.org.jetbrains.kotlin.idea.versions.KotlinJsMetadataVersionIndex\shared.index.hashes.org.jetbrains.kotlin.idea.versions.KotlinJsMetadataVersionIndex_storage.storage.keystream.len’ (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.RepositoryStatusService.RetrieveStatus(String repositoryPath, StatusOptions options, Action2 sandboxedAction) at UiPath.Studio.Plugin.Git.Services.ItemStatusService.UpdateCache(String workingDirectory, String path, IGetStatusOptions options) at UiPath.Studio.Plugin.Git.Services.ItemStatusService.GetItemStatusCore(String workingDirectory, String path, IGetStatusOptions options) at UiPath.Studio.Plugin.Git.Services.ItemStatusService.<>c__DisplayClass12_0.<GetItemStatusAsync>b__0() at UiPath.Studio.Plugin.Git.Services.GitSession.<>c__DisplayClass17_01.b__1(IRepository _)
at UiPath.Studio.Plugin.Git.Services.GitSession.ThreadSafeExecute[TResult](Func2 action, Func1 repoFactory)
at UiPath.Studio.Plugin.Git.Services.GitSession.<>c__DisplayClass17_01.<ExecuteAsync>b__0(CancellationToken _) at UiPath.Shared.ProducerConsumerPair.<>c__DisplayClass18_01.b__0()
at System.Threading.Tasks.Task1.InnerInvoke() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at UiPath.Studio.Plugin.Git.Services.GitSession.ExecuteAsync[TResult](Func1 action)
at UiPath.Studio.Plugin.Git.Services.ItemStatusService.GetItemStatusAsync(IGitSession session, String path, IGetStatusOptions options)
at UiPath.Studio.Plugin.Git.GitSourceControl.GetItemStatusAsync(String path, Boolean refreshCache)
at UiPath.Studio.SourceControl.Shared.Services.UI.BaseSourceControlUi1.RefreshBadgesAsync() at UiPath.Studio.Shell.SourceControl.SourceControlService.RefreshBadgesCore(IReadOnlyCollection1 paths, OperationType operationType)
at UiPath.Studio.Shell.SourceControl.SourceControlService.<>c__DisplayClass30_0.<<DocumentService_DocumentModified>b__0>d.MoveNext()
— End of stack trace from previous location —
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 -2146233088

Been working around the clock trying to fix this :frowning:

@Millow_Gapay

Welcome to our UiPath community.

It might help you.

1 Like

This is a standard Windows limitation. Shorten the path.

1 Like

I tried to shorten the path but after that it tells me to shorten another path, I have shorten 3 paths already but it keeps giving the same error.

I have already tried this but it keeps giving me the same error.

@Millow_Gapay

Can you share the path which you are trying?

Usually the path is as below
image

Check if you are exceed 260 characters

Naming Files, Paths, and Namespaces - Win32 apps | Microsoft Learn.

Hope this will help you

Thanks


This is the 3rd path that I am trying to shorten

can you map that folder to a drive? e.g. Z: drive
then change the path the Z:\shared.index.hashes.org.jetbrains…
image

I haven’t tried this will do right now

Just remember, if you do a mapping to get around this issue you’ll have to have the exact same mapping on any computer where the automation runs.

1 Like

Also, I see a lot of post on jetbrains.com about this kind of issue. You should reach out to their support.

@postwick thanks will do try to reach out to jetbrains.com about this issue.

Can the Bot Check for the Mapped drive in a Try Catch and map it if not found?

Depends on permissions, if the user can map a drive or not. Could just do it via command prompt. But what happens if the user running the automation already has that drive mapped to something else?

Trying to get around it with drive mappings really isn’t a good solution.

Is your Windows later than Windows 10 version 1607?

That is the point of using the map Activity inside a Try Catch and catch the error that the letter is already used or use the activity that returns True of False on does a directory exist as it can include a drive letter, and use a loop to find an unused drive letter.

Sure, that kind of logic is doable, but if you’re on a late enough version of Windows it would be easier to just eliminate the path length restriction. It’s amazing the restriction still exists by default in Windows. It’s 2022 and we can only have a 260 character path?!

1 Like

True, I was just offering a possible work around for someone that may not have a later Windows version available. My company did not move to Windows 10 until late February this year.

Thank guys I was able to solve this by deleting all the paths and It seemed to work fine I got no errors what’s so ever :slight_smile: