0

I have my own nuget repository, hosted localy (nuget.server), and Teamcity with package restore build step.

Sometimes, I found errors, like

[12:10:06]Unable to find version '1.2.0-alfa00243' of package 'ReportsBase'.

Seems, that package doesn't exists, but it exists! I have checked Packages folder, and checked logs of IIS, and found very strange behavior. First request - OK, package found, second and third - not found, then found.

2014-12-09 08:08:27 192.168.123.101 GET /nuget/nuget/Packages(Id='ReportsBase',Version='1.2.0-alfa00243') - 80 - 192.168.121.188 NuGet+Command+Line/2.8.50506.491+(Microsoft+Windows+NT+6.1.7601+Service+Pack+1) 200 0 0 185

2014-12-09 08:10:06 192.168.123.101 GET /nuget/nuget/Packages(Id='ReportsBase',Version='1.2.0-alfa00243') - 80 - 192.168.121.104 NuGet+Command+Line/2.8.50506.491+(Microsoft+Windows+NT+6.1.7601+Service+Pack+1) 404 0 0 37870

2014-12-09 08:10:06 192.168.123.101 GET /nuget/nuget/Packages(Id='ReportsBase',Version='1.2.0-alfa00243') - 80 - 192.168.121.188 NuGet+Command+Line/2.8.50506.491+(Microsoft+Windows+NT+6.1.7601+Service+Pack+1) 404 0 0 47184

2014-12-09 08:10:11 192.168.123.101 GET /nuget/nuget/Packages(Id='ReportsBase',Version='1.2.0-alfa00243') - 80 - 192.168.121.104 NuGet+Command+Line/2.8.50506.491+(Microsoft+Windows+NT+6.1.7601+Service+Pack+1) 200 0 0 381

This often happens with just added packages. (few seconds ago)

What could be reason for so strange things?

Vladimir
  • 2,082
  • 1
  • 13
  • 27
  • The failed requests have a different IP address. What do the addresses resolve to? – OakNinja Jan 29 '15 at 20:42
  • Where are the NuGet packages sourced from? Are you creating new packages in your build process (for Octopus deploy for example?) if so then you should create an dependency on your Team City build step to wait for the version to be published to the NuGet repository. – The Senator Jan 29 '15 at 22:36
  • 1
    I have debugged nuget server, and probably found cause. There are about 8k packages in my repo, and after every push of new package cache recreating. Sometimes there are push of 5-10 packages, and cache recreates 5-10 times. It could take significant time, and probably this 404 error happens in case of timeout. So, I have fixed this problem by installing Nuget Gallery, instead of NugetServer and everything works fine. – Vladimir Jan 30 '15 at 06:35

1 Answers1

2

The simple NuGet.Server package was not designed for anything but a handful of packages. It uses an in-memory hashtable, and watches the file system for changes. If you have any other usage beyond trivial, you need to get a real private server. These private repositories also have the benefit of being easier to set-up and maintain.

Inedo's ProGet is by far the most popular choice for on-prem NuGet servers, but both JFrog and Sonatype have options as well.

MyGet is by far the most popular choice for a cloud-hosted NuGet servers, but there may be others.

You could also try to spin-up an instance of NuGet.org, but that was never designed for use as a private package repository... just the public NuGet.org for private packages.

Karl Harnagy
  • 717
  • 5
  • 10