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

Credential plugin exited with error -1 / error downloading package when using credential providers with multiple sources #2885

Closed
zarenner opened this issue Jun 2, 2016 · 6 comments · Fixed by NuGet/NuGet.Client#779
Assignees
Labels
Priority:1 High priority issues that must be resolved in the current sprint. Type:Bug
Milestone

Comments

@zarenner
Copy link

zarenner commented Jun 2, 2016

I believe there's a bug with how exceptions are not handled after a credential provider invocation is cancelled, because the package was already successfully fetched from another package source. This results in an error that indicates the credential provider returned -1 (which it did because it was intentionally terminated by nuget).

I've reproed this in NuGet >=3.4, including latest nightly.

I haven't been able to repro this in 3.3 (when the credential provider system was introduced I believe), so something must have changed there between 3.3 and 3.4.

It can be somewhat consistently reproed with a configuration as simple as this:
NuGet.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <clear />
    <add key="zarenner" value="https://zarenner.pkgs.visualstudio.com/DefaultCollection/_packaging/feed2/nuget/v3/index.json" protocolVersion="3" />
    <add key="zlrenner" value="https://zlrenner.pkgs.visualstudio.com/DefaultCollection/_packaging/feed1/nuget/v3/index.json" protocolVersion="3" />
  </packageSources>
</configuration>

Packages.config

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="testpackage" version="1.0.0" />
</packages>

Output

c:\bug\594411>nuget3.5.0-nightly.exe restore -OutputDirectory out
Restoring NuGet package testpackage.1.0.0.
  GET https://zarenner.pkgs.visualstudio.com/DefaultCollection/_packaging/95b70ba9-e6ba-4d30-aa2f-f5ae36261a3b/nuget/v3/flat2/testpackage/1.0.0/testpackage.1.0.0.nupkg
  GET https://zlrenner.pkgs.visualstudio.com/DefaultCollection/_packaging/87e62fbc-5a99-4ed8-b544-f79d6e8d6241/nuget/v3/flat2/testpackage/1.0.0/testpackage.1.0.0.nupkg
  Unauthorized https://zlrenner.pkgs.visualstudio.com/DefaultCollection/_packaging/87e62fbc-5a99-4ed8-b544-f79d6e8d6241/nuget/v3/flat2/testpackage/1.0.0/testpackage.1.0.0.nupkg 261ms
  Unauthorized https://zarenner.pkgs.visualstudio.com/DefaultCollection/_packaging/95b70ba9-e6ba-4d30-aa2f-f5ae36261a3b/nuget/v3/flat2/testpackage/1.0.0/testpackage.1.0.0.nupkg 387ms
  GET https://zlrenner.pkgs.visualstudio.com/DefaultCollection/_packaging/87e62fbc-5a99-4ed8-b544-f79d6e8d6241/nuget/v3/flat2/testpackage/1.0.0/testpackage.1.0.0.nupkg
  OK https://zlrenner.pkgs.visualstudio.com/DefaultCollection/_packaging/87e62fbc-5a99-4ed8-b544-f79d6e8d6241/nuget/v3/flat2/testpackage/1.0.0/testpackage.1.0.0.nupkg 946ms
Installing testpackage 1.0.0.
Adding package 'testpackage.1.0.0' to folder 'c:\bug\594411\out'
Error downloading 'testpackage.1.0.0' from 'https://zarenner.pkgs.visualstudio.com/DefaultCollection/_packaging/95b70ba9-e6ba-4d30-aa2f-f5ae36261a3b/nuget/v3/flat2/testpackage/1.0.0/testpackage.1.0.0.nupkg'.
Credential plugin c:\bug\594411\CredentialProvider.VSS.exe exited with error -1.
Getting new credentials for source:https://zarenner.pkgs.visualstudio.com/DefaultCollection/_packaging/feed2/nuget/v3/index.json, scope:vso.packaging_write vso.drop_write
Added package 'testpackage.1.0.0' to folder 'c:\bug\594411\out'

Errors in packages.config projects
    Error downloading 'testpackage.1.0.0' from 'https://zarenner.pkgs.visualstudio.com/DefaultCollection/_packaging/95b70ba9-e6ba-4d30-aa2f-f5ae36261a3b/nuget/v3/flat2/testpackage/1.0.0/testpackage.1.0.0.nupkg'.
    Credential plugin c:\bug\594411\CredentialProvider.VSS.exe exited with error -1.
    Getting new credentials for source:https://zarenner.pkgs.visualstudio.com/DefaultCollection/_packaging/feed2/nuget/v3/index.json, scope:vso.packaging_write vso.drop_write

NuGet Config files used:
    c:\bug\594411\NuGet.Config
    C:\Users\zarenner\AppData\Roaming\NuGet\NuGet.Config

Feeds used:
    c:\nugetglobal
    https://zarenner.pkgs.visualstudio.com/DefaultCollection/_packaging/feed2/nuget/v3/index.json
    https://zlrenner.pkgs.visualstudio.com/DefaultCollection/_packaging/feed1/nuget/v3/index.json

Installed:
    1 package(s) to packages.config projects
@zarenner zarenner changed the title Credential plugin exited with error -1 / error downloading package when using credential plugins with multiple sources Credential plugin exited with error -1 / error downloading package when using credential providers with multiple sources Jun 2, 2016
@rrelyea rrelyea added this to the 3.4.4 milestone Jun 2, 2016
@rrelyea rrelyea added Priority:1 High priority issues that must be resolved in the current sprint. Type:Bug labels Jun 2, 2016
@rrelyea rrelyea assigned joelverhagen and unassigned alpaix Jun 2, 2016
@joelverhagen
Copy link
Member

Spoke to Zach offline. He has tried 3.4.3 as well as a recent dev build from MyGet. 3.3.0 does not demonstrate the issue. I am working on reproducing it on my end.

@joelverhagen joelverhagen modified the milestones: 3.4.5, 3.4.4 Jun 2, 2016
@joelverhagen
Copy link
Member

Moved to 3.4.5, after talking to @rrelyea.

@joelverhagen
Copy link
Member

Fixed with NuGet/NuGet.Client#640. Merged into dev and release-3.4.5 branches.

@rrelyea
Copy link
Contributor

rrelyea commented Jul 15, 2016

this should be verified as part of our 3.5 RTM run.

@rrelyea rrelyea reopened this Jul 15, 2016
@rrelyea
Copy link
Contributor

rrelyea commented Jul 15, 2016

Need to confirm that this is fixed in 3.5.0. Please also test #3148 repro (dupe issue) to ensure that both are fixed...etc...

@joelverhagen
Copy link
Member

joelverhagen commented Jul 22, 2016

Fixed with NuGet/NuGet.Client#779.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:1 High priority issues that must be resolved in the current sprint. Type:Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants