Skip to content

ResolvePackageAssets InvalidDataException Found invalid data while decoding #3151

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

Closed
Tratcher opened this issue Apr 19, 2019 · 10 comments
Closed
Assignees
Labels
Milestone

Comments

@Tratcher
Copy link
Member

Resolution.targets(233,5): message NETSDK1062: Unable to use package assets cache due to I/O error. This can occur when
 the same project is built more than once in parallel. Performance may be degraded, but the build result will not be im
pacted. [D:\github\AspNetCore\artifacts\obj\LoggingBranch\Debug\net461\se\rs.csproj]

d:\github\AspNetCore\.dotnet\x64\sdk\3.0.100-preview4-011136\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependency
Resolution.targets(233,5): error MSB4018: The "ResolvePackageAssets" task failed unexpectedly. [D:\github\AspNetCore\ar
tifacts\obj\LoggingBranch\Debug\net461\se\rs.csproj]
d:\github\AspNetCore\.dotnet\x64\sdk\3.0.100-preview4-011136\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependency
Resolution.targets(233,5): error MSB4018: System.IO.InvalidDataException: Found invalid data while decoding. [D:\github
\AspNetCore\artifacts\obj\LoggingBranch\Debug\net461\se\rs.csproj]

d:\github\AspNetCore\.dotnet\x64\sdk\3.0.100-preview4-011136\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependency
Resolution.targets(233,5): error MSB4018:    at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader.ValidateHead
er(BinaryReader reader, Byte[] settingsHash) in /_/src/Tasks/Microsoft.NET.Build.Tasks/ResolvePackageAssets.cs:line 529
 [D:\github\AspNetCore\artifacts\obj\LoggingBranch\Debug\net461\se\rs.csproj]
