aspnet / dnx

OBSOLETE - see readme
Other
964 stars 224 forks source link

DNU restore fails on OS X with ZIP exceptions #2704

Closed filipw closed 8 years ago

filipw commented 8 years ago

I'm trying to restore packages using dnu restore on OS X and a bunch of packages report Unknown header and then follow by a ZIP exception stacktrace

~/Documents/Visual Studio 2015/Projects/ScriptCsRepl/src/ScriptCsRepl$ dnu restore
Microsoft .NET Development Utility Mono-x64-1.0.0-beta7-15532

  CACHE https://www.myget.org/F/aspnetvnext/api/v2/
  CACHE https://www.nuget.org/api/v2/
Restoring packages for /Users/filip/Documents/Visual Studio 2015/Projects/ScriptCsRepl/src/ScriptCsRepl/project.json
  CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='Microsoft.Dnx.Runtime.Abstractions'
  CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.Dnx.Runtime.Abstractions'
  CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='ScriptCs.Hosting'
  CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='ScriptCs.Hosting'
  CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='ScriptCs.Engine.Roslyn'
  CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='ScriptCs.Engine.Roslyn'
  CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='ScriptCs.Engine.Mono'
  CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='ScriptCs.Engine.Mono'
  CACHE https://www.myget.org/F/aspnetvnext/api/v2/package/Microsoft.Dnx.Runtime.Abstractions/1.0.0-beta8-15616
  CACHE https://www.nuget.org/api/v2/package/ScriptCs.Engine.Roslyn/0.15.0
  CACHE https://www.nuget.org/api/v2/package/ScriptCs.Engine.Mono/0.15.0
  CACHE https://www.nuget.org/api/v2/package/ScriptCs.Hosting/0.15.0
  CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='ScriptCs.Core'
  CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='ScriptCs.Core'
  CACHE https://www.nuget.org/api/v2/package/ScriptCs.Core/0.15.0
  CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='ScriptCs.Contracts'
  CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='Roslyn.Compilers.CSharp'
  CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='ScriptCs.Contracts'
  CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='Roslyn.Compilers.CSharp'
  CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='ICSharpCode.NRefactory'
  CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='ICSharpCode.NRefactory'
  CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='NuGet.Core'
  CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='Mono.CSharp'
  CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='Mono.CSharp'
  CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='Newtonsoft.Json'
  CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='NuGet.Core'
  CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='Newtonsoft.Json'
  GET https://www.nuget.org/api/v2/package/Roslyn.Compilers.CSharp/1.2.20906.2
  GET https://www.nuget.org/api/v2/package/Mono.CSharp/4.0.0.143
  GET https://www.nuget.org/api/v2/package/ICSharpCode.NRefactory/5.5.1
  GET https://www.nuget.org/api/v2/package/Newtonsoft.Json/6.0.3
  CACHE https://www.nuget.org/api/v2/package/ScriptCs.Contracts/0.15.0
  GET https://www.nuget.org/api/v2/package/NuGet.Core/2.8.6
Warning: DownloadPackageAsync: https://www.nuget.org/api/v2/package/Mono.CSharp/4.0.0.143
  Unknown header: 1936027769
  GET https://www.nuget.org/api/v2/package/Mono.CSharp/4.0.0.143
  OK https://www.nuget.org/api/v2/package/ICSharpCode.NRefactory/5.5.1 1977ms
  CACHE https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='Mono.Cecil'
  CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='Mono.Cecil'
  GET https://www.nuget.org/api/v2/package/Mono.Cecil/0.9.5.4
Warning: DownloadPackageAsync: https://www.nuget.org/api/v2/package/Roslyn.Compilers.CSharp/1.2.20906.2
  Unknown header: 1047750000
  GET https://www.nuget.org/api/v2/package/Roslyn.Compilers.CSharp/1.2.20906.2
Warning: DownloadPackageAsync: https://www.nuget.org/api/v2/package/Newtonsoft.Json/6.0.3
  Unknown header: 21712958
  GET https://www.nuget.org/api/v2/package/Newtonsoft.Json/6.0.3
Warning: DownloadPackageAsync: https://www.nuget.org/api/v2/package/NuGet.Core/2.8.6
  Unknown header: 62774127
  GET https://www.nuget.org/api/v2/package/NuGet.Core/2.8.6
Warning: DownloadPackageAsync: https://www.nuget.org/api/v2/package/Mono.CSharp/4.0.0.143
  Unknown header: 1819113515
  GET https://www.nuget.org/api/v2/package/Mono.CSharp/4.0.0.143
