Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
Getting 403 error when pushing nuget package
-
I'm trying to push a nuget package to ProGet, but keep getting a 403 error.
.\tools\nuget.exe push .\Hum.3.5.4.nupkg -ApiKey b079f1f5-a4d7-4ef9-8af3-0b456779ba88 -Source http://packages.nisportal.com/nuget/nis/
Result in
Pushing Hum.3.5.4.nupkg to 'http://packages.nisportal.com/nuget/nis/'... PUT http://packages.nisportal.com/nuget/nis/ Forbidden http://packages.nisportal.com/nuget/nis/ 38ms Response status code does not indicate success: 403 (Forbidden).
The ApiKey is configured on the feed. I've also tried without ApiKey.
I've tried assigning the anonymous user pushing priviliges.
Product: ProGet
Version: 4.7.13
-
Hello Mathias,
There are three reasons pushing a NuGet package to ProGet can result in a 403 (Forbidden) error:
- An API key is configured but a different API key (or no API key) is included in the request.
- The current user does not have
Feeds_AddPackage
on the NuGet feed. Feeds_AddPackage is required even if an API key is configured. - The package already exists and the current user does not have
Feeds_OverwritePackage
on the current feed.
(See KB#1112)
-
And which user applies when using API key? Anonymous?
-
If you are not using integrated authentication, the anonymous user is associated with a NuGet feed-specific API key.
-
I believe I tried giving anonymous those privileges already but will give it another try. I also tried using the username:password format without luck.
I won't be able to try until tomorrow
-
I'm still getting 403. Here are all the permission settings:
Feed settings with API key:
Anonymous user:
Group settings:
Task settings:
-
Do you have any suggestions?
-
Can I have a reaction to this please?
-
Given this setup, I can't think of a reason why pushing a NuGet package with the API key specified would give a 403 response; it could be an IIS setting like WebDAV that's forbidding a PUSH or PUT of a package.
-
WebDAV is not enabled on the server.
The IIS site is the default created by your installer.
Is there some sort of logging I can look at to try and figure out why the request is rejected?
-
It appears the cause is the NuGet API Key set on the feed.
If i remove it, i can publish using the user:password format.
When using an API Key configured on the feed? Which user's permissions apply?
-
The API key must also be used; check out kb#1112 - API Keys in ProGet
-
Are you sure that's working as you intend?
I did give the anonymous user permission to push packages, as the page you linked suggests.
-
Any updates on this issue? I am getting the same behavior with Version 4.8.9 (Build 2). I wonder if its a bug with the product?
-
I would remove the "NuGet API Key" from your NuGet feed; that is a seperate thing from "ProGet API Keys", which makes it quite confusing. This is why it will be deprecated in v5.
You don't need an API key; you can just publish using usename/[password.