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!

Push Nupkg to ProGet failing with Authentication Error



  • Hi there :)

    I was previously running a TeamCity nuget feed which was unreliable so I am trialling ProGet.

    I have successfully installed a ProGet server on a dedicated server :)

    We use Teamcity to create nupkg packages and I want to integrate the Teamcity NuGet Publish Build Step to upload packages to ProGet. When I perform a NuGet publish from Teamcity, it fails with error

    	[08:45:12]Step 3/3: Publish to ProGet (ABT Prod server) (NuGet Publish)
    	[08:45:12][Step 3/3] push: Publish package Build\packages\SciChart.3.1.0.4680.nupkg
    	[08:45:12][push] NuGet command: C:\BuildAgent\plugins\nuget-agent\bin\JetBrains.TeamCity.NuGetRunner.exe C:\BuildAgent\tools\NuGet.CommandLine.DEFAULT.nupkg\tools\NuGet.exe push C:\BuildAgent\work\fd34bcf86028b09c\Build\packages\SciChart.3.1.0.4680.nupkg %%teamcity_nuget_api_key_1404377112639%% -Source http://anonymised-feed-url'
    	[08:45:12][push] Starting: C:\BuildAgent\temp\agentTmp\custom_script681410212521114575.cmd
    	[08:45:12][push] in directory: C:\BuildAgent\work\fd34bcf86028b09c\Build\packages
    	[08:45:12][push] JetBrains TeamCity NuGet Runner 8.0.27692.9
    	[08:45:12][push] Registered additional extensions from paths: C:\BuildAgent\plugins\nuget-agent\bin\plugins-2.5
    	[08:45:12][push] Starting NuGet.exe 2.8.50506.491 from C:\BuildAgent\tools\NuGet.CommandLine.DEFAULT.nupkg\tools\NuGet.exe
    	[08:45:13][push] Pushing SciChart 3.1.0.4680 to 'http://anonymised-feed-url'...
    	[08:45:13][push] Failed to process request. 'There was an error processing the request: You are not authorized to add a package to this feed. By default, ProGet is not configured to allow unauthenticated users to publish packages to a feed. You will need to either authenticate (by using "name:pass" as your API Key) or give the Anonymous User the Feeds_AddPackage privilege.'. 
    	[08:45:13][push] The remote server returned an error: (403) Forbidden..
    	[08:45:13][push] Process exited with code 1
    	[08:45:13][Step 3/3] Step Publish to ProGet (ABT Prod server) (NuGet Publish) failed
    

    Now I couldn't get the suggested Name:Pass API key method to work either this fails with error too.

    	[08:51:31]Step 3/3: Publish to ProGet (ABT Prod server) (NuGet Publish)
    	[08:51:31][Step 3/3] push: Publish package Build\packages\SciChart.3.1.0.4680.nupkg
    	[08:51:31][push] NuGet command: C:\BuildAgent\plugins\nuget-agent\bin\JetBrains.TeamCity.NuGetRunner.exe C:\BuildAgent\tools\NuGet.CommandLine.DEFAULT.nupkg\tools\NuGet.exe push C:\BuildAgent\work\fd34bcf86028b09c\Build\packages\SciChart.3.1.0.4680.nupkg %%teamcity_nuget_api_key_1404377491436%% -Source  http://anonymised-feed-url'
    	[08:51:31][push] Starting: C:\BuildAgent\temp\agentTmp\custom_script2375221507479887116.cmd
    	[08:51:31][push] in directory: C:\BuildAgent\work\fd34bcf86028b09c\Build\packages
    	[08:51:31][push] JetBrains TeamCity NuGet Runner 8.0.27692.9
    	[08:51:31][push] Registered additional extensions from paths: C:\BuildAgent\plugins\nuget-agent\bin\plugins-2.5
    	[08:51:31][push] Starting NuGet.exe 2.8.50506.491 from C:\BuildAgent\tools\NuGet.CommandLine.DEFAULT.nupkg\tools\NuGet.exe
    	[08:51:32][push] Pushing SciChart 3.1.0.4680 to 'http://anonymised-feed-url'...
    	[08:51:32][push] Failed to process request. 'There was an error processing the request: Invalid API key.'. 
    	[08:51:32][push] The remote server returned an error: (403) Forbidden..
    	[08:51:32][push] Process exited with code 1
    	[08:51:32][Step 3/3] Step Publish to ProGet (ABT Prod server) (NuGet Publish) failed
    	[08:51:32]Publishing internal artifacts
    

    So, eventually I had to allow the anonymous user to have the Feeds_AddPackage privilege, which as you can imagine, is not idea.

    Can you tell me how to enable NuGet publish from Teamcity to ProGet using authentication?

    Product: ProGet
    Version: 3.1.0



  • A few troubleshooting questions:

    • Do you have an API key specified for the feed? This would mean Admin:Admin doesn't work
    • Did you change the default Admin password?
    • Can you push if you manually run the nuget.exe command line?

    Beyond that, not sure how this could happen. Is TeamCity mangling the Admin:Admin key somehow (e.g. replacing : with something?) You could verify this with a Fiddler trace.

    Also, what is the actual command line value that TeamCity is running? It looks like the task is running:

    NuGet.exe push C:\...\SciChart.3.1.0.4680.nupkg %%teamcity_nuget_api_key_1404377491436%% -Source  http://feed-url
    

    which does not have the -ApiKey argument at first glance.



  • I am also having the same problem as the op. I have Windows Authentication enabled and the output is as follows:

    [15:52:57]Step 6/6: Nuget Publish (NuGet Publish)
    [15:52:57][Step 6/6] push: Publish package build\packages\UniRush.Utilities.Hsm.1.1.11.44.nupkg
    [15:52:57][push] NuGet command: E:\TeamCity\buildAgent2\tools\NuGet.CommandLine.DEFAULT.nupkg\tools\NuGet.exe push E:\TeamCity\buildAgent2\work\7116b8738cad15f3\build\packages\UniRush.Utilities.Hsm.1.1.11.44.nupkg %%teamcity_nuget_api_key_1467143577146%% -Source https://proget.rushcard.net/nuget/legacy.release
    [15:52:57][push] Starting: E:\TeamCity\buildAgent2\temp\agentTmp\custom_script8897161549051085458.cmd
    [15:52:57][push] in directory: E:\TeamCity\buildAgent2\work\7116b8738cad15f3\build\packages
    [15:52:57][push] Pushing UniRush.Utilities.Hsm.1.1.11.44.nupkg to 'https://proget.rushcard.net/nuget/legacy.release'...
    [15:52:57][push]   PUT https://proget.rushcard.net/nuget/legacy.release/
    [15:52:57][push]   Forbidden https://proget.rushcard.net/nuget/legacy.release/ 80ms
    [15:52:57][push] Please provide credentials for: https://proget.rushcard.net/nuget/legacy.release
    [15:52:57][push] Object reference not set to an instance of an object.
    [15:52:57][push] UserName: Password: 
    [15:52:57][push] Process exited with code 1
    [15:52:57][Step 6/6] Step Nuget Publish (NuGet Publish) failed
    

    Any help from one side or the other would be great. I guess I'll start working on a custom nuget / command line solution while I am waiting.

    Thanks



  • I got the same error message, the true reason was shown in Proget Admin ui: "An error occurred processing a PUT request to http://bhmc1787.sirona.org:81/nuget/[....] already exists and the user Anonymous does not have the Feeds_OverwritePackage privilege."



  • Same issue here, tried with Local Users, LDAP and Windows AD, with and without API.

    Did anyone managed to solve this?

    Thanks!



Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation