Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DefaultPushSource is not being honored anymore. #2288

Closed
kingerja opened this issue Mar 10, 2016 · 13 comments
Closed

DefaultPushSource is not being honored anymore. #2288

kingerja opened this issue Mar 10, 2016 · 13 comments

Comments

@kingerja
Copy link

In my nuget.config I have.
<add key="DefaultPushSource" value="https://msdata.pkgs.visualstudio.com/DefaultCollection/_packaging/SQLIS_ISS/nuget/v3/index.json" />

On NuGet Version: 3.4.0.738 (http://www.myget.org/F/nugetbuild/api/v2/package/NuGet.CommandLine/3.4.0-rtm-738). This is from the nugetbuild MyGet feed.
Command:
nuget push "d:\tfs\IS Shared\Engineering Systems5\Main\bin\x86\Debug\Product\Microsoft.CBT.QuickBuild\Microsoft.CBT.QuickBuild.1.0.9.nupkg" -apikey vsts
Result:
Source parameter was not specified.

If I specify a source path it works. However 3.3 and below defaults to the DefaultPushSource listed in the nuget.config if there is no source specified.

If I accidentally filed this as a dupe issue then I apologize I thought I had already filed it but I couldn't find it when searching for it for status so I assume user error on my part.

@yishaigalatzer
Copy link

@spadapet please prioritize this to the top of your list, this is a regression we want to try and get into the command line.

@yishaigalatzer
Copy link

from @emgarten -

I think it's because we removed nuget.org as the default push source, we apparently don't read that default push source setting anymore.

The removal of nuget.org as a default push source was done by design (so we stop people from accidentally pushing to nuget.org) CC @csharpfritz - please add to release notes.

@FransBouma
Copy link

The console app nuget.exe still gives the wrong using text:
NuGet Version: 3.4.3.855

*****>nuget push
push: invalid arguments.
usage: NuGet push <package path> [API key] [options]

Pushes a package to the server and publishes it.
NuGet's default configuration is obtained by loading %AppData%\NuGet\NuGet.config, then loading any nuget.config or .nug
et\nuget.config starting from root of drive and ending in current directory.

     Specify the path to the package and your API key to push the package to the server.

options:

 -Source                (src)  Specifies the server URL. If not specified, nuget.org is used unless DefaultPushSource c
                               onfig value is set in the NuGet config file.

@rgl
Copy link

rgl commented May 5, 2016

This is also failing for me in 3.4.3.855. In what version did/will this fix shipped on?

@spadapet
Copy link

spadapet commented May 5, 2016

Looks like that change is actually getting into 3.4.4 through this issue: #2653

@FransBouma
Copy link

What's strange is that it worked fine last week and to my knowledge I didn't update nuget.exe after that nor did I update anything within vs.net

@eric-newton
Copy link

Fails for me too. Is there any kind of integration testing for this stuff?

@yishaigalatzer
Copy link

Snarky comments don't really help, there obviously wasn't a test for this before it was fixed. Now there is. You can pick up 3.4.4 and validate if resolves your scenario

@sbohlen
Copy link

sbohlen commented May 29, 2016

FWIW, the loss of 'default source' functioning properly has similarly 'broken' all saved API Keys (previously saved with the nuget.exe setApiKey <APIKey> command-line). Its (apparently?) no longer supported to invoke the setApiKey option without also specifying an explicit -Source <source> option as well.

@FransBouma
Copy link

FransBouma commented Jun 30, 2016

Still borked!

C:\Myprojects\VS.NET Projects\Github\SolutionsDesign\BCLExtensions\src\bin\Release>nuget push SD.Tools.BCLExtensions.1.1
.0-Pre1.nupkg
Checking for updates from https://www.nuget.org/api/v2/.
Currently running NuGet.exe 3.4.4-rtm-1321.
Updating NuGet.exe to 3.4.4-rtm-final.
Update successful.
Source parameter was not specified.

C:\Myprojects\VS.NET Projects\Github\SolutionsDesign\BCLExtensions\src\bin\Release>nuget push SD.Tools.BCLExtensions.1.1
.0-Pre1.nupkg
Source parameter was not specified.

C:\Myprojects\VS.NET Projects\Github\SolutionsDesign\BCLExtensions\src\bin\Release>nuget source
Registered Sources:

  1.  nuget.org [Enabled]
      https://api.nuget.org/v3/index.json
  2.  Microsoft Visual Studio Offline Packages [Enabled]
      C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\

Do I have to restate the API key for every package I have to upload, even though I am the owner of all of them and am the same user?

Doing nuget setApiKey <myApiKey> doesn't fix it, even though it says it will store it for the nuget gallery.

The NuGet.config file contains proper nuget urls, nuget push -help states:

 -Source                (src)  Specifies the server URL. If not specified, nuget.org is used unless DefaultPushSource config value is set in the NuGet config file.

So, it should default to nuget.org, not require a mandatory -Source flag.

If I append -Source nuget.org it requests the ApiKey which is present already.

@FransBouma
Copy link

I'll open a new issue.

@yishaigalatzer
Copy link

Fran's the apikey issue is a separate issue that is fixed for 3.5

@agray
Copy link

agray commented Jul 17, 2016

After reading this issue I resolved this for myself by:

  1. Updating Nuget to 3.4.4-final
  2. Changing my batch file by removing the -SetApiKey line
  3. Changing my batch file to add the following to the end of my nuget push line:
`-Source nuget.org -ApiKey <myapikey>`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants