r/chocolatey•
mprz

Choco suddenly stopped working: Error: 'The file is not a valid nupkg'

Technical Issue

As of today choco completely refuses to do anything:

PS C:\ProgramData\Chocolatey\bin> choco upgrade all
Chocolatey v2.1.0
Upgrading the following packages:
all
By upgrading, you accept licenses for the packages.

Chocolatey upgraded 0/0 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
'C:\ProgramData\chocolatey\lib\virtualbox-guest-additions-guest.install\virtualbox-guest-additions-guest.install.nupkg' is not a valid nupkg file. Error: 'The file is not a valid nupkg. File path: C:\ProgramData\chocolatey\lib\virtualbox-guest-additions-guest.install\virtualbox-guest-additions-guest.install.nupkg'.
PS C:\ProgramData\Chocolatey\bin> choco export
Chocolatey v2.1.0
'C:\ProgramData\chocolatey\lib\virtualbox-guest-additions-guest.install\virtualbox-guest-additions-guest.install.nupkg' is not a valid nupkg file. Error: 'The file is not a valid nupkg. File path: C:\ProgramData\chocolatey\lib\virtualbox-guest-additions-guest.install\virtualbox-guest-additions-guest.install.nupkg'.
PS C:\ProgramData\Chocolatey\bin>

Deleting package manually doesn't help, next one pops up with the same message.

Log (C:\ProgramData\chocolatey\logs\chocolatey.log):

