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

Improve error message for dotnet add package NuGet.Versioning fails for Repository trusted signers #11509

Open
erdembayar opened this issue Jan 14, 2022 · 0 comments
Labels
Area:Logging Functionality:Signing Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Product:dotnet.exe Type:Bug

Comments

@erdembayar
Copy link
Contributor

erdembayar commented Jan 14, 2022

Let's say nuget.config contains below:

  <trustedSigners>
    <repository name="NuGetTrust" serviceIndex="https://api.nuget.org/v3/index.json">
      <certificate fingerprint="0e5f38f57dc1bcc806d8494f4f90fbcedd988b46760709cbeec6f4219aa6157d" hashAlgorithm="SHA256" allowUntrustedRoot="false" />
      <certificate fingerprint="5a2901d6ada3d18260b9c6dfe2133c95d74b9eef6ae0e5dc334c8454d1477df4" hashAlgorithm="SHA256" allowUntrustedRoot="false" />
      <owners>test</owners>
    </repository>
  </trustedSigners>

"dotnet add package nuget.versioning" fails, error message is not clear exact what failed: error: Value cannot be null. (Parameter 'path1')

info : Adding PackageReference for package 'nuget.versioning' into project 'C:\Users\xxxxxx\source\repos\SigningDemo\RestoreTest\RestoreTest.csproj'.
info :   CACHE https://api.nuget.org/v3/registration5-gz-semver2/nuget.versioning/index.json
info : Restoring packages for C:\Users\xxxxxx\source\repos\SigningDemo\RestoreTest\RestoreTest.csproj...
info :   CACHE https://api.nuget.org/v3-flatcontainer/nuget.versioning/index.json
info :   CACHE https://api.nuget.org/v3-flatcontainer/nuget.versioning/6.0.0/nuget.versioning.6.0.0.nupkg
info : Package 'NuGet.Versioning 6.0.0' from source 'https://api.nuget.org/v3/index.json': Signature Hash Algorithm: SHA256
error: NU3034: Package 'NuGet.Versioning 6.0.0' from source 'https://api.nuget.org/v3/index.json': This package is signed but not by a trusted signer.
log  : Package 'NuGet.Versioning 6.0.0' from source 'https://api.nuget.org/v3/index.json':
log  : Signature type: Author
info : Package 'NuGet.Versioning 6.0.0' from source 'https://api.nuget.org/v3/index.json': Verifying the author primary signature with certificate:
log  : Package 'NuGet.Versioning 6.0.0' from source 'https://api.nuget.org/v3/index.json':   Subject Name: CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
info : Package 'NuGet.Versioning 6.0.0' from source 'https://api.nuget.org/v3/index.json':   SHA1 hash: A6E18D21B507879FC7F9C392A5CE355936E3AD2C
log  : Package 'NuGet.Versioning 6.0.0' from source 'https://api.nuget.org/v3/index.json':   SHA256 hash: AA12DA22A49BCE7D5C1AE64CC1F3D892F150DA76140F210ABD2CBFFCA2C18A27
info : Package 'NuGet.Versioning 6.0.0' from source 'https://api.nuget.org/v3/index.json':   Issued by: CN=DigiCert SHA2 Assured ID Code Signing CA, OU=www.digicert.com, O=DigiCert Inc, C=US
log  : Package 'NuGet.Versioning 6.0.0' from source 'https://api.nuget.org/v3/index.json':   Valid from: 9/29/2020 5:00:00 PM to 10/5/2023 5:00:00 AM
info : Package 'NuGet.Versioning 6.0.0' from source 'https://api.nuget.org/v3/index.json': Timestamp: 10/22/2021 7:23:16 PM
info : Package 'NuGet.Versioning 6.0.0' from source 'https://api.nuget.org/v3/index.json': Verifying author primary signature's timestamp with timestamping service certificate:
info :   Subject Name: CN=Symantec SHA256 TimeStamping Signer - G3, OU=Symantec Trust Network, O=Symantec Corporation, C=US
info :   SHA1 hash: A9A4121063D71D48E8529A4681DE803E3E7954B0
info :   SHA256 hash: C474CE76007D02394E0DA5E4DE7C14C680F9E282013CFEF653EF5DB71FDF61F8
info :   Issued by: CN=Symantec SHA256 TimeStamping CA, OU=Symantec Trust Network, O=Symantec Corporation, C=US
info :   Valid from: 12/22/2017 4:00:00 PM to 3/22/2029 4:59:59 PM
info : Package 'nuget.versioning' is compatible with all the specified frameworks in project 'C:\Users\xxxxxx\source\repos\SigningDemo\RestoreTest\RestoreTest.csproj'.
error: Value cannot be null. (Parameter 'path1')


Usage: NuGet.CommandLine.XPlat.dll package add [options]

Options:
  -h|--help               Show help information
  --force-english-output  Forces the application to run using an invariant, English-based culture.
  --package               Id of the package to be added.
  --version               Version of the package to be added.
  -d|--dg-file            Path to the dependency graph file to be used to restore preview and compatibility check.
  -p|--project            Path to the project file.
  -f|--framework          Frameworks for which the package reference should be added.
  -n|--no-restore         Do not perform restore preview and compatibility check. The added package reference will be unconditional.
  -s|--source             Specifies NuGet package sources to use during the restore.
  --package-directory     Directory to restore packages in.
  --interactive           Allow the command to block and require manual action for operations like authentication.
  --prerelease            Allows prerelease packages to be installed.
@erdembayar erdembayar assigned erdembayar and unassigned erdembayar Jan 14, 2022
@zivkan zivkan added Area:Logging Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. labels Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area:Logging Functionality:Signing Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Product:dotnet.exe Type:Bug
Projects
None yet
Development

No branches or pull requests

4 participants