Skip to content

"File already exists" error when installing multiple copies of the same package external to the packages folder, ignores --force #1504

Open
@galaxystar

Description

@galaxystar

This issue is somewhat related to: #1472

When Paket installs to a path outside of the ./packages directory, I receive the error below, when multiple packages reference the same package (and all of which trying to install to the path outside of the ./packages folder)

I've tried using paket install -f and paket install --hard and paket instal -f --hard but they all fail when trying to extract the file.

Regardless of the use case that caused this It would be nice if the force flag would overwrite files which already exist, as I would expect FORCE to do.

Paket failed with:
    Error during extraction of /<path>/packages/<package group>/PackageName/PackageName.1.0.8.nupkg.
Message: Could not create file "/<path outside of packages foder>/<some file>". File already exists.

Stack Trace:

StackTrace:
    at [email protected] (System.String message) <0x1108c52a0 + 0x0002f> in <filename unknown>:0 
  at Microsoft.FSharp.Core.PrintfImpl+StringPrintfEnv`1[TResult].Finalize () <0x10abe5c10 + 0x00039> in <filename unknown>:0 
  at Microsoft.FSharp.Core.PrintfImpl+Final4@259[TState,TResidue,TResult,A,B,C,D].Invoke (Microsoft.FSharp.Core.FSharpFunc`2 env, A a, B b, C c, D d) <0x1108c50d0 + 0x001bb> in <filename unknown>:0 
  at Microsoft.FSharp.Core.OptimizedClosures+Invoke@3307-3[T2,T3,T4,T5,TResult,T1].Invoke (T2 u, T3 v, T4 w, T5 x) <0x1108c5080 + 0x00047> in <filename unknown>:0 
  at Microsoft.FSharp.Core.OptimizedClosures+Invoke@3301-2[T2,T3,T4,TResult,T1].Invoke (T2 u, T3 v, T4 w) <0x1108c5030 + 0x0003d> in <filename unknown>:0 
  at Microsoft.FSharp.Core.OptimizedClosures+Invoke@3266-1[T2,T3,TResult,T1].Invoke (T2 u, T3 v) <0x10f502eb0 + 0x00033> in <filename unknown>:0 
  at Microsoft.FSharp.Core.OptimizedClosures+Invoke@3253[T2,TResult,T1].Invoke (T2 u) <0x10abe58a0 + 0x00029> in <filename unknown>:0 
  at [email protected] (System.String arg40) <0x1108c5000 + 0x00021> in <filename unknown>:0 
  at Microsoft.FSharp.Core.FSharpFunc`2[T,TResult].InvokeFast[V] (Microsoft.FSharp.Core.FSharpFunc`2 func, Microsoft.FSharp.Core.T arg1, Microsoft.FSharp.Core.TResult arg2) <0x10f3d6b80 + 0x000ad> in <filename unknown>:0 
  at Microsoft.FSharp.Core.FSharpFunc`2[T,TResult].InvokeFast[V,W] (Microsoft.FSharp.Core.FSharpFunc`2 func, Microsoft.FSharp.Core.T arg1, Microsoft.FSharp.Core.TResult arg2, Microsoft.FSharp.Core.V arg3) <0x1108c4d40 + 0x0016f> in <filename unknown>:0 
  at Microsoft.FSharp.Core.FSharpFunc`2[T,TResult].InvokeFast[V,W,X] (Microsoft.FSharp.Core.FSharpFunc`2 func, Microsoft.FSharp.Core.T arg1, Microsoft.FSharp.Core.TResult arg2, Microsoft.FSharp.Core.V arg3, Microsoft.FSharp.Core.W arg4) <0x1108c48f0 + 0x0023b> in <filename unknown>:0 
  at [email protected] (System.Exception _arg1) <0x1108c3e10 + 0x00274> in <filename unknown>:0 
  at Microsoft.FSharp.Control.AsyncBuilderImpl+tryWithExnA@893[a].Invoke (System.Runtime.ExceptionServices.ExceptionDispatchInfo edi) <0x1108c3c40 + 0x0003b> in <filename unknown>:0 
  at Microsoft.FSharp.Control.AsyncBuilderImpl+callA@851[b,a].Invoke (Microsoft.FSharp.Control.AsyncParams`1 args) <0x10f5b77b0 + 0x0015f> in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () in <filename unknown>:line 0
   at Microsoft.FSharp.Control.AsyncBuilderImpl.commit[a] (Microsoft.FSharp.Control.Result`1 res) in <filename unknown>:line 0
   at Microsoft.FSharp.Control.CancellationTokenOps.RunSynchronously[a] (CancellationToken token, Microsoft.FSharp.Control.FSharpAsync`1 computation, Microsoft.FSharp.Core.FSharpOption`1 timeout) in <filename unknown>:line 0
   at Microsoft.FSharp.Control.FSharpAsync.RunSynchronously[T] (Microsoft.FSharp.Control.FSharpAsync`1 computation, Microsoft.FSharp.Core.FSharpOption`1 timeout, Microsoft.FSharp.Core.FSharpOption`1 cancellationToken) in <filename unknown>:line 0
   at [email protected] (KeyValuePair`2 kv') in <filename unknown>:line 0
   at Microsoft.FSharp.Collections.IEnumerator+map@111[b,a].DoMoveNext (b& ) in <filename unknown>:line 0
   at Microsoft.FSharp.Collections.IEnumerator+MapEnumerator`1[T].System-Collections-IEnumerator-MoveNext () in <filename unknown>:line 0
   at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.takeOuter@713[T,TResult] (Microsoft.FSharp.Core.CompilerServices.ConcatEnumerator`2 x, Microsoft.FSharp.Core.Unit unitVar0) in <filename unknown>:line 0
   at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.takeInner@706[T,TResult] (Microsoft.FSharp.Core.CompilerServices.ConcatEnumerator`2 x, Microsoft.FSharp.Core.Unit unitVar0) in <filename unknown>:line 0
   at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.takeOuter@713[T,TResult] (Microsoft.FSharp.Core.CompilerServices.ConcatEnumerator`2 x, Microsoft.FSharp.Core.Unit unitVar0) in <filename unknown>:line 0
   at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.takeInner@706[T,TResult] (Microsoft.FSharp.Core.CompilerServices.ConcatEnumerator`2 x, Microsoft.FSharp.Core.Unit unitVar0) in <filename unknown>:line 0
   at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.takeOuter@713[T,TResult] (Microsoft.FSharp.Core.CompilerServices.ConcatEnumerator`2 x, Microsoft.FSharp.Core.Unit unitVar0) in <filename unknown>:line 0
   at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.takeInner@706[T,TResult] (Microsoft.FSharp.Core.CompilerServices.ConcatEnumerator`2 x, Microsoft.FSharp.Core.Unit unitVar0) in <filename unknown>:line 0
   at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers+ConcatEnumerator`2[T,TResult].System-Collections-IEnumerator-MoveNext () in <filename unknown>:line 0
   at System.Collections.Generic.List`1[T]..ctor (IEnumerable`1 collection) in <filename unknown>:line 0
   at Microsoft.FSharp.Collections.SeqModule.ToArray[T] (IEnumerable`1 source) in <filename unknown>:line 0
   at Paket.InstallProcess.CreateModel (System.String root, Boolean force, Paket.DependenciesFile dependenciesFile, Paket.LockFile lockFile, Microsoft.FSharp.Collections.FSharpSet`1 packages) in <filename unknown>:line 0
   at Paket.InstallProcess.InstallIntoProjects (Paket.InstallerOptions options, Boolean forceTouch, Paket.DependenciesFile dependenciesFile, Paket.LockFile lockFile, Microsoft.FSharp.Collections.FSharpList`1 projectsAndReferences) in <filename unknown>:line 0
   at Paket.UpdateProcess.SmartInstall (Paket.DependenciesFile dependenciesFile, Paket.UpdateMode updateMode, Paket.UpdaterOptions options) in <filename unknown>:line 0
   at <StartupCode$Paket-Core>[email protected] (Microsoft.FSharp.Core.Unit unitVar0) in <filename unknown>:line 0
   at Paket.Utils.RunInLockedAccessMode[a] (System.String rootFolder, Microsoft.FSharp.Core.FSharpFunc`2 action) in <filename unknown>:line 0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions