Home: NuGet.exe push does not pass the API key from nuget.config to the symbol server

Created on 4 Sep 2016  路  4Comments  路  Source: NuGet/Home

NuGet.exe push does not pass the API key from nuget.config to the symbol server. There are several problems here and it leads to a very poor user experience for what I consider to be the basic push happy path.

Steps

  1. Use nuget.exe 3.5.0.1737
  2. Create a nupkg and symbol package, have them both in the same directory
  3. nuget.exe setapikey <key> -source https://api.nuget.org/v3/index.json
  4. API key is now in the user wide nuget.config file
  5. nuget.exe push <nupkg> -source https://api.nuget.org/v3/index.json

    Expected

The nupkg should be pushed to nuget.org and the symbol package should be pushed to the server.

Actual

The nupkg is pushed but the symbol package fails.
NuGet.exe then starts prompting for credentials which is not going to help here.

Output

.\nuget.exe push .\NupkgWrench.1.0.2.nupkg -source https://api.nuget.org/v3/index.json
Pushing NupkgWrench.1.0.2.nupkg to 'https://www.nuget.org/api/v2/package'...
  PUT https://www.nuget.org/api/v2/package/
  Created https://www.nuget.org/api/v2/package/ 7122ms
Your package was pushed.
WARNING: Found symbols package 'NupkgWrench.1.0.2.symbols.nupkg', but no API key was specified for the symbol server. To save an API Key, run 'NuGet.exe setApiKey [your API key from http://www.NuGet.org]'.
WARNING: No API Key was provided and no API Key could be found for the symbol server (https://nuget.smbsrc.net/). To save an API Key for a source use the 'setApiKey' command.
Pushing NupkgWrench.1.0.2.symbols.nupkg to the symbol server (https://nuget.smbsrc.net/)...
  PUT https://nuget.smbsrc.net/api/v2/package/
Please provide credentials for: https://api.nuget.org/v3/index.json
UserName:
Password:
Please provide credentials for: https://api.nuget.org/v3/index.json
UserName:
Password:

Problems in the above output

  1. Either the API key should be used for the symbol source, or pushing to the default symbol source should be skipped
  2. The same warning is displayed twice in two different ways which doesn't make sense
  3. Prompting here is incorrect, the API key is wrong, sending different basic auth credentials will not help.
  4. The instructions in the first warning are what I've already done, it's unclear how to fix this problem.
  5. What does Created https://www.nuget.org/api/v2/package/ mean?
2 Bug

All 4 comments

@emgarten - Curious if it is a regression from 3.4.4?

  1. What does Created https://www.nuget.org/api/v2/package/ mean?

If you'd print it as CREATED https://www.nuget.org/api/v2/package/, it may be more clear :) I think CREATED refers to the HTTP 201 status code returned by the server as a result of the PUT operation.

Solved by having multiple API keys.

Same issue, very bad design.

I'm following these steps to do: https://help.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-dotnet-cli-for-use-with-github-packages

But I failure.

image

I had add the API key inside nuget.config but why you can't find it and said API key not provided ????????????????????????????????????????

image

Was this page helpful?
0 / 5 - 0 ratings