praeclarum / FuGetGallery

An alternative web UI for browsing nuget packages
https://www.fuget.org
MIT License
683 stars 121 forks source link

Error reading package when there are only pre-release versions #131

Closed bgrainger closed 3 years ago

bgrainger commented 3 years ago

Open the fuget page for a package that only has pre-release versions:

You receive the following error:

Error reading package
System.IO.InvalidDataException: End of Central Directory record could not be found.
   at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory()
   at System.IO.Compression.ZipArchive.Init(Stream stream, ZipArchiveMode mode, Boolean leaveOpen)
   at System.IO.Compression.ZipArchive..ctor(Stream stream, ZipArchiveMode mode, Boolean leaveOpen, Encoding entryNameEncoding)
   at FuGetGallery.PackageData.Read(MemoryStream bytes, HttpClient httpClient) in D:\home\site\repository\Data\PackageData.cs:line 118
   at FuGetGallery.PackageData.PackageDataCache.<>c__DisplayClass2_0.<ReadPackageFromUrl>b__0() in D:\home\site\repository\Data\PackageData.cs:line 412
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.<>c.<.cctor>b__278_1(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
   at FuGetGallery.PackageData.PackageDataCache.ReadPackageFromUrl(PackageData package, HttpClient httpClient, CancellationToken token) in D:\home\site\repository\Data\PackageData.cs:line 412
   at FuGetGallery.PackageData.PackageDataCache.GetValueAsync(String arg0, PackageVersion arg1, HttpClient httpClient, CancellationToken token) in D:\home\site\repository\Data\PackageData.cs:line 385

The version badge also appears to be incorrect (it says v0) but that may be a side-effect of this bug.

image

bgrainger commented 3 years ago

This may be a duplicate of https://github.com/praeclarum/FuGetGallery/issues/118.