Nuget server sometimes not found package

1k Views Asked by At

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?

1

There are 1 best solutions below

0
On

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.