This is weird, but we are able to publish some packages with 1 powershell script to nuget.org, but then when we run 2-nd script, which is almost identical to 1, it didn't work:
The 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.).
The only difference between 1-st and 2-nd script is that first one publishes FM.IceLink.nupkg and the second published FM.LiveSwitch.nupkg
Here is the result
2019-01-12T01:12:24.1849088Z Pushing FM.LiveSwitch.1.2.5.3369.nupkg to 'https://www.nuget.org/api/v2/package'...
2019-01-12T01:12:24.2459897Z PUT https://www.nuget.org/api/v2/package/
2019-01-12T01:12:25.1463603Z Forbidden https://www.nuget.org/api/v2/package/ 900ms
2019-01-12T01:12:25.1947460Z 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.).
2019-01-12T01:12:25.3090556Z D:\a\r1\a\Artifacts\nuget\nuget-build\FM.LiveSwitch.AForge.1.2.5.3369.nupkg
2019-01-12T01:12:25.9463886Z Pushing FM.LiveSwitch.AForge.1.2.5.3369.nupkg to 'https://www.nuget.org/api/v2/package'...
2019-01-12T01:12:26.0009673Z PUT https://www.nuget.org/api/v2/package/
2019-01-12T01:12:26.2723840Z Forbidden https://www.nuget.org/api/v2/package/ 271ms
2019-01-12T01:12:26.2845901Z 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.).
2019-01-12T01:12:26.3061928Z D:\a\r1\a\Artifacts\nuget\nuget-build\FM.LiveSwitch.Android.1.2.5.3369.nupkg
2019-01-12T01:12:26.9551033Z Pushing FM.LiveSwitch.Android.1.2.5.3369.nupkg to 'https://www.nuget.org/api/v2/package'...
2019-01-12T01:12:27.0133061Z PUT https://www.nuget.org/api/v2/package/
2019-01-12T01:12:27.2947542Z Forbidden https://www.nuget.org/api/v2/package/ 281ms
2019-01-12T01:12:27.3055049Z 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.).
2019-01-12T01:12:27.3255494Z D:\a\r1\a\Artifacts\nuget\nuget-build\FM.LiveSwitch.AudioProcessing.1.2.5.3369.nupkg
2019-01-12T01:12:27.9705255Z Pushing FM.LiveSwitch.AudioProcessing.1.2.5.3369.nupkg to 'https://www.nuget.org/api/v2/package'...
2019-01-12T01:12:28.0213622Z PUT https://www.nuget.org/api/v2/package/
2019-01-12T01:12:28.2441340Z Forbidden https://www.nuget.org/api/v2/package/ 222ms
2019-01-12T01:12:28.2550810Z 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.).
2019-01-12T01:12:28.2747274Z D:\a\r1\a\Artifacts\nuget\nuget-build\FM.LiveSwitch.Cocoa.1.2.5.3369.nupkg
2019-01-12T01:12:28.9113415Z Pushing FM.LiveSwitch.Cocoa.1.2.5.3369.nupkg to 'https://www.nuget.org/api/v2/package'...
Your API key might be specific to glob pattern FM.IceLink*
which is why it worked first time but failed second time with FM.LiveSwitch*
. Check in your nuget.org account profile for that corresponding API key to confirm this. If that's the case then you either need to update the existing key or generates a new one with appropriate glob pattern.
I have the same error and Api key is configured with *
glob pattern
C:\Users\xxx\Source\Repos\ConsoleApp11\ConsoleApp2\bin\Release>"c:\users\xxx\appdata\local\microsoft\visualstudio\16.0_f557710cexp\extensions\lautas nicolae\vsixtesttehnolog\1.0\NuGet\nuget.exe" push "C:\Users\xxx\Source\Repos\ConsoleApp11\ConsoleApp2\bin\Release\ConsoleApp2.1.0.1.nupkg" -Source https://api.nuget.org/
Pushing ConsoleApp2.1.0.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/ 980ms
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.).
Key is Valid was generate 2 minutes before the push command from console with admin right. Alto I set the key with nuget.exe setApiKey and the same error
Your API key might be specific to glob pattern
FM.IceLink*
which is why it worked first time but failed second time withFM.LiveSwitch*
. Check in your nuget.org account profile for that corresponding API key to confirm this. If that's the case then you either need to update the existing key or generates a new one with appropriate glob pattern.
Thank very much for this answer!!!!!!!! U saved my night! <3
In my case it seemed that I had to re-generate the API key, _after_ changing the glob pattern.
Changing it before did not help.
Most helpful comment
I have the same error and Api key is configured with
*
glob pattern