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

NullreferenceException at RestoreCommand.PerformAuditAsync(IEnumerable<RestoreTargetGraph> graphs, TelemetryActivity telemetry, CancellationToken token) #13526

Closed
TFTomSun opened this issue Jun 8, 2024 · 2 comments
Labels
Area:NuGetAudit Functionality:Restore Resolution:NeedMoreInfo This issue appears to not have enough info to take action Type:Bug WaitingForCustomer Applied when a NuGet triage person needs more info from the OP

Comments

@TFTomSun
Copy link

TFTomSun commented Jun 8, 2024

NuGet Product Used

NuGet SDK

Product Version

net48, net6

Worked before?

6.7.1

Impact

I'm unable to use this version

Repro Steps & Context

Executing the restore command fails since Version 6.8.0 - I tried with all newer versions, including the current preview 6.11.0-preview.2. It fails for net48 and net6 processes. But I assume it would also fail for net8.

In our enterprise environments nuget.config we use local sources (directories) and nuget sources pointing to a JFrog Artifactory instance.

Is that issue already known? Or should I provide more information.

The failing line is in NuGet.Commands.RestoreCommand.PerformAuditAsync:
AuditUtility audit = new AuditUtility(_request.Project.RestoreMetadata.RestoreAuditProperties, _request.Project.FilePath, graphs, _request.DependencyProviders.VulnerabilityInfoProviders, _logger);

in _request.Project.RestoreMetadata.RestoreAuditProperties the RestoreMetadata property is null, maybe because of a missing source error that happened before, which was catched.

Verbose Logs

> NullReferenceException [0]: 
at NuGet.Commands.RestoreCommand.<PerformAuditAsync>d__72.MoveNext()
at NuGet.Commands.RestoreCommand.<ExecuteAsync>d__71.MoveNext()


dotnet --info
.NET SDK:
 Version:           8.0.200
 Commit:            438cab6a9d
 Workload version:  8.0.200-manifests.1850e762

Laufzeitumgebung:
 OS Name:     Windows
 OS Version:  10.0.19045
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\8.0.200\

Installierte .NET-Workloads:
Es sind keine installierten Workloads zum Anzeigen vorhanden.

Host:
  Version:      8.0.2
  Architecture: x64
  Commit:       1381d5ebd2

.NET SDKs installed:
  7.0.113 [C:\Program Files\dotnet\sdk]
  8.0.200 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.24 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.24 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.24 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download
@nkolev92
Copy link
Member

nkolev92 commented Jun 18, 2024

@TFTomSun

Not really a known thing.

RestoreMetadata should be something that's always set.

Do you have any DotnetCliToolReference items in your projects by any chance?

If you don't have that, it'd be great if you can help us get a repro.

@nkolev92 nkolev92 added WaitingForCustomer Applied when a NuGet triage person needs more info from the OP Functionality:Restore Area:NuGetAudit and removed Triage:Untriaged labels Jun 18, 2024
@dotnet-policy-service dotnet-policy-service bot added the Status:No recent activity No recent activity. label Jul 3, 2024
Copy link
Contributor

This issue has been automatically marked as stale because we have not received a response in 14 days. It will be closed if no further activity occurs within another 14 days of this comment.

@dotnet-policy-service dotnet-policy-service bot added Resolution:NeedMoreInfo This issue appears to not have enough info to take action and removed Status:No recent activity No recent activity. labels Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area:NuGetAudit Functionality:Restore Resolution:NeedMoreInfo This issue appears to not have enough info to take action Type:Bug WaitingForCustomer Applied when a NuGet triage person needs more info from the OP
Projects
None yet
Development

No branches or pull requests

2 participants