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 in NuGetDefaults.config (ProgramData\NuGet) doesn't work #2653

Closed
fubar-coder opened this Issue Apr 25, 2016 · 15 comments

Comments

Projects
None yet
8 participants
@fubar-coder

fubar-coder commented Apr 25, 2016

I always get the error message Source parameter was not specified even though my NuGetDefaults.config (stored in C:\ProgramData\NuGet) looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <config>
        <add key="DefaultPushSource" value="https://api.nuget.org/v3/index.json" />
    </config>
</configuration>

According to the documentation, this should work...

EDIT: I'm using NuGet 3.4.3.

@rrelyea rrelyea added this to the 3.4.4 milestone Apr 25, 2016

@rrelyea rrelyea added the Area: Push label Apr 25, 2016

@rrelyea

This comment has been minimized.

Show comment
Hide comment
@rrelyea

rrelyea Apr 25, 2016

Contributor

Putting in 3.4.4 until we know if regression or not.

Contributor

rrelyea commented Apr 25, 2016

Putting in 3.4.4 until we know if regression or not.

@rrelyea rrelyea added the Type:Bug label Apr 25, 2016

zhili1208 added a commit to NuGet/NuGet.Client that referenced this issue Apr 25, 2016

@holytshirt

This comment has been minimized.

Show comment
Hide comment
@holytshirt

holytshirt Apr 26, 2016

This is a regression from 3.3.0

It just doesn't read the %ProgramData%\NuGet\NuGetDefaults.Config

This has just broken all our build servers as we do a update -self before restore

PS D:\TeamCityAgent\work\9ed84505b41a1255\src\.nuget> .\NuGet.exe sources
Registered Sources:

  1.  nuget.org [Enabled]
      https://api.nuget.org/v3/index.json
  2.  nuget.org -cached [Enabled]
      http://blah.blah.local:81/nuget/nuget.org
  3.  Blah Shared Libraries [Enabled]
      http://blah.blah.local:81/nuget/blah
  4.  Microsoft and .NET -cached [Enabled]
      http://blah.blah.local:81/nuget/nuget.org.microsoft
PS D:\TeamCityAgent\work\9ed84505b41a1255\src\.nuget> .\NuGet.exe update -self
Checking for updates from https://www.nuget.org/api/v2/.
Currently running NuGet.exe 3.3.0.
Updating NuGet.exe to 3.4.3.
Update successful.
PS D:\TeamCityAgent\work\9ed84505b41a1255\src\.nuget> .\NuGet.exe sources
Registered Sources:

  1.  nuget.org [Enabled]
      https://api.nuget.org/v3/index.json
PS D:\TeamCityAgent\work\9ed84505b41a1255\src\.nuget>

holytshirt commented Apr 26, 2016

This is a regression from 3.3.0

It just doesn't read the %ProgramData%\NuGet\NuGetDefaults.Config

This has just broken all our build servers as we do a update -self before restore

PS D:\TeamCityAgent\work\9ed84505b41a1255\src\.nuget> .\NuGet.exe sources
Registered Sources:

  1.  nuget.org [Enabled]
      https://api.nuget.org/v3/index.json
  2.  nuget.org -cached [Enabled]
      http://blah.blah.local:81/nuget/nuget.org
  3.  Blah Shared Libraries [Enabled]
      http://blah.blah.local:81/nuget/blah
  4.  Microsoft and .NET -cached [Enabled]
      http://blah.blah.local:81/nuget/nuget.org.microsoft
PS D:\TeamCityAgent\work\9ed84505b41a1255\src\.nuget> .\NuGet.exe update -self
Checking for updates from https://www.nuget.org/api/v2/.
Currently running NuGet.exe 3.3.0.
Updating NuGet.exe to 3.4.3.
Update successful.
PS D:\TeamCityAgent\work\9ed84505b41a1255\src\.nuget> .\NuGet.exe sources
Registered Sources:

  1.  nuget.org [Enabled]
      https://api.nuget.org/v3/index.json
PS D:\TeamCityAgent\work\9ed84505b41a1255\src\.nuget>
@rrelyea

This comment has been minimized.

Show comment
Hide comment
@rrelyea

rrelyea Apr 27, 2016

Contributor

@zhili1208 can you dig into this report from @holytshirt and look at more commands ensuring that progdata is appropriately being loaded. He reports that sources doesn't load it too.
/cc @yishaigalatzer

Contributor

rrelyea commented Apr 27, 2016

@zhili1208 can you dig into this report from @holytshirt and look at more commands ensuring that progdata is appropriately being loaded. He reports that sources doesn't load it too.
/cc @yishaigalatzer

@yishaigalatzer

This comment has been minimized.

Show comment
Hide comment
@yishaigalatzer

yishaigalatzer Apr 27, 2016

I want to understand regressions from 3.3 vs regressions from 2.x in 3.4.4 we will only fix 3.3 and on regressions

yishaigalatzer commented Apr 27, 2016

I want to understand regressions from 3.3 vs regressions from 2.x in 3.4.4 we will only fix 3.3 and on regressions

@holytshirt

This comment has been minimized.

Show comment
Hide comment
@holytshirt

holytshirt Apr 27, 2016

I'm good with that, this is a regression from 3.3. If you need any more information or testing from me, just let me know.

holytshirt commented Apr 27, 2016

I'm good with that, this is a regression from 3.3. If you need any more information or testing from me, just let me know.

@yishaigalatzer

This comment has been minimized.

Show comment
Hide comment
@yishaigalatzer

yishaigalatzer Apr 27, 2016

@HolyShirt, are you referring to sources or defaultpushsource?

yishaigalatzer commented Apr 27, 2016

@HolyShirt, are you referring to sources or defaultpushsource?

@zhili1208

This comment has been minimized.

Show comment
Hide comment
@zhili1208

zhili1208 Apr 28, 2016

Collaborator

@yishaigalatzer I think he is referring to sources, we load sources from nugetDefault.config in 3.3, but doesn't do that in 3.4. This is regression from 3.3, but 3.3 has another issue: writing sources from nugetDefault.Config to local nuget.config during saving package sources.

Collaborator

zhili1208 commented Apr 28, 2016

@yishaigalatzer I think he is referring to sources, we load sources from nugetDefault.config in 3.3, but doesn't do that in 3.4. This is regression from 3.3, but 3.3 has another issue: writing sources from nugetDefault.Config to local nuget.config during saving package sources.

@holytshirt

This comment has been minimized.

Show comment
Hide comment
@holytshirt

holytshirt Apr 28, 2016

@yishaigalatzer as @zhili1208 said 3.3 does not load %ProgramData%\NuGet\NuGetDefaults.config due to a path issue.
This is suggest location for machine wide settings for nuget configuration https://docs.nuget.org/consume/nuget-config-defaults.

Not loading this file causes all default settings to be not load for :

  • Enabled package sources
  • Registered, but disabled-by-default package sources
  • The default nuget.exe push source

holytshirt commented Apr 28, 2016

@yishaigalatzer as @zhili1208 said 3.3 does not load %ProgramData%\NuGet\NuGetDefaults.config due to a path issue.
This is suggest location for machine wide settings for nuget configuration https://docs.nuget.org/consume/nuget-config-defaults.

Not loading this file causes all default settings to be not load for :

  • Enabled package sources
  • Registered, but disabled-by-default package sources
  • The default nuget.exe push source
@fubar-coder

This comment has been minimized.

Show comment
Hide comment
@fubar-coder

fubar-coder Apr 28, 2016

I suggest fixing this for 3.4.4 anyway, because the removal of the default push source being nuget.org is a breaking change without a solution (yet).

fubar-coder commented Apr 28, 2016

I suggest fixing this for 3.4.4 anyway, because the removal of the default push source being nuget.org is a breaking change without a solution (yet).

@yishaigalatzer

This comment has been minimized.

Show comment
Hide comment
@yishaigalatzer

yishaigalatzer Apr 28, 2016

We will have a 3.4.4 build out today for verification

yishaigalatzer commented Apr 28, 2016

We will have a 3.4.4 build out today for verification

@rrelyea

This comment has been minimized.

Show comment
Hide comment
@rrelyea

rrelyea Apr 28, 2016

Contributor

@holytshirt I'm seeing slightly different behavior with my testing. can you tell us the paths of the different config files under %progdata%, along with their contents?

Contributor

rrelyea commented Apr 28, 2016

@holytshirt I'm seeing slightly different behavior with my testing. can you tell us the paths of the different config files under %progdata%, along with their contents?

@holytshirt

This comment has been minimized.

Show comment
Hide comment
@holytshirt

holytshirt Apr 28, 2016

