FuGetGallery icon indicating copy to clipboard operation
FuGetGallery copied to clipboard

Error reading package

Open thomaslevesque opened this issue 6 years ago • 4 comments

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.<GetValueAsync>b__0() in D:\home\site\repository\Data\PackageData.cs:line 379 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.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 avatar Feb 11 '19 15:02 thomaslevesque

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)

thomaslevesque avatar Feb 11 '19 15:02 thomaslevesque

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

svick avatar Apr 03 '19 11:04 svick

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?

lachlanwgordon avatar Nov 07 '20 07:11 lachlanwgordon

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

wcoder avatar Nov 12 '20 15:11 wcoder