SharpCompress.Common.ArchiveException: Could not find Zip file Directory at the end of the file. File may be corrupted.
I followed the instructions for installing asp in linux, I use ubuntu 14.10, the mono version is 3.12, almost Reproduce the installation step by step and I did not have any error, use yeoman generator-asp.net -> yo aspnet- > web application with the command kpm restore gave me this error in the end;
SharpCompress.Common.ArchiveException: Could not find Zip file Directory at the end of the file. File may be corrupted.
at SharpCompress.Common.Zip.SeekableZipHeaderFactory+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.Framework.PackageManager.PackageUtilities+<OpenNuspecStreamFromNupkgAsync>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.TaskAwaiter1[System.IO.Stream].GetResult () [0x00000] in 1[System.IO.Stream].GetResult () [0x00000] in <filename unknown>:0 at Microsoft.Framework.PackageManager.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.TaskAwaiter1[System.Collections.Generic.IEnumerable1[Microsoft.Framework.Runtime.LibraryDependency]].GetResult () [0x00000] in <filename unknown>:0 at Microsoft.Framework.PackageManager.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.TaskAwaiter1[Microsoft.Framework.PackageManager.GraphItem].GetResult () [0x00000] in 1[Microsoft.Framework.PackageManager.GraphNode].GetResult () [0x00000] in <filename unknown>:0 at Microsoft.Framework.PackageManager.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.TaskAwaiter1[Microsoft.Framework.PackageManager.GraphNode[]].GetResult () [0x00000] in
at Microsoft.Framework.PackageManager.RestoreCommand+d__61.MoveNext () [0x00000] in :0
Restore failed Could not find Zip file Directory at the end of the file. File may be corrupted.
like this: https://travis-ci.org/OmniSharp/omnisharp-roslyn/builds/50062373 similar problem
Might be a new mono bug. Can you repro this with any project?
I tried this with all examples of https://github.com/aspnet/Home#samples always the same error
All of the samples? Can you try to restore the helloweb sample?
I did it again, kpm restore in HelloWeb, now show this:
SharpCompress.Common.ArchiveException: Could not find Zip file Directory at the end of the file. File may be corrupted.
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.Framework.PackageManager.PackageUtilities+<OpenNuspecStreamFromNupkgAsync>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[System.IO.Stream].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.Restore.NuGet.NuGetv2Feed+<OpenNuspecStreamAsync>d__23.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.IO.Stream].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.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[System.Collections.Generic.IEnumerable`1[Microsoft.Framework.Runtime.LibraryDependency]].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.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[Microsoft.Framework.PackageManager.GraphItem].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.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[Microsoft.Framework.PackageManager.GraphNode].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.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[Microsoft.Framework.PackageManager.GraphNode].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.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[Microsoft.Framework.PackageManager.GraphNode].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.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[Microsoft.Framework.PackageManager.GraphItem].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.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[Microsoft.Framework.PackageManager.GraphNode].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.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[Microsoft.Framework.PackageManager.GraphItem].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.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[Microsoft.Framework.PackageManager.GraphNode].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.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[Microsoft.Framework.PackageManager.GraphNode].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.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[Microsoft.Framework.PackageManager.GraphItem].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.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[Microsoft.Framework.PackageManager.GraphNode].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.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[Microsoft.Framework.PackageManager.GraphNode].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.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[Microsoft.Framework.PackageManager.GraphItem].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.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[Microsoft.Framework.PackageManager.GraphNode].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.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[Microsoft.Framework.PackageManager.GraphNode].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.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[Microsoft.Framework.PackageManager.GraphNode].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.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[Microsoft.Framework.PackageManager.GraphNode].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.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[Microsoft.Framework.PackageManager.GraphItem].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.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[Microsoft.Framework.PackageManager.GraphNode].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.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[Microsoft.Framework.PackageManager.GraphNode].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.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[Microsoft.Framework.PackageManager.GraphNode].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.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[Microsoft.Framework.PackageManager.GraphItem].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.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[Microsoft.Framework.PackageManager.GraphNode].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.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[Microsoft.Framework.PackageManager.GraphNode].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.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[Microsoft.Framework.PackageManager.GraphNode[]].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.RestoreCommand+<RestoreForProject>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[System.Boolean].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.RestoreCommand+<ExecuteCommand>d__61.MoveNext () [0x00000] in <filename unknown>:0
----------
Restore failed
Could not find Zip file Directory at the end of the file. File may be corrupted.
Does it say which package is failing?
that's all it shows. put it in a gist everything that show but not say tha package that have the error. https://gist.github.com/Widrogo/5bf03ad8d9754187a3a7
Did you try clearing your cache? kpm restore --no-cahe
Yeah this work for HelloWeb, I try to do the same in my yo aspnet and have Error: DownloadPackageAsync: https://www.nuget.org/api/v2/package/Microsoft.CodeAnalysis.CSharp/1.0.0-rc1 I think this is not an error, it should only run the command again kpm restore --no-cahe?
the gist is all you showed me in HelloWeb and YoAspnet: https://gist.github.com/Widrogo/5bf03ad8d9754187a3a7
everything works good now thanks me for the help
May I ask how this problem was solved? It happened when I tried to host MusicStore app on Ubuntu. It also happened on my own app. Thanks in advance. :)
Also having this issue. Ran the kpm restore--no-cache command it didn't resolve it. It isn't clear how @Widrogo ultimately resolved it.
good the command 'kpm restore --no-cahe' didn't work me the first time I use a second time and downloaded everything correctly, nothing more. the truth I don't have a clear explanation to say what happened, just start to work.