A paket restore cannot extract / copy certain files to the packages folder
Please provide the steps required to reproduce the problem
Have paket.dependencies file from here: [email protected]:Flohack74/paket-issuetracking.git
Do a paket restore with latest version 5.239, or one version below 5.238.2
All packages are downloaded and installed
paket restore breaks with
==> Last trial
Downloading Microsoft.Extensions.DependencyInjection 3.1
Not moving as 'C:\Users\flole\.nuget\packages\microsoft.extensions.dependencyinjection\3.1.0\microsoft.extensions.dependencyinjection.3.1.0.nupkg' already exists (maybe some other instance downloaded it as well)
Download of Microsoft.Extensions.DependencyInjection 3.1 done in 28 milliseconds. (50758 kbit/s, 0 MB)
Performance:
- Disk IO: 23 seconds
- Average Download Time: 180 milliseconds
- Number of downloads: 216
- Average Request Time: 177 milliseconds
- Number of Requests: 234
- Runtime: 56 seconds
Paket omitted 4 warnings similar to the ones above. You can see them in verbose mode.
Paket failed with
-> Error during extraction of C:\USERDATA\DEVEL\packages\Microsoft.Extensions.DependencyInjection\microsoft.extensions.dependencyinjection.3.1.0.nupkg.
In rare cases a firewall might have blocked the download. Please look into the file and see if it contains text with further information.
-> IOException: The file 'C:\USERDATA\DEVEL\packages\Microsoft.Extensions.DependencyInjection\packageIcon.png' already exists.
It breaks on either Microsoft.Extensions.DependencyInjection or Microsoft.Extensions.DependencyInjection.Abstractions...
Also, paket restore --force breaks on various packages with
Paket failed with
-> Error during cleaning of C:\USERDATA\DEVEL\packages\Microsoft.AspNet.WebApi.Client
- Access to the path 'C:\USERDATA\DEVEL\packages\Microsoft.AspNet.WebApi.Client\lib\net45' is denied.
-> UnauthorizedAccessException: Access to the path 'C:\USERDATA\DEVEL\packages\Microsoft.AspNet.WebApi.Client\lib\net45' is denied.
But this is a random race condition. Every time this appears its a different package.
None
what's the last version that works?
It seems this is a broken package on NuGet - this worked until Monday with 5.239. Then they released 3.1.0, and this breaks now. I will investigate with MS, but you might want to check if this is intended behaviour for paket, or an issue you can deal with. I did not look into the contents of Microsoft.Extensions.DependencyInjection so far.
yeah we saw this error in the CI as well. I thought it's only a problem with paket 6 alpha but seems it's all versions. /cc @BlythMeister
in CI it's failing on Microsoft.Extensions.Configuration
I now pinned to nuget Microsoft.Extensions.DependencyInjection 3.0.1 and that solves it for the moment. Also used contact form on NuGet to inform the maintainer but I am not sure how fast they will respond.
-> IOException: Die Datei "D:tempdownloadhackpaket-issuetrackingpackagesMicrosoft.Extensions.DependencyInjection.AbstractionspackageIcon.png" already exists.
ouch. the zip is corrupt!?
we do System.IO.Compression.ZipFile.ExtractToDirectory(fileName, targetFolder) on that package.
Yeah thats what we think here as well:

Which compression lib on earth allows that!!!!
Confirmed, I've seen this today as well.

Package borked good and proper....
there are multiple packages borked. Something must be wrong with how they got packaged. I assume a bug in nuget pack command.
Anyway, good news: if we fallback to extracting manually in a loop then we can work around it. paket 5.240.0 should be up in couple of minutes
Very nice Sir, thanks!
ok please test 5.240.0. thanks
Yes that fixes the issue. Many thanks!
it still remains a mystery how those packages made it to the server but I let this one for the nuget team.
@BlythMeister please rebase your PR and hopefully that one will now be green as well.
Should we create an issue over at nuget and link back? Has someone reported this?
@matthid I just used the feedback form to send them a note, but I doubt this will be processed soon. Do you have other options for bug reports?
Either on the repository the package was build from as github issue or directly in dotnet cli dotnet pack issue or nuget client, I'm pretty sure they will move it around between microsoft teams anyway.
I opened an issue, lets see ;)
@Flohack74 Thanks!
I've had this today too, and can reproduce with a brand new directory and paket.dependencies file...
source https://api.nuget.org/v3/index.json
nuget Microsoft.Extensions.Configuration.Json 3.1.0
However, removing this from the project I'm working with, I then his the same error on a package this _isn't_ new. Doing a paket install on this paket.dependencies file _also_ fails...
source https://api.nuget.org/v3/index.json
nuget NetMQ 4.0.0.207
So presumably this suggests that it's not just new packages that are problematic?
@dracan please retry with latest Paket
@dracan Note that these packages (especially Extension.Configuration) are very widespread and you might still need one though transitive resolution even tough you don't have them directly in your depsfile
@forki Brilliant! That's fixed it! 馃槃 I had freshly installed Paket today too on another laptop to see if it was an issue with my work PC. But because I did a Chocolately install, it hadn't got your fix in yet. I'm glad Chocolately is slightly behind though, otherwise it would have worked on the other laptop and I'd have blamed my work PC! 馃槃
@matthid Thanks. Yep, most of the codebase won't use this even transitively. There's only one small project in a lot of other projects that use .NET Core / ASP.NET.
Confirming that updating to Paket 5.241.2 fixed this for me
Most helpful comment
ok please test 5.240.0. thanks