fsprojects / fsprojects/Paket

Running "paket install" results in "ArgumentException: Illegal characters in path."

Open
#4,004 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
F#
Stars
2.1k
Forks
528
Avg merge
1d 12m
Merged PRs (30d)
54

Description

Description

Running "paket install" produces the following error:

Paket failed with
-> ArgumentException: Illegal characters in path.
Repro steps

I can only reproduce it in one of my repositories which is pretty big one (over 200 projects), but it happens on 2 different machines.

Expected behavior

Maybe better error message, which includes invalid path in question? Right now I have no way to find out why it is failing and what exactly I need to fix.

Actual behavior

Here's full stacktrace reported when I run it with "--verbose":

Paket failed with
-> ArgumentException: Illegal characters in path.
   StackTrace:
        at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
        at System.IO.Path.InternalGetDirectoryName(String path)
        at Paket.NuGet.ofDirectory@155.Invoke(String di)
        at Microsoft.FSharp.Collections.SeqModule.Iterate[T](FSharpFunc`2 action, IEnumerable`1 source)
        at Paket.NuGet.ofDirectory$cont@134(String targetFolder, String spec, Unit unitVar)
        at Paket.NuGet.GetContentWithNuSpec@224.Invoke(Unit unitVar)
        at System.Lazy`1.CreateValue()
        at System.Lazy`1.LazyInitValue()
        at System.Lazy`1.CreateValue()
        at System.Lazy`1.LazyInitValue()
        at Paket.RestoreProcess.CreateInstallModel@248-1.Invoke(Tuple`2 _arg1)
        at Microsoft.FSharp.Control.AsyncBuilderImpl.args@506-1.Invoke(a a)
     --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
        at Microsoft.FSharp.Control.AsyncBuilderImpl.commit[a](AsyncImplResult`1 res)
        at Microsoft.FSharp.Control.CancellationTokenOps.RunSynchronouslyInCurrentThread[a](CancellationToken token, FSharpAsync`1 computation)
        at Microsoft.FSharp.Control.CancellationTokenOps.RunSynchronously[a](CancellationToken token, FSharpAsync`1 computation, FSharpOption`1 timeout)
        at Microsoft.FSharp.Control.FSharpAsync.RunSynchronously[T](FSharpAsync`1 computation, FSharpOption`1 timeout, FSharpOption`1 cancellationToken)
        at Microsoft.FSharp.Collections.Internal.IEnumerator.map@74.DoMoveNext(b& curr)
        at Microsoft.FSharp.Collections.Internal.IEnumerator.MapEnumerator`1.System-Collections-IEnumerator-MoveNext()
        at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.takeOuter@274[T,TResult](ConcatEnumerator`2 x, Unit unitVar0)
        at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.takeOuter@274[T,TResult](ConcatEnumerator`2 x, Unit unitVar0)
        at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
        at Microsoft.FSharp.Collections.SeqModule.ToArray[T](IEnumerable`1 source)
        at Paket.InstallProcess.InstallIntoProjects[a](InstallerOptions options, Boolean forceTouch, DependenciesFile dependenciesFile, LockFile lockFile, FSharpList`1 projectsAndReferences, FSharpMap`2 updatedGroups)
        at Paket.UpdateProcess.SmartInstall(DependenciesFile dependenciesFile, UpdateMode updateMode, UpdaterOptions options)
        at <StartupCode$Paket-Core>.$PublicAPI.Install@266.Invoke(Unit unitVar0)
        at Paket.Utils.RunInLockedAccessMode[a](String lockedFolder, FSharpFunc`2 action)
        at Paket.Program.handleCommand@840-11.Invoke(ParseResults`1 results)
        at Paket.Program.processWithValidationEx$cont@42[a](Boolean silent, FSharpFunc`2 commandF, a result, Unit unitVar)
        at Paket.Program.processWithValidation[T](Boolean silent, FSharpFunc`2 validateF, FSharpFunc`2 commandF, ParseResults`1 result)
        at Paket.Program.handleCommand(Boolean silent, Command command)
        at Paket.Program.main()

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Paket.NuGet.ofDirectory entry point shown in the stack trace and reproduce the failure with paket install --verbose. Trace which path reaches that entry point and add diagnostics identifying the invalid path; done means the error names the problematic path and a regression test covers the failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
fsharp
Domain
cli, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.