Paket: paket.local source+version override - IO error when used multiple times

Created on 30 Aug 2017  路  5Comments  路  Source: fsprojects/Paket

Description

Two projects (old fsproj format, net461). One depends on the other via nuget package. CI will put a different build number, so I use the paket.local source override with specific version to match local.

When restoring the first time after the local override, this works with the following message:

Paket version 5.91.0
paket.local override: nuget ImaginedCloud.Common group Main -> ..\infrastructure\deploy version 0.1.0

The next time restore runs it will error with the following msg:

Paket version 5.91.0
paket.local override: nuget ImaginedCloud.Common group Main -> ..\infrastructure\deploy version 0.1.0
Something went wrong while downloading ImaginedCloud.Common 0.1.0
Message: The file 'C:\Users\johlrich\.nuget\packages\ImaginedCloud.Common\0.1.0\ImaginedCloud.Common.0.1.0.nupkg' already exists.
  ==> Trying again
Something went wrong while downloading ImaginedCloud.Common 0.1.0
Message: The file 'C:\Users\johlrich\.nuget\packages\ImaginedCloud.Common\0.1.0\ImaginedCloud.Common.0.1.0.nupkg' already exists.
  ==> Last trial
Performance:
 - Disk IO: 165 milliseconds
 - Runtime: 1 second
Paket failed with
-> IOException: The file 'C:\Users\johlrich\.nuget\packages\ImaginedCloud.Common\0.1.0\ImaginedCloud.Common.0.1.0.nupkg' already exists.

Repro steps

Use paket to add a nuget package to a project.
Create paket.local file with source override (not sure if version use matters)
Run restore 2x - first should succeed, second should fail.

These specific projects are in a private feed, but it should be an easy repro. If you can't repro let me know and I can throw together a simple repro with a public package.

Expected behavior

Should correctly restore the override without error when ran multiple times.

Actual behavior

Fails with error message in description above.

Known workarounds

Deleting the folder for the overridden version inside of the .nuget\packages\PackageName\ folder, will allow restore to grab the latest package override.

Most helpful comment

Should be fixed with 5.92.1

All 5 comments

This is actually a bit hairy, we probably shouldn't overwrite and use the cache when a paket.local is used...

Ha, this also means paket.local will no longer work with new-style sdk projects /cc @forki

I feel like preventing a corrupt cache is more important here

Should be fixed with 5.92.1

Quick FYI if anyone else had this issue before: First time I ran restore with the newer paket resulted in the same IOException except in my project's local packages folder. After clearing the packages folder and allowing it to restore from empty, I am able to restore multiple times without any manual workarounds.

Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JohnyWS picture JohnyWS  路  7Comments

sarudak picture sarudak  路  5Comments

haraldsteinlechner picture haraldsteinlechner  路  4Comments

0x53A picture 0x53A  路  8Comments

matthid picture matthid  路  6Comments