@rrelyea
This is from a clean rebuilt build agent so %ProgramData%\NuGet\NuGetDefaults.config is the only nuget configuration on the machine, which gets pushed out via global policy.
%ProgramData%\NuGet\NuGetDefaults.config maps to C:\ProgramData\NuGet\NuGetDefaults.config and that files contains

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <!-- DefaultPushSource key is similar to the 'DefaultPushSource' key of NuGet.config schema-->
    <!-- This can be used by administrators to prevent accidental publishing of packages to nuget.org -->
    <config>
        <add key="DefaultPushSource" value="http://localnuget.company.local:81/nuget/company/" />
    </config>

    <!-- Default Package Sources -->
    <!-- They cannot be deleted or modified but can be disabled/enabled by user -->
    <!-- The following section is similar to 'packageSources' section of NuGet.config schema -->
    <packageSources>
        <add key="nuget.org -cached (localnuget)" value="http://localnuget.company.local:81/nuget/nuget.org" />
        <add key="companyShared Libraries (localnuget)" value="http://localnuget.company.local:81/nuget/company" />
        <add key="Microsoft and .NET -cached (localnuget)" value="http://localnuget.company.local:81/nuget/nuget.org.microsoft" />
    </packageSources>

    <!-- Default Package Sources that are Disabled by Default -->
    <!-- They cannot be modified or deleted either but can be enabled/disabled by user -->
    <!-- The following section is similar to 'disabledPackageSources' section of NuGet.config schema -->
    <!-- The value part of the entry in 'disabledPackageSources' section has no effect -->
    <disabledPackageSources>
    </disabledPackageSources>
</configuration>

Anything else you need?

holytshirt commented Apr 28, 2016

@rrelyea
This is from a clean rebuilt build agent so %ProgramData%\NuGet\NuGetDefaults.config is the only nuget configuration on the machine, which gets pushed out via global policy.
%ProgramData%\NuGet\NuGetDefaults.config maps to C:\ProgramData\NuGet\NuGetDefaults.config and that files contains

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <!-- DefaultPushSource key is similar to the 'DefaultPushSource' key of NuGet.config schema-->
    <!-- This can be used by administrators to prevent accidental publishing of packages to nuget.org -->
    <config>
        <add key="DefaultPushSource" value="http://localnuget.company.local:81/nuget/company/" />
    </config>

    <!-- Default Package Sources -->
    <!-- They cannot be deleted or modified but can be disabled/enabled by user -->
    <!-- The following section is similar to 'packageSources' section of NuGet.config schema -->
    <packageSources>
        <add key="nuget.org -cached (localnuget)" value="http://localnuget.company.local:81/nuget/nuget.org" />
        <add key="companyShared Libraries (localnuget)" value="http://localnuget.company.local:81/nuget/company" />
        <add key="Microsoft and .NET -cached (localnuget)" value="http://localnuget.company.local:81/nuget/nuget.org.microsoft" />
    </packageSources>

    <!-- Default Package Sources that are Disabled by Default -->
    <!-- They cannot be modified or deleted either but can be enabled/disabled by user -->
    <!-- The following section is similar to 'disabledPackageSources' section of NuGet.config schema -->
    <!-- The value part of the entry in 'disabledPackageSources' section has no effect -->
    <disabledPackageSources>
    </disabledPackageSources>
</configuration>

Anything else you need?

@rrelyea

This comment has been minimized.

Show comment
Hide comment
@rrelyea

rrelyea Apr 28, 2016

Contributor

That helps. Thx. We are considering options.
I was using %ProgramData%\nuget\config\foo.config, instead of %programdata%\nuget\NugetDefaults.config -- so my sources didn't disappear.
DefaultPushSource was broken in both ways.

Contributor

rrelyea commented Apr 28, 2016

That helps. Thx. We are considering options.
I was using %ProgramData%\nuget\config\foo.config, instead of %programdata%\nuget\NugetDefaults.config -- so my sources didn't disappear.
DefaultPushSource was broken in both ways.

zhili1208 added a commit to NuGet/NuGet.Client that referenced this issue Apr 28, 2016

zhili1208 added a commit to NuGet/NuGet.Client that referenced this issue Apr 28, 2016

zhili1208 added a commit to NuGet/NuGet.Client that referenced this issue Apr 29, 2016

@zhili1208

This comment has been minimized.

Show comment
Hide comment
@zhili1208
Collaborator

zhili1208 commented Apr 29, 2016

@zhili1208 zhili1208 closed this Apr 29, 2016

@zhili1208 zhili1208 assigned spadapet and unassigned zhili1208 Apr 29, 2016

@spadapet

This comment has been minimized.

Show comment
Hide comment
@spadapet

spadapet Apr 29, 2016

I tested DefaultPushSource in local nuget.config, user nuget.config, and machine nugetdefaults.config. Works fine.

spadapet commented Apr 29, 2016

I tested DefaultPushSource in local nuget.config, user nuget.config, and machine nugetdefaults.config. Works fine.

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