d:\github\AspNetCore\.dotnet\x64\sdk\3.0.100-preview4-011136\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependency
Resolution.targets(233,5): error MSB4018:    at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader.OpenCacheStr
eam(Stream stream, Byte[] settingsHash) in /_/src/Tasks/Microsoft.NET.Build.Tasks/ResolvePackageAssets.cs:line 511 [D:\
github\AspNetCore\artifacts\obj\LoggingBranch\Debug\net461\se\rs.csproj]
d:\github\AspNetCore\.dotnet\x64\sdk\3.0.100-preview4-011136\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependency
Resolution.targets(233,5): error MSB4018:    at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader.CreateReader
FromDisk(ResolvePackageAssets task, Byte[] settingsHash) in /_/src/Tasks/Microsoft.NET.Build.Tasks/ResolvePackageAssets
.cs:line 492 [D:\github\AspNetCore\artifacts\obj\LoggingBranch\Debug\net461\se\rs.csproj]
d:\github\AspNetCore\.dotnet\x64\sdk\3.0.100-preview4-011136\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependency
Resolution.targets(233,5): error MSB4018:    at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader..ctor(Resolv
ePackageAssets task) in /_/src/Tasks/Microsoft.NET.Build.Tasks/ResolvePackageAssets.cs:line 440 [D:\github\AspNetCore\a
rtifacts\obj\LoggingBranch\Debug\net461\se\rs.csproj]
d:\github\AspNetCore\.dotnet\x64\sdk\3.0.100-preview4-011136\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependency
Resolution.targets(233,5): error MSB4018:    at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ReadItemGroups() in /_/s
rc/Tasks/Microsoft.NET.Build.Tasks/ResolvePackageAssets.cs:line 284 [D:\github\AspNetCore\artifacts\obj\LoggingBranch\D
ebug\net461\se\rs.csproj]
d:\github\AspNetCore\.dotnet\x64\sdk\3.0.100-preview4-011136\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependency
Resolution.targets(233,5): error MSB4018:    at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ExecuteCore() in /_/src/
Tasks/Microsoft.NET.Build.Tasks/ResolvePackageAssets.cs:line 276 [D:\github\AspNetCore\artifacts\obj\LoggingBranch\Debu
g\net461\se\rs.csproj]
d:\github\AspNetCore\.dotnet\x64\sdk\3.0.100-preview4-011136\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependency
Resolution.targets(233,5): error MSB4018:    at Microsoft.NET.Build.Tasks.TaskBase.Execute() in /_/src/Tasks/Common/Tas
kBase.cs:line 35 [D:\github\AspNetCore\artifacts\obj\LoggingBranch\Debug\net461\se\rs.csproj]
d:\github\AspNetCore\.dotnet\x64\sdk\3.0.100-preview4-011136\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependency
Resolution.targets(233,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITask
ExecutionHost.Execute() [D:\github\AspNetCore\artifacts\obj\LoggingBranch\Debug\net461\se\rs.csproj]
d:\github\AspNetCore\.dotnet\x64\sdk\3.0.100-preview4-011136\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependency
Resolution.targets(233,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.Move
Next() [D:\github\AspNetCore\artifacts\obj\LoggingBranch\Debug\net461\se\rs.csproj]

Repo: https://github.com/aspnet/aspnetcore
Branch: master
Command: build.cmd -all -pack
Tracking: https://github.com/aspnet/AspNetCore-Internal/issues/2009

How does one go about debugging this?

@livarcocc
Copy link
Contributor

@nguerrera this is our cache right?

@livarcocc livarcocc added this to the Discussion milestone May 8, 2019
@admilazz
Copy link

admilazz commented May 20, 2019

I get this with .NET core 2.2. It's reproducible for me by using a conditional ItemGroup in a .csproj file where the condition is satisfied:

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>
    <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
    <TrimUnusedDependencies>true</TrimUnusedDependencies>
    <DefaultItemExcludes>$(DefaultItemExcludes);out/**</DefaultItemExcludes>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App" />
    <PackageReference Include="Microsoft.Packaging.Tools.Trimming" Version="1.1.0-preview1-26619-01" />
  </ItemGroup>
  <ItemGroup Condition="'$(Configuration)'=='Debug'">
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
    <PackageReference Include="MSTest.TestAdapter" Version="1.1.18" />
    <PackageReference Include="MSTest.TestFramework" Version="1.1.18" />
  </ItemGroup>
</Project>

When I build this with dotnet build -o out --force -c Debug it consistently fails with:

/usr/share/dotnet/sdk/2.2.203/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error MSB4018: The "ResolvePackageAssets" task failed unexpectedly. [/home/adam/Dusky/dotnet/agent/agent/Dusky.Agent.csproj]
/usr/share/dotnet/sdk/2.2.203/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error MSB4018: System.IO.InvalidDataException: Found invalid data while decoding. [/home/adam/Dusky/dotnet/agent/agent/Dusky.Agent.csproj]
/usr/share/dotnet/sdk/2.2.203/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error MSB4018: at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader.ValidateHeader(BinaryReader reader, Byte[] settingsHash) [/home/adam/Dusky/dotnet/agent/agent/Dusky.Agent.csproj]
/usr/share/dotnet/sdk/2.2.203/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error MSB4018: at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader.OpenCacheStream(Stream stream, Byte[] settingsHash) [/home/adam/Dusky/dotnet/agent/agent/Dusky.Agent.csproj]
/usr/share/dotnet/sdk/2.2.203/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error MSB4018: at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader.CreateReaderFromDisk(ResolvePackageAssets task, Byte[] settingsHash) [/home/adam/Dusky/dotnet/agent/agent/Dusky.Agent.csproj]
/usr/share/dotnet/sdk/2.2.203/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error MSB4018: at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader..ctor(ResolvePackageAssets task) [/home/adam/Dusky/dotnet/agent/agent/Dusky.Agent.csproj]
/usr/share/dotnet/sdk/2.2.203/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error MSB4018: at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ReadItemGroups() [/home/adam/Dusky/dotnet/agent/agent/Dusky.Agent.csproj]
/usr/share/dotnet/sdk/2.2.203/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error MSB4018: at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ExecuteCore() [/home/adam/Dusky/dotnet/agent/agent/Dusky.Agent.csproj]
/usr/share/dotnet/sdk/2.2.203/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error MSB4018: at Microsoft.NET.Build.Tasks.TaskBase.Execute() [/home/adam/Dusky/dotnet/agent/agent/Dusky.Agent.csproj]
/usr/share/dotnet/sdk/2.2.203/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/home/adam/Dusky/dotnet/agent/agent/Dusky.Agent.csproj]
/usr/share/dotnet/sdk/2.2.203/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/home/adam/Dusky/dotnet/agent/agent/Dusky.Agent.csproj]

But maybe it won't reproduce for you...

@nguerrera
Copy link
Contributor

@admilazz Unfortunately, I cannot repro that.

@nguerrera
Copy link
Contributor

nguerrera commented May 23, 2019

If someone can repro still repro this, the following would be usfeul:

  1. Binary log: https://gist.github.com/dsplaisted/b256d7804672a6f6375476a5f5658b7b
  2. Copy of obj\Debug\netcoreapp3.0\*.assets.cache

@natemcmaster
Copy link
Contributor

@Tratcher has a repro. See https://github.com/aspnet/AspNetCore-Internal/issues/2009#issuecomment-496696955 for internal network drop share that contains the log files.

@nguerrera
Copy link
Contributor

Thanks. I'll take a look right away.

@nguerrera nguerrera modified the milestones: Discussion, 3.0.1xx May 30, 2019
@nguerrera
Copy link
Contributor

This is happening in dotnet store targets and is almost certainly a dupe of these issues that I am working on fixing with one big simplification of dotnet store:

https://github.com/dotnet/sdk/issues?q=is%3Aopen+is%3Aissue+assignee%3Anguerrera+label%3AStore

@nguerrera nguerrera self-assigned this May 30, 2019
@mkArtakMSFT
Copy link
Contributor

Hi @nguerrera. Do you have any update regarding this? Is this fixed (I see one issue from the list is closed): #2914 ?

@nguerrera
Copy link
Contributor

@mkArtakMSFT Yes, please try the latest preview7 core-sdk. I believe this should be fixed.

@nguerrera
Copy link
Contributor

@JunTaoLuo Have you tried building with Preview 7 and without the workarounds? I'm closing this as fixed by #3345, but if you are still having issues, I can reopen.

dsplaisted pushed a commit to dsplaisted/sdk that referenced this issue Feb 19, 2020
…0191010.08 (dotnet#3151)

- Microsoft.NETCore.App.Runtime.win-x64 - 3.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants