C
C#2d ago
Core

✅ Unable to publish a package despite having a valid API key

Hello, I created a key with push privileges, but when trying to publish a package I get a Forbidden response. Also, there's a section to select packages, but I have no packages, this would be the first push. I have checked it, and the package ID is unique.
❯ dotnet nuget push packages/*.nupkg --api-key mykey --source https://api.nuget.org/v3/index.json
Pushing UniqueName.1.0.0-preview.1.nupkg to 'https://www.nuget.org/api/v2/package'...
PUT https://www.nuget.org/api/v2/package/
Forbidden https://www.nuget.org/api/v2/package/ 4207ms
error: Response status code does not indicate success: 403 (The specified API key is invalid, has expired, or does not have permission to access the specified package.).
❯ dotnet nuget push packages/*.nupkg --api-key mykey --source https://api.nuget.org/v3/index.json
Pushing UniqueName.1.0.0-preview.1.nupkg to 'https://www.nuget.org/api/v2/package'...
PUT https://www.nuget.org/api/v2/package/
Forbidden https://www.nuget.org/api/v2/package/ 4207ms
error: Response status code does not indicate success: 403 (The specified API key is invalid, has expired, or does not have permission to access the specified package.).
No description
4 Replies
Yawnder
Yawnder2d ago
@Core If I were you, I'd try to upload the first version using the website, then generake an API key targetting that package. Maybe it should work directly, but I would do what I just said as a workaround.
Core
CoreOP2d ago
Okay, I'll try that @Yawnder it worked, thank you
Yawnder
Yawnder2d ago
Great! I probably had to do the same thing the first time around
Core
CoreOP2d ago
Now I have 2 versions which are acutally the same 🥲

Did you find this page helpful?