Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nupkg used by another process (or more likely ourself) #3418

Closed
matthid opened this issue Nov 11, 2018 · 2 comments · Fixed by #3554
Closed

nupkg used by another process (or more likely ourself) #3418

matthid opened this issue Nov 11, 2018 · 2 comments · Fixed by #3554

Comments

@matthid
Copy link
Member

matthid commented Nov 11, 2018

Description

I see something strange in some builds:

2018-11-11T08:56:01.4057152Z -> Could not download Fake.Core.Target 5.9.3 from https://api.nuget.org/v3-flatcontainer/fake.core.target/5.9.3/fake.core.target.5.9.3.nupkg.
2018-11-11T08:56:01.4057387Z    StackTrace:
2018-11-11T08:56:01.4057583Z         at Paket.NuGet.download@852-54.Invoke(Exception _arg12)
2018-11-11T08:56:01.4057805Z         at <StartupCode$FSharp-Core>.$Async.TryWith@1113-1.Invoke(Exception exn)
2018-11-11T08:56:01.4058018Z         at Microsoft.FSharp.Control.AsyncPrimitives.CallFilterThenInvoke[T](AsyncActivation`1 ctxt, FSharpFunc`2 catchFilter, ExceptionDispatchInfo edi)
2018-11-11T08:56:01.4058261Z         at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction)
2018-11-11T08:56:01.4058461Z      --- End of stack trace from previous location where exception was thrown ---
2018-11-11T08:56:01.4058696Z         at Microsoft.FSharp.Control.AsyncResult`1.Commit()
2018-11-11T08:56:01.4058992Z         at Microsoft.FSharp.Control.AsyncPrimitives.RunSynchronouslyInCurrentThread[a](CancellationToken cancellationToken, FSharpAsync`1 computation)
2018-11-11T08:56:01.4059237Z         at Microsoft.FSharp.Control.AsyncPrimitives.RunSynchronously[T](CancellationToken cancellationToken, FSharpAsync`1 computation, FSharpOption`1 timeout)
2018-11-11T08:56:01.4059463Z         at Microsoft.FSharp.Control.FSharpAsync.RunSynchronously[T](FSharpAsync`1 computation, FSharpOption`1 timeout, FSharpOption`1 cancellationToken)
2018-11-11T08:56:01.4059726Z         at Paket.RestoreProcess.Restore@693-8.Invoke(Unit unitVar0)
2018-11-11T08:56:01.4060381Z         at Paket.Utils.RunInLockedAccessMode[a](String lockedFolder, FSharpFunc`2 action)
2018-11-11T08:56:01.4060722Z         at Paket.RestoreProcess.Restore$cont@595(FSharpOption`1 targetFrameworks, FSharpList`1 referencesFileNames, FSharpOption`1 projectFile, Boolean ignoreChecks, FSharpOption`1 group, Boolean force, Boolean failOnChecks, String dependenciesFileName, FileInfo lockFileName, String root, Boolean isFullRestore, Lazy`1 lockFile, Lazy`1 localFile, Boolean hasLocalFile, Unit unitVar)
2018-11-11T08:56:01.4061064Z         at Paket.RestoreProcess.Restore(String dependenciesFileName, FSharpOption`1 projectFile, Boolean force, FSharpOption`1 group, FSharpList`1 referencesFileNames, Boolean ignoreChecks, Boolean failOnChecks, FSharpOption`1 targetFrameworks)
2018-11-11T08:56:01.4061356Z         at Fake.Runtime.FakeRuntime.paketCachingProvider(FakeConfig config, String cacheDir, Dependencies paketApi, Lazy`1 paketDependenciesFile, FSharpOption`1 group) in D:\a\1\s\src\app\Fake.Runtime\FakeRuntime.fs:line 298
2018-11-11T08:56:01.4062440Z         at Fake.Runtime.FakeRuntime.prepareFakeScript(FakeConfig config) in D:\a\1\s\src\app\Fake.Runtime\FakeRuntime.fs:line 449
2018-11-11T08:56:01.4062723Z         at Program.runOrBuild(RunArguments args) in D:\a\1\s\src\app\Fake.netcore\Program.fs:line 155
2018-11-11T08:56:01.4063656Z -> IOException: The process cannot access the file 'C:\Users\VssAdministrator\.nuget\packages\fake.core.target\5.9.3\fake.core.target.5.9.3.nupkg' because it is being used by another process.
2018-11-11T08:56:01.4064050Z    StackTrace:
2018-11-11T08:56:01.4064252Z         at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)
2018-11-11T08:56:01.4064454Z         at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)
2018-11-11T08:56:01.4064687Z         at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
2018-11-11T08:56:01.4064912Z         at Paket.NuGet.download@897-24.Invoke(Stream _arg5)
2018-11-11T08:56:01.4065333Z         at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[a,b](AsyncActivation`1 ctxt, FSharpFunc`2 userCode, b result1)
2018-11-11T08:56:01.4065539Z         at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction). Actual value was false but had expected it to be true.

Maybe this happens when multiple things are running, but isn't that why we have Paket.Utils.RunInLockedAccessMode in the call stack, so maybe this is similar to #2461

Expected behavior

No Error

Actual behavior

Error

Known workarounds

No idea.

@matthid
Copy link
Member Author

matthid commented Jan 12, 2019

matthid added a commit that referenced this issue Apr 14, 2019
…ET_STREAMREADWRITE_TIMEOUT basically obsolete

Write into a temporary file and move it at the end, should fix #3418
@matthid
Copy link
Member Author

matthid commented Apr 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant