emgarten / Sleet

A static nuget feed generator for Azure Storage, AWS S3, and more.
MIT License
362 stars 43 forks source link

Recreate is not working on IIS-hosted local feed #176

Closed Balkoth closed 10 months ago

Balkoth commented 1 year ago

Description

I guess my scenario is not too complicated. I got the NuGet feed hosted in an IIS by following the documentation. Everything works, i can push to the feed and retrieve packages in Visual Studio with the NuGet package manager. Now i want to setup a symbol server too, like described here. In order to use this with my existing feed, the docs mention the recreate command. But the recreate command does not work. It fails with the below output.

Versions

Sleet
5.1.3
.NET SDK:
 Version:   7.0.306
 Commit:    f500069cb7
Runtime environment:
 OS Name:     Windows
 OS Version:  10.0.17763
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\7.0.306\
Host:
  Version:      7.0.13
  Architecture: x64
  Commit:       3f73a2f186

sleet.json

{
  "username": "",
  "useremail": "",
  "sources": [
    {
      "name": "MyFeed",
      "type": "local",
      "path": "C:\\inetpub\\wwwroot\\nuget",
      "baseURI": "https://host.server.de/nuget/"
    }
  ]
}

Validate output before recreate

C:\inetpub\wwwroot\nuget>sleet validate --config "C:\Data\sleet.json" --source MyFeed --verbose
Reading feed https://host.server.de/nuget/
GET C:\inetpub\wwwroot\nuget\index.json
GET C:\inetpub\wwwroot\nuget\sleet.settings.json
GET C:\inetpub\wwwroot\nuget\sleet.packageindex.json
Validating AutoComplete
GET C:\inetpub\wwwroot\nuget\autocomplete\query
Autocomplete packages valid
Validating Registrations
GET C:\inetpub\wwwroot\nuget\registration\blub\index.json
GET C:\inetpub\wwwroot\nuget\registration\blob\index.json
GET C:\inetpub\wwwroot\nuget\registration\blib\index.json
Missing packages: 0
Extra packages: 0
Registrations packages valid
Validating FlatContainer
GET C:\inetpub\wwwroot\nuget\flatcontainer\blub\index.json
GET C:\inetpub\wwwroot\nuget\flatcontainer\blob\index.json
GET C:\inetpub\wwwroot\nuget\flatcontainer\blib\index.json
Missing packages: 0
Extra packages: 0
FlatContainer packages valid
Validating Search
GET C:\inetpub\wwwroot\nuget\search\query
Missing packages: 0
Extra packages: 0
Search packages valid
Feed valid

Actual recreate

C:\inetpub\wwwroot\nuget>sleet recreate --config "C:\Data\sleet.json" --source MyFeed
Reading feed https://host.server.de/nuget/
Reading feed https://host.server.de/nuget/
Downloading nupkgs to C:\Users\myuser\AppData\Local\Temp\c48dab2c-816a-4bbf-b659-5998b8744f85
Downloading C:\Users\myuser\AppData\Local\Temp\c48dab2c-816a-4bbf-b659-5998b8744f85\blub\blub.1.0.0.nupkg
Downloading C:\Users\myuser\AppData\Local\Temp\c48dab2c-816a-4bbf-b659-5998b8744f85\blub\blub.1.0.1.nupkg
Downloading C:\Users\myuser\AppData\Local\Temp\c48dab2c-816a-4bbf-b659-5998b8744f85\blob\blob.1.0.0.nupkg
Downloading C:\Users\myuser\AppData\Local\Temp\c48dab2c-816a-4bbf-b659-5998b8744f85\blob\blob.1.0.1.nupkg
Downloading C:\Users\myuser\AppData\Local\Temp\c48dab2c-816a-4bbf-b659-5998b8744f85\blib\blib.1.1.0.nupkg
Downloading C:\Users\myuser\AppData\Local\Temp\c48dab2c-816a-4bbf-b659-5998b8744f85\blib\blib.1.1.4.nupkg
Successfully downloaded packages.
Reading feed https://host.server.de/nuget/
Destroying feed https://host.server.de/nuget/
Successfully deleted all files from https://host.server.de/nuget/
Initializing https://host.server.de/nuget/
Successfully initialized https://host.server.de/nuget/
Reading feed
Skip existing package: Blub 1.0.0
Skip existing package: Blub 1.0.1
Skip existing package: Blob 1.0.0
Skip existing package: Blob 1.0.1
Skip existing package: Blib 1.1.0
Skip existing package: Blib 1.1.4
Processing feed changes
Committing changes to https://host.server.de/nuget/
Successfully pushed packages.
Validating AutoComplete
Autocomplete packages valid
Validating Registrations
Missing packages: 6
  Blub 1.0.0
  Blub 1.0.1
  Blob 1.0.0
  Blob 1.0.1
  Blib 1.1.0
  Blib 1.1.4
Extra packages: 0
Validating FlatContainer
Missing packages: 6
  Blub 1.0.0
  Blub 1.0.1
  Blob 1.0.0
  Blob 1.0.1
  Blib 1.1.0
  Blib 1.1.4
Extra packages: 0
Validating Search
Missing packages: 6
  Blub 1.0.0
  Blub 1.0.1
  Blob 1.0.0
  Blob 1.0.1
  Blib 1.1.0
  Blib 1.1.4
Extra packages: 0
Feed invalid!
Something went wrong when recreating the feed. Feed validation has failed.
Encountered an error while recreating the feed. You may need to manually create the feed and push the nupkgs again. Nupkgs have been saved to: C:\Users\myuser\AppData\Local\Temp\c48dab2c-816a-4bbf-b659-5998b8744f85
emgarten commented 1 year ago

Did any packages show up in the new feed? I see it mention that it skipped existing ones.

You should be able to push the packages from C:\Users\myuser\AppData\Local\Temp\c48dab2c-816a-4bbf-b659-5998b8744f85 to the feed to ensure everything gets added back.

Balkoth commented 1 year ago

No the packages did not show up, nothing was uploaded, because some index was not managed correctly. As the log above says, it skips the packages, and then validation fails.

emgarten commented 10 months ago

Sounds like something was corrupted on the feed. Let me know if you get a consistent repro.