Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    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

    Scheduled Pinned Locked Moved Support
    teamcityprogetnugetpublishing
    5 Posts 1 Posters 62 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ? This user is from outside of this forum
      Guest
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • ? This user is from outside of this forum
        Guest
        last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • ? This user is from outside of this forum
          Guest
          last edited by

          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

          1 Reply Last reply Reply Quote 0
          • ? This user is from outside of this forum
            Guest
            last edited by

            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."

            1 Reply Last reply Reply Quote 0
            • ? This user is from outside of this forum
              Guest
              last edited by

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

              Did anyone managed to solve this?

              Thanks!

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • 1 / 1
              • First post
                Last post
              Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation