sdk: Intermittent Workload CLI errors: 'Number of entries expected in End of Central Directory...'

We are seeing increasing reports of this particular error when running dotnet workload * commands from the CLI:

Workload installation failed: Number of entries expected in End Of Central Directory does not correspond to number of entries in Central Directory.

I’ve observed this using the NuGet Client API libraries myself with the CopyNupkgFileToAsync(..) method: https://github.com/Redth/dotnet-maui-check/blob/main/MauiCheck/AcquirePackagesCommand.cs#L196

It seems to be what’s happening is at some point the NuGet client is downloading to the cache and storing a corrupt .nupkg (zip) file. The problem is, once this is in the cache, it will not try and correct it by downloading it again.

This is really more of a NuGet client issue (I’ll file an issue there and link back here) but it does ultimately affect workload commands. Perhaps there could be something done to add retry logic or wipe the failed cache item when this is encountered to improve success?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 29 (27 by maintainers)

Most upvoted comments

NuGet has a code fix for this. Our next insertion into the .NET SDK (next week) will add it into .NET 7 and .NET 6.0.3xx daily builds.