2023-07-23 14:05:45,336 8012 [DEBUG] - XmlConfiguration is now operational
2023-07-23 14:05:45,372 8012 [DEBUG] - Adding new type 'CygwinService' for type 'IAlternativeSourceRunner' from assembly 'choco'
2023-07-23 14:05:45,373 8012 [DEBUG] - Adding new type 'CygwinService' for type 'IInstallSourceRunner' from assembly 'choco'
2023-07-23 14:05:45,373 8012 [DEBUG] - Adding new type 'PythonService' for type 'IAlternativeSourceRunner' from assembly 'choco'
2023-07-23 14:05:45,374 8012 [DEBUG] - Adding new type 'PythonService' for type 'IListSourceRunner' from assembly 'choco'
2023-07-23 14:05:45,376 8012 [DEBUG] - Adding new type 'PythonService' for type 'IInstallSourceRunner' from assembly 'choco'
2023-07-23 14:05:45,376 8012 [DEBUG] - Adding new type 'PythonService' for type 'IUninstallSourceRunner' from assembly 'choco'
2023-07-23 14:05:45,376 8012 [DEBUG] - Adding new type 'RubyGemsService' for type 'IAlternativeSourceRunner' from assembly 'choco'
2023-07-23 14:05:45,377 8012 [DEBUG] - Adding new type 'RubyGemsService' for type 'IListSourceRunner' from assembly 'choco'
2023-07-23 14:05:45,377 8012 [DEBUG] - Adding new type 'RubyGemsService' for type 'IInstallSourceRunner' from assembly 'choco'
2023-07-23 14:05:45,378 8012 [DEBUG] - Adding new type 'SystemStateValidation' for type 'IValidation' from assembly 'choco'
2023-07-23 14:05:45,657 8012 [DEBUG] - Adding new type 'EmptyOrInvalidUrlMetadataRule' for type 'IMetadataRule' from assembly 'choco'
2023-07-23 14:05:45,657 8012 [DEBUG] - Adding new type 'FrameWorkReferencesMetadataRule' for type 'IMetadataRule' from assembly 'choco'
2023-07-23 14:05:45,658 8012 [DEBUG] - Adding new type 'IconMetadataRule' for type 'IMetadataRule' from assembly 'choco'
2023-07-23 14:05:45,658 8012 [DEBUG] - Adding new type 'LicenseMetadataRule' for type 'IMetadataRule' from assembly 'choco'
2023-07-23 14:05:45,659 8012 [DEBUG] - Adding new type 'PackageTypesMetadataRule' for type 'IMetadataRule' from assembly 'choco'
2023-07-23 14:05:45,659 8012 [DEBUG] - Adding new type 'ReadmeMetadataRule' for type 'IMetadataRule' from assembly 'choco'
2023-07-23 14:05:45,659 8012 [DEBUG] - Adding new type 'RepositoryMetadataRule' for type 'IMetadataRule' from assembly 'choco'
2023-07-23 14:05:45,660 8012 [DEBUG] - Adding new type 'RequireLicenseAcceptanceMetadataRule' for type 'IMetadataRule' from assembly 'choco'
2023-07-23 14:05:45,660 8012 [DEBUG] - Adding new type 'ServicableMetadataRule' for type 'IMetadataRule' from assembly 'choco'
2023-07-23 14:05:45,660 8012 [DEBUG] - Adding new type 'VersionMetadataRule' for type 'IMetadataRule' from assembly 'choco'
2023-07-23 14:05:45,666 8012 [DEBUG] - Registering new command 'cache' in assembly 'choco'
2023-07-23 14:05:45,667 8012 [DEBUG] - Registering new command 'list' in assembly 'choco'
2023-07-23 14:05:45,667 8012 [DEBUG] - Registering new command 'template' in assembly 'choco'
2023-07-23 14:05:45,668 8012 [DEBUG] - Registering new command 'export' in assembly 'choco'
2023-07-23 14:05:45,668 8012 [DEBUG] - Registering new command 'info' in assembly 'choco'
2023-07-23 14:05:45,668 8012 [DEBUG] - Registering new command 'help' in assembly 'choco'
2023-07-23 14:05:45,669 8012 [DEBUG] - Registering new command 'config' in assembly 'choco'
2023-07-23 14:05:45,669 8012 [DEBUG] - Registering new command 'feature' in assembly 'choco'
2023-07-23 14:05:45,670 8012 [DEBUG] - Registering new command 'new' in assembly 'choco'
2023-07-23 14:05:45,670 8012 [DEBUG] - Registering new command 'outdated' in assembly 'choco'
2023-07-23 14:05:45,670 8012 [DEBUG] - Registering new command 'pack' in assembly 'choco'
2023-07-23 14:05:45,672 8012 [DEBUG] - Registering new command 'pin' in assembly 'choco'
2023-07-23 14:05:45,672 8012 [DEBUG] - Registering new command 'push' in assembly 'choco'
2023-07-23 14:05:45,672 8012 [DEBUG] - Registering new command 'apikey' in assembly 'choco'
2023-07-23 14:05:45,672 8012 [DEBUG] - Registering new command 'source' in assembly 'choco'
2023-07-23 14:05:45,672 8012 [DEBUG] - Registering new command 'uninstall' in assembly 'choco'
2023-07-23 14:05:45,673 8012 [DEBUG] - Registering new command 'upgrade' in assembly 'choco'
2023-07-23 14:05:45,673 8012 [DEBUG] - Registering new command 'search' in assembly 'choco'
2023-07-23 14:05:45,674 8012 [DEBUG] - Registering new command 'unpackself' in assembly 'choco'
2023-07-23 14:05:45,674 8012 [DEBUG] - Registering new command 'install' in assembly 'choco'
2023-07-23 14:05:45,746 8012 [INFO ] - ============================================================
2023-07-23 14:05:46,064 8012 [INFO ] - Chocolatey v2.1.0
2023-07-23 14:05:46,069 8012 [DEBUG] - Chocolatey is running on Windows v 10.0.23506.0
2023-07-23 14:05:46,071 8012 [DEBUG] - Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
2023-07-23 14:05:46,071 8012 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
2023-07-23 14:05:46,076 8012 [DEBUG] - Command line: "C:\ProgramData\chocolatey\choco.exe" upgrade all
2023-07-23 14:05:46,077 8012 [DEBUG] - Received arguments: upgrade all
2023-07-23 14:05:46,108 8012 [DEBUG] - RemovePendingPackagesTask is now ready and waiting for PreRunMessage.
2023-07-23 14:05:46,114 8012 [DEBUG] - Sending message 'PreRunMessage' out if there are subscribers...
2023-07-23 14:05:46,118 8012 [DEBUG] - [Pending] Removing all pending packages that should not be considered installed...
2023-07-23 14:05:46,150 8012 [DEBUG] - Performing validation checks.
2023-07-23 14:05:46,152 8012 [DEBUG] - Global Configuration Validation Checks:
2023-07-23 14:05:46,153 8012 [DEBUG] -  - Package Exit Code / Exit On Reboot = Checked
2023-07-23 14:05:46,155 8012 [DEBUG] - System State Validation Checks:
2023-07-23 14:05:46,156 8012 [DEBUG] -  Reboot Requirement Checks:
2023-07-23 14:05:46,157 8012 [DEBUG] -  - Pending Computer Rename = Checked
2023-07-23 14:05:46,158 8012 [DEBUG] -  - Pending Component Based Servicing = Checked
2023-07-23 14:05:46,159 8012 [DEBUG] -  - Pending Windows Auto Update = Checked
2023-07-23 14:05:46,160 8012 [DEBUG] -  - Pending File Rename Operations = Ignored
2023-07-23 14:05:46,161 8012 [DEBUG] -  - Pending Windows Package Installer = Checked
2023-07-23 14:05:46,161 8012 [DEBUG] -  - Pending Windows Package Installer SysWow64 = Checked
2023-07-23 14:05:46,164 8012 [INFO ] - 2 validations performed. 2 success(es), 0 warning(s), and 0 error(s).
2023-07-23 14:05:46,173 8012 [DEBUG] - The source 'https://community.chocolatey.org/api/v2/' evaluated to a 'normal' source type
2023-07-23 14:05:46,174 8012 [DEBUG] - 
NOTE: Hiding sensitive configuration data! Please double and triple
 check to be sure no sensitive data is shown, especially if copying
 output to a gist for review.
2023-07-23 14:05:46,182 8012 [DEBUG] - Configuration: CommandName='upgrade'|
CacheLocation='C:\Users\Marcel\AppData\Local\Temp\chocolatey'|
CommandExecutionTimeoutSeconds='2700'|WebRequestTimeoutSeconds='30'|
Sources='https://community.chocolatey.org/api/v2/'|SourceType='normal'|
ShowOnlineHelp='False'|Debug='False'|Verbose='False'|Trace='False'|
Force='False'|Noop='False'|HelpRequested='False'|
UnsuccessfulParsing='False'|RegularOutput='True'|QuietOutput='False'|
PromptForConfirmation='False'|DisableCompatibilityChecks='False'|
AcceptLicense='False'|AllowUnofficialBuild='False'|Input='all'|
AllVersions='False'|SkipPackageInstallProvider='False'|
SkipHookScripts='False'|PackageNames='all'|Prerelease='False'|
ForceX86='False'|OverrideArguments='False'|NotSilent='False'|
ApplyPackageParametersToDependencies='False'|
ApplyInstallArgumentsToDependencies='False'|IgnoreDependencies='False'|
CacheExpirationInMinutes='30'|AllowDowngrade='False'|
ForceDependencies='False'|PinPackage='False'|
Information.PlatformType='Windows'|
Information.PlatformVersion='10.0.23506.0'|
Information.PlatformName='Windows 10'|
Information.ChocolateyVersion='2.1.0.0'|
Information.ChocolateyProductVersion='2.1.0'|
Information.FullName='choco, Version=2.1.0.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|

