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

error NU1403: Package content hash validation failed #8574

Closed
MisinformedDNA opened this issue Sep 11, 2019 · 7 comments
Closed

error NU1403: Package content hash validation failed #8574

MisinformedDNA opened this issue Sep 11, 2019 · 7 comments
Labels
Area:RestoreRepeatableBuild The lock file features Functionality:Restore Resolution:Duplicate This issue appears to be a Duplicate of another issue Type:Bug

Comments

@MisinformedDNA
Copy link

MisinformedDNA commented Sep 11, 2019

Details about Problem

NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe): dotnet

NuGet version (x.x.x.xxx): 5.3.0.3

dotnet.exe --version (if appropriate): 3.0.100-preview9-014004

VS version (if appropriate):

OS version (i.e. win10 v1607 (14393.321)): win10 v1803 (17134.950)

Worked before? If so, with which NuGet version:

Detailed repro steps so we can see the same problem

  1. Find an existing solution (I'll continue to try to narrow this down)

  2. Add the following to Directory.Build.props (in the solution folder)

<PropertyGroup>
  <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>
  1. Run locally
dotnet restore solution.sln --force-evaluate
dotnet restore solution.sln --locked-mode
  1. Run in CI
dotnet restore solution.sln --locked-mode

EXPECTED: CI resolves all packages successfully, just like it does locally.

ACTUAL: CI generates lots of errors:

Package content hash validation failed for Microsoft.NETCore.Platforms.1.1.0. Expected: IQkwtWGo0vpmpAY1gGxZaRNaIZGVtT8AuMXxn5VkseSiAJA+p05mLcjHjvrr9OGdEe/5KhKVbJpZ1sjEVPYNVg== Actual: kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==
Package content hash validation failed for Microsoft.NETCore.Targets.1.1.0. Expected: 9ElOT7IzAq0d6x8oj4cA4EGLSArQM9bMhWNEcZcdSMM6WKogm2WApVYVStwbIqJrsp5xDeMEyC0ilMiz8IfVvA== Actual: aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==
Package content hash validation failed for runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl.4.3.0. Expected: vhYwlEkWIj58SyPvGnvao2N3/SkSjGRo9ENRSANfkAyi4HpFmERIB9TqPvXX09iAn0YtbmEPzbuqh+DfB5Buog== Actual: HdSSp5MnJSsg08KMfZThpuLPJpPwE5hBXvHwoKWosyHHfe8Mh5WKT0ylEOf6yNzX6Ngjxe4Whkafh5q7Ymac4Q==
Package content hash validation failed for runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl.4.3.0. Expected: aio5JNQATXURQ3utPAvOZ3fuvNJCoOrPZemmfEK/SDDFbs8DVZesKxVHGVnGBGMy9pGChT5KWny6leCkcfwzHA== Actual: +yH1a49wJMy8Zt4yx5RhJrxO/DBDByAiCzNwiETI+1S4mPdCu0OY4djdciC7Vssk0l22wQaDLrXxXkp+3+7bVA==
Package content hash validation failed for Microsoft.NETCore.Platforms.1.1.0. Expected: IQkwtWGo0vpmpAY1gGxZaRNaIZGVtT8AuMXxn5VkseSiAJA+p05mLcjHjvrr9OGdEe/5KhKVbJpZ1sjEVPYNVg== Actual: kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==
Package content hash validation failed for runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl.4.3.0. Expected: JYLc6/TV7Z9IrKQY8YP6xfXI3Xb8yJJ138mQ2SNIkRcnsRo+s5D4GFt+xZySVrRHOng9KVQWhekr8MGS9hqY1A== Actual: c3YNH1GQJbfIPJeCnr4avseugSqPrxwIqzthYyZDN6EuOyNOzq+y2KSUfRcXauya1sF4foESTgwM5e1A8arAKw==

The error seems to be due to the fallback folder, so I added the following to Directory.Build.prop.

  <DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>

No change.

Other suggested things

Verbose Logs

Can include privately

@rrelyea
Copy link
Contributor

rrelyea commented Sep 16, 2019

See the steps in this comment: #7921 (comment)
Does that fix it for you?

@dominoFire
Copy link
Contributor

Possible duplicate of #7921

@dominoFire dominoFire added the Resolution:Duplicate This issue appears to be a Duplicate of another issue label Sep 16, 2019
@dominoFire dominoFire added this to the Backlog milestone Sep 16, 2019
@MisinformedDNA
Copy link
Author

@rrelyea I can try that, but if this is MS's solution, why is it not documented anywhere (except buried in a GitHub thread)? And how does .NET Core 3 SDK and/or runtime affect the solution?

@nkolev92 nkolev92 removed this from the Backlog milestone Apr 17, 2020
@nkolev92
Copy link
Member

Issue moved to NuGet/docs.microsoft.com-nuget #1998 via ZenHub

@nkolev92
Copy link
Member

Converting this to a docs issue: #7921 (comment)

@dazinator
Copy link

The linked issue hasn't solved this for me.

@dazinator
Copy link

Correction - the linked issue docs do work for me but not if I use 3.1.300-preview-015095 sdk to generate the local package.lock files, and the azure pipelines build server is using dotnet sdk 3.1.201. If I use 3.1.201 both to generate and restore it works.

0xced added a commit to serilog-contrib/serilog-formatting-log4net that referenced this issue Feb 2, 2021
In order to try to fix this error seen on the GitHub action:

> /home/runner/work/serilog-formatting-log4net/serilog-formatting-log4net/src/Serilog.Formatting.Log4Net.csproj : error NU1403: Package content hash validation failed for Microsoft.NETCore.Platforms.1.1.0. The package is different than the last restore. [/home/runner/work/serilog-formatting-log4net/serilog-formatting-log4net/serilog-formatting-log4net.sln]

See NuGet/Home#8574 and https://github.com/NuGet/docs.microsoft.com-nuget/issues/1998
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area:RestoreRepeatableBuild The lock file features Functionality:Restore Resolution:Duplicate This issue appears to be a Duplicate of another issue Type:Bug
Projects
None yet
Development

No branches or pull requests

6 participants