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

[Bug]: Errors NU3028 and NU3037 when restoring NuGet packages on FreeBSD #11481

Closed
joperator opened this issue Jan 5, 2022 · 2 comments · Fixed by NuGet/NuGet.Client#4389
Closed

Comments

@joperator
Copy link

NuGet Product Used

dotnet.exe

Product Version

.NET SDK (reflecting any global.json): Version: 6.0.100-dev Commit: 2f6dac4342 Runtime Environment: OS Name: FreeBSD OS Version: 12 OS Platform: FreeBSD RID: freebsd.12-x64 Base Path: /usr/local/share/dotnet/sdk/6.0.100-dev/ Host (useful for support): Version: 6.0.0 Commit: N/A .NET SDKs installed: 6.0.100-dev [/usr/local/share/dotnet/sdk] .NET runtimes installed: Microsoft.AspNetCore.App 6.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download

Worked before?

It worked until the root certificate of the corresponding timestamp provider chain was removed: NuGet/Announcements#56

Impact

It's more difficult to complete my work

Repro Steps & Context

This issue has already been fixed by #3979 for Linux and MacOS but not for FreeBSD, because RuntimeEnvironmentHelper.IsLinux returns false if IS_CORECLR is defined. According to common.targets IS_CORECLR is defined for all target frameworks starting with netcoreapp, netstandard or net6, and therefore the code that causes this issue is included by a NuGet package in the dotnet executable.

Verbose Logs

Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  Package 'System.Runtime 4.0.0' from source 'https://api.nuget.org/v3/index.json': 
  Signature type: Repository
  Package 'System.Runtime 4.0.0' from source 'https://api.nuget.org/v3/index.json':   Subject Name: CN=NuGet.org Repository by Microsoft, O=NuGet.org Repository by Microsoft, L=Redmond, S=Washington, C=US
  Package 'System.Runtime 4.0.0' from source 'https://api.nuget.org/v3/index.json':   SHA256 hash: 0E5F38F57DC1BCC806D8494F4F90FBCEDD988B46760709CBEEC6F4219AA6157D
  Package 'System.Runtime 4.0.0' from source 'https://api.nuget.org/v3/index.json':   Valid from: 04/10/2018 00:00:00 to 04/14/2021 12:00:00
/usr/home/Administrator/ConsoleApp/ConsoleApp.csproj : error NU3037: Package 'System.Runtime 4.0.0' from source 'https://api.nuget.org/v3/index.json': The repository primary signature validity period has expired.
/usr/home/Administrator/ConsoleApp/ConsoleApp.csproj : error NU3028: Package 'System.Runtime 4.0.0' from source 'https://api.nuget.org/v3/index.json': The repository primary signature's timestamping certificate is not trusted by the trust provider.
  Failed to restore /usr/home/Administrator/ConsoleApp/ConsoleApp.csproj (in 1.37 sec).

Build FAILED.

/usr/home/Administrator/ConsoleApp/ConsoleApp.csproj : error NU3037: Package 'System.Runtime 4.0.0' from source 'https://api.nuget.org/v3/index.json': The repository primary signature validity period has expired.
/usr/home/Administrator/ConsoleApp/ConsoleApp.csproj : error NU3028: Package 'System.Runtime 4.0.0' from source 'https://api.nuget.org/v3/index.json': The repository primary signature's timestamping certificate is not trusted by the trust provider.
    0 Warning(s)
    2 Error(s)
@nkolev92
Copy link
Member

nkolev92 commented Jan 5, 2022

because RuntimeEnvironmentHelper.IsLinux returns false if IS_CORECLR is defined

Not sure this is the correct interpretation.

It's likely that https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.runtimeinformation.isosplatform?view=net-6.0 that returns false when on FreeBSD.

The FreeBSD option was added in https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.osplatform?view=netcore-3.0 netcoreapp3.0 but wasn't a thing before.

@joperator
Copy link
Author

It's likely that https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.runtimeinformation.isosplatform?view=net-6.0 that returns false when on FreeBSD.

I checked it and System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Linux) returns false on FreeBSD.

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