praeclarum / FuGetGallery

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

Error reading package #55

Open thomaslevesque opened 5 years ago

thomaslevesque commented 5 years ago

I tried to access the FuGet page for a new package before it was validated on the NuGet gallery. Understandably, it produced an 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 116 at FuGetGallery.PackageData.PackageDataCache.<>c__DisplayClass1_1.b0() in D:\home\site\repository\Data\PackageData.cs:line 379 at System.Threading.Tasks.Task.InnerInvoke() at System.Threading.Tasks.Task.<>c.<.cctor>b278_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.GetValueAsync(String arg0, PackageVersion arg1, HttpClient httpClient, CancellationToken token) in D:\home\site\repository\Data\PackageData.cs:line 379

But now the package is validated and indexed on NuGet, and I'm still seeing the same error... Could this be due to some kind of cache?

The package in question is https://www.nuget.org/packages/Hamlet/

thomaslevesque commented 5 years ago

It looks like the cache keeps the error and doesn't try again for another 365 days... Is there a way around this? (of course, since it's a memory cache, I guess it will be reset the next time you redeploy)

svick commented 5 years ago

I saw the same error on the System.Linq.Async package.

lachlanwgordon commented 4 years ago

Hi friends, Looks like I'm seeing the same issues with my new library SQLiteAppTools. It's been up on nuget for a couple of weeks now but I tried to look at in on FuGet immediately after publishing.

Did anyone find an issue other than waiting for 365 days/reset?

wcoder commented 3 years ago

The same error this Xamarin.CommunityToolkit 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
Screen Shot 2020-11-12 at 6 08 00 PM