Information.Is64BitOperatingSystem='True'|
Information.Is64BitProcess='True'|Information.IsInteractive='True'|
Information.UserName='Marcel'|Information.UserDomainName='LOL'|
Information.IsUserAdministrator='True'|
Information.IsUserSystemAccount='False'|
Information.IsUserRemoteDesktop='False'|
Information.IsUserRemote='True'|
Information.IsProcessElevated='True'|
Information.IsLicensedVersion='False'|
Information.IsLicensedAssemblyLoaded='False'|
Information.LicenseType='Foss'|
Information.CurrentDirectory='C:\ProgramData\Chocolatey\bin'|
Features.AutoUninstaller='True'|Features.ChecksumFiles='True'|
Features.AllowEmptyChecksums='False'|
Features.AllowEmptyChecksumsSecure='True'|
Features.FailOnAutoUninstaller='False'|
Features.FailOnStandardError='False'|Features.UsePowerShellHost='True'|
Features.LogEnvironmentValues='False'|Features.LogWithoutColor='False'|
Features.VirusCheck='False'|
Features.FailOnInvalidOrMissingLicense='False'|
Features.IgnoreInvalidOptionsSwitches='True'|
Features.UsePackageExitCodes='True'|
Features.UseEnhancedExitCodes='False'|
Features.UseFipsCompliantChecksums='False'|
Features.ShowNonElevatedWarnings='True'|
Features.ShowDownloadProgress='True'|
Features.StopOnFirstPackageFailure='False'|
Features.UseRememberedArgumentsForUpgrades='False'|
Features.IgnoreUnfoundPackagesOnUpgradeOutdated='False'|
Features.SkipPackageUpgradesWhenNotInstalled='False'|
Features.RemovePackageInformationOnUninstall='False'|
Features.ExitOnRebootDetected='False'|
Features.LogValidationResultsOnWarnings='True'|
Features.UsePackageRepositoryOptimizations='True'|
ListCommand.LocalOnly='False'|ListCommand.IdOnly='False'|
ListCommand.IncludeRegistryPrograms='False'|ListCommand.PageSize='25'|
ListCommand.Exact='False'|ListCommand.ByIdOnly='False'|
ListCommand.ByTagOnly='False'|ListCommand.IdStartsWith='False'|
ListCommand.OrderByPopularity='False'|ListCommand.ApprovedOnly='False'|
ListCommand.DownloadCacheAvailable='False'|
ListCommand.NotBroken='False'|
ListCommand.IncludeVersionOverrides='False'|
ListCommand.ExplicitPageSize='False'|
ListCommand.ExplicitSource='False'|
UpgradeCommand.FailOnUnfound='False'|
UpgradeCommand.FailOnNotInstalled='False'|
UpgradeCommand.NotifyOnlyAvailableUpgrades='False'|
UpgradeCommand.ExcludePrerelease='False'|
NewCommand.AutomaticPackage='False'|
NewCommand.UseOriginalTemplate='False'|SourceCommand.Command='unknown'|
SourceCommand.Priority='0'|SourceCommand.BypassProxy='False'|
SourceCommand.AllowSelfService='False'|
SourceCommand.VisibleToAdminsOnly='False'|
FeatureCommand.Command='unknown'|ConfigCommand.Command='Unknown'|
ApiKeyCommand.Command='Unknown'|PinCommand.Command='Unknown'|
OutdatedCommand.IgnorePinned='False'|
ExportCommand.IncludeVersionNumbers='False'|Proxy.BypassOnLocal='True'|
TemplateCommand.Command='unknown'|CacheCommand.Command='Unknown'|
CacheCommand.RemoveExpiredItemsOnly='False'|
2023-07-23 14:05:46,182 8012 [DEBUG] - _ Chocolatey:ChocolateyUpgradeCommand - Normal Run Mode _
2023-07-23 14:05:46,186 8012 [INFO ] - Upgrading the following packages:
2023-07-23 14:05:46,187 8012 [INFO ] - all
2023-07-23 14:05:46,188 8012 [INFO ] - By upgrading, you accept licenses for the packages.
2023-07-23 14:05:46,298 8012 [DEBUG] - Running list with the following filter = ''
2023-07-23 14:05:46,299 8012 [DEBUG] - --- Start of List ---
2023-07-23 14:05:46,312 8012 [DEBUG] - Resolving resource PackageSearchResource for source C:\ProgramData\chocolatey\lib
2023-07-23 14:05:50,102 8012 [WARN ] - 
Chocolatey upgraded 0/0 packages. 
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2023-07-23 14:05:50,108 8012 [DEBUG] - Sending message 'PostRunMessage' out if there are subscribers...
2023-07-23 14:05:50,110 8012 [ERROR] - 'C:\ProgramData\chocolatey\lib\virtualbox-guest-additions-guest.install\virtualbox-guest-additions-guest.install.nupkg' is not a valid nupkg file. Error: 'The file is not a valid nupkg. File path: C:\ProgramData\chocolatey\lib\virtualbox-guest-additions-guest.install\virtualbox-guest-additions-guest.install.nupkg'.
2023-07-23 14:05:50,114 8012 [ERROR] - More Details: NuGet.Protocol.Core.Types.FatalProtocolException: 'C:\ProgramData\chocolatey\lib\virtualbox-guest-additions-guest.install\virtualbox-guest-additions-guest.install.nupkg' is not a valid nupkg file. Error: 'The file is not a valid nupkg. File path: C:\ProgramData\chocolatey\lib\virtualbox-guest-additions-guest.install\virtualbox-guest-additions-guest.install.nupkg'. ---> System.IO.InvalidDataException: The file is not a valid nupkg. File path: C:\ProgramData\chocolatey\lib\virtualbox-guest-additions-guest.install\virtualbox-guest-additions-guest.install.nupkg ---> 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 NuGet.Packaging.PackageArchiveReader..ctor(String filePath, IFrameworkNameProvider frameworkProvider, IFrameworkCompatibilityProvider compatibilityProvider)
   --- End of inner exception stack trace ---
   at NuGet.Packaging.PackageArchiveReader..ctor(String filePath, IFrameworkNameProvider frameworkProvider, IFrameworkCompatibilityProvider compatibilityProvider)
   at NuGet.Protocol.LocalFolderUtility.GetPackageFromNupkg(FileInfo nupkgFile)
   --- End of inner exception stack trace ---
   at NuGet.Protocol.LocalFolderUtility.GetPackageFromNupkg(FileInfo nupkgFile)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at NuGet.Protocol.LocalFolderUtility.<GetDistinctPackages>d__39.MoveNext()
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__1.MoveNext()
   at NuGet.Protocol.LocalPackageSearchResource.<CollapseToHighestVersion>d__9.MoveNext()
   at System.Linq.Enumerable.<SkipIterator>d__31`1.MoveNext()
   at System.Linq.Enumerable.<TakeIterator>d__25`1.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at NuGet.Protocol.LocalPackageSearchResource.<>c__DisplayClass3_0.<SearchAsync>b__0()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.Protocol.LocalPackageSearchResource.<SearchAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at chocolatey.infrastructure.app.nuget.NugetList.<SearchPackagesAsync>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at chocolatey.infrastructure.app.nuget.NugetList.GetPackages(ChocolateyConfiguration configuration, ILogger nugetLogger, IFileSystem filesystem)
   at chocolatey.infrastructure.app.services.NugetService.<List>d__15.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at chocolatey.infrastructure.app.services.NugetService.GetInstalledPackages(ChocolateyConfiguration config)
   at chocolatey.infrastructure.app.services.NugetService.SetPackageNamesIfAllSpecified(ChocolateyConfiguration config, Action customAction)
   at chocolatey.infrastructure.app.services.NugetService.Upgrade(ChocolateyConfiguration config, Action`2 continueAction, Boolean performAction, Action`2 beforeUpgradeAction)
   at chocolatey.infrastructure.app.services.NugetService.Upgrade(ChocolateyConfiguration config, Action`2 continueAction, Action`2 beforeUpgradeAction)
   at chocolatey.infrastructure.app.services.ChocolateyPackageService.Upgrade(ChocolateyConfiguration config)
   at chocolatey.infrastructure.app.runners.GenericRunner.Run(ChocolateyConfiguration config, Container container, Boolean isConsole, Action`1 parseArgs)
   at chocolatey.infrastructure.app.runners.ConsoleApplication.Run(String[] args, ChocolateyConfiguration config, Container container)
   at chocolatey.console.Program.Main(String[] args)
2023-07-23 14:05:50,114 8012 [DEBUG] - Exiting with 1

Can't export packages using choco, anyone seen this before?

Posted Jul 23, 2023, 1:07 PM UTC

14
Loading comments…