0

I have migrated nuget repository from Win 2008 to Win 2016. Alias to that server: http://xyz.mycompany.com/NugetFeed

Apart of windows, IIS is different as well, on the new server it is IIS 10.

After migration, nuget works pretty well, except one function. I can browse packages via web (http://xyz.mycompany.com/NugetFeed) or via Visual Studio etc. Visual Studio can see packages created manually.

The only problem is with the nuget push.

>nuget push FEDivaNET.dll*.nupkg -Source http://xyz.mycompany.com/NugetFeed/ D568CD48-1609-40C9-9A5D-7ADC808129E5 Pushing FEDivaNET.dll.3.41.73.nupkg to 'http://xyz.mycompany.com/NugetFeed/'... PUT http://xyz.mycompany.com/NugetFeed/ NotFound http://xyz.mycompany.com/NugetFeed/ 128ms Response status code does not indicate success: 404 (Not Found). System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found). at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() at NuGet.Protocol.Core.Types.PackageUpdateResource.<>c.<PushPackageToServer>b__23_0(HttpResponseMessage response) at NuGet.Protocol.HttpSource.<ProcessResponseAsync>d__181.MoveNext()

  • It is not a problem with the URL. When you try to modify URL then you will get different error
  • It is not a problem with permissions to D:\MyServer\NugetPackages on server, as I have set full permissions to that folder. I have also moved packages folder to different locations (ie. some other external network drive), but I am having same issue.

I tried compiling 2 different Nuget.Server versions: 2.14.0 and 3.1.2 ...Same exception.

Inside IIS, I am pretty sure I have set same settings as on the old server. Also I have INTEGRATED pipeline mode, so everything is good. I also tried setting authentication via technical users etc.

Not sure where is the issue, I think I checked every single setting. I tried with APIKEY, and without APIKEY. I modified every single setting in the Web.config, no luck…..

Jack
  • 350
  • 2
  • 15
  • Have you try this: https://stackoverflow.com/questions/30539179/nuget-server-returns-404-error/41680587#41680587 – Troopers Jan 10 '19 at 14:54
  • Thanks, unfortunately that is not an issue. I tried playing with the setting, and also uploading small files... Same exception... – Jack Jan 11 '19 at 10:35
  • [Here](https://github.com/NuGet/NuGetGallery/issues/5350) an issue related to the error : you can try copy of binaries from bin folder to publish folder – Troopers Jan 11 '19 at 14:30
  • It does not work. – Jack Jan 11 '19 at 15:21

2 Answers2

0

The url on which push the nuget packet is something like

http://{server}/{feed}/api/v2/package

So in your command use:

nuget push FEDivaNET.dll*.nupkg -Source http://xyz.mycompany.com/NugetFeed/api/v2/package

Documentation : Publish a package

Troopers
  • 5,127
  • 1
  • 37
  • 64
  • Unfortunately it does not work, I get same exception. I also think that both suffix "/api/v2/package" is optional, on my old server it works with and without suffix. – Jack Jan 10 '19 at 14:35
0

When you create website in IIS 10, then by default PUT verb is not allowed.

This can be set here:

IIS -> YOUR WebSite -> Request Filtering -> HTTP Verb tab: **Set PUT verb**

This has fixed an issue.

Jack
  • 350
  • 2
  • 15