NuGet private server returns 502 (Bad Gateway) when pushing new package

3.4k Views Asked by At

I deployed new private NuGet server (NuGet.Server.3.4.1) and set up API key in web.config.

Then I created first nuget package from my .net core class library project.

But when I try to run following command

dotnet nuget push packageName.1.0.0.nupkg --api-key myKey --source https://privateNugetServer.com/nuget

I get an error from the server

error: Response status code does not indicate success: 502 (Bad Gateway).

I tried workaround when I uploaded package manually with Nuget server itself, but than I still got this error when I add additional Package source to visual studio nuget manager pointing to my server.

error: Response status code does not indicate success: 502 (Bad Gateway).

What might be an issue ?

1

There are 1 best solutions below

0
On

For Artifactory users: An error code of 502 (bad gateway) for a nuget push can have different reasons. According to this issue it can be related to permissions.

Another reason can be this: I was able to deploy a NuGet package via Artifactory Web UI, but a nuget push did not work. I did provide credentials when I added the repo with nuget sources Add, but I did not set an API key with nuget setapikey. After also setting the API key, I was able to upload a package with nuget push.