Warning: DownloadPackageAsync: https://www.nuget.org/api/v2/package/Mono.Cecil/0.9.5.4
  Unknown header: 1047750000
  GET https://www.nuget.org/api/v2/package/Mono.Cecil/0.9.5.4
  OK https://www.nuget.org/api/v2/package/Roslyn.Compilers.CSharp/1.2.20906.2 2595ms
  GET https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='Roslyn.Compilers.Common'
  GET https://www.nuget.org/api/v2/FindPackagesById()?id='Roslyn.Compilers.Common'
  OK https://www.nuget.org/api/v2/FindPackagesById()?id='Roslyn.Compilers.Common' 507ms
Warning: DownloadPackageAsync: https://www.nuget.org/api/v2/package/NuGet.Core/2.8.6
  Unknown header: 4160748965
  GET https://www.nuget.org/api/v2/package/NuGet.Core/2.8.6
  OK https://www.nuget.org/api/v2/package/Newtonsoft.Json/6.0.3 2818ms
Error: DownloadPackageAsync: https://www.nuget.org/api/v2/package/Mono.CSharp/4.0.0.143
  Unknown header: 2035560252
----------
System.NotSupportedException: Unknown header: 2035560252
  at SharpCompress.Common.Zip.ZipHeaderFactory.ReadHeader (UInt32 headerBytes, System.IO.BinaryReader reader) [0x00000] in <filename unknown>:0 
  at SharpCompress.Common.Zip.SeekableZipHeaderFactory+<ReadSeekableHeader>c__Iterator0.MoveNext () [0x00000] in <filename unknown>:0 
  at SharpCompress.Archive.Zip.ZipArchive+<LoadEntries>c__Iterator0.MoveNext () [0x00000] in <filename unknown>:0 
  at SharpCompress.LazyReadOnlyCollection`1+LazyLoader[SharpCompress.Archive.Zip.ZipArchiveEntry].MoveNext () [0x00000] in <filename unknown>:0 
  at System.IO.Compression.ZipArchive.CreateZip (System.IO.Stream stream, ZipArchiveMode mode) [0x00000] in <filename unknown>:0 
  at System.IO.Compression.ZipArchive..ctor (System.IO.Stream stream, ZipArchiveMode mode, Boolean leaveOpen) [0x00000] in <filename unknown>:0 
  at Microsoft.Dnx.Tooling.Restore.NuGet.PackageUtilities.EnsureValidPackageContents (System.IO.Stream stream, Microsoft.Dnx.Tooling.PackageInfo package) [0x00000] in <filename unknown>:0 
  at Microsoft.Dnx.Tooling.Restore.NuGet.PackageUtilities+<>c__DisplayClass1_0.<OpenNupkgStreamAsync>b__0 (System.IO.Stream stream) [0x00000] in <filename unknown>:0 
  at Microsoft.Dnx.Tooling.Restore.NuGet.HttpSource+<GetAsync>d__11.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Dnx.Tooling.Restore.NuGet.PackageUtilities+<OpenNupkgStreamAsync>d__1.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Dnx.Tooling.Restore.NuGet.NuGetv2Feed+<OpenNupkgStreamAsync>d__29.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Dnx.Tooling.Restore.NuGet.PackageUtilities+<OpenNuspecStreamFromNupkgAsync>d__2.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Dnx.Tooling.Restore.NuGet.NuGetv2Feed+<OpenNuspecStreamAsync>d__27.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Dnx.Tooling.RemoteWalkProvider+<GetDependencies>d__7.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Dnx.Tooling.RestoreOperations+<FindLibraryEntry>d__5.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Dnx.Tooling.RestoreOperations+<CreateGraphNode>d__2.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Dnx.Tooling.RestoreOperations+<CreateGraphNode>d__2.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Dnx.Tooling.RestoreOperations+<CreateGraphNode>d__2.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Dnx.Tooling.RestoreCommand+<CreateGraphNode>d__62.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Dnx.Tooling.RestoreCommand+<RestoreForProject>d__61.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[System.Boolean].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Dnx.Tooling.RestoreCommand+<>c__DisplayClass60_0+<<Execute>b__2>d.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Dnx.Tooling.RestoreCommand+<Execute>d__60.MoveNext () [0x00000] in <filename unknown>:0 
----------
Restore failed
Unknown header: 2035560252

NuGet Config files used:
    /Users/filip/.config/NuGet/NuGet.Config
    /Users/filip/Documents/Visual Studio 2015/Projects/ScriptCsRepl/NuGet.Config

Feeds used:
    https://www.myget.org/F/aspnetvnext/api/v2/
    https://www.nuget.org/api/v2/
BrennanConroy commented 8 years ago

Mono 3.12.1? Upgrade mono

analogrelay commented 8 years ago

Is there a way for us to detect the Mono version and fail fast? Heck, we could even do it in the dnx shell script

davidfowl commented 8 years ago

Would be nice wouldn't it.

analogrelay commented 8 years ago

Honestly it can kinda be as simple as some mono --version | grep action. Maybe I'll play with it later.

filipw commented 8 years ago

thanks, Mono upgrade indeed fixed it. Feel free to close it

muratg commented 8 years ago

Thanks @filipw