Package upgrade fails with strange error message
- Dominant language
- C#
- Stars
- 11.5k
- Forks
- 960
- PR merge metrics
- No merged PRs in 30d
Description
I have an issue of the type [Already referencing a newer version of 'packagename'](https://chocolatey.org/docs/troubleshooting#already-referencing-a-newer-version-of-packagename). I know that this seems to be somewhat common; I saw that there is a section on this on the Troubleshooting page and that a few issues involving this error message have been filed on this already.
I am filing a new issue for two reasons:
- I followed the instructions on the Troubleshooting page but stray nupkg files do not seem to be the underlying problem in my case (there are no stray nupkg files).
- The issue can be reproduced 100% with only a few steps and using only two major, official packages, which should make it simple to debug and probably a good test case as well.
### What You Are Seeing?
```
Chocolatey v0.10.15
Upgrading the following packages:
gitextensions
By upgrading you accept licenses for the packages.
You have gitextensions v3.3.1.20200120 installed. Version 3.4.2 is available based on your source(s).
gitextensions not upgraded. An error occurred during installation:
Already referencing a newer version of 'chocolatey-core.extension'.
gitextensions package files upgrade completed. Performing other installation steps.
The upgrade of gitextensions was NOT successful.
gitextensions not upgraded. An error occurred during installation:
Already referencing a newer version of 'chocolatey-core.extension'.
Chocolatey upgraded 0/1 packages. 1 packages failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Failures
- gitextensions (exited 1) - gitextensions not upgraded. An error occurred during installation:
Already referencing a newer version of 'chocolatey-core.extension'.
```
### What is Expected?
There should be no errors and gitextensions should be upgraded.
### How Did You Get This To Happen?
Environment: Windows10, Chocolatey v0.10.15
Steps to reproduce:
1. choco install chocolatey-core.extension --version 1.3.3 -my
2. choco install gitextensions --version 3.3.1.20200120 -y
3. choco install chocolatey-core.extension --version 1.3.5.1 -my
4. choco upgrade gitextensions --version 3.4.2 -y
### Output Log
Full Log Output
~~~sh
2020-10-21 12:03:53,688 14892 [DEBUG] - XmlConfiguration is now operational
2020-10-21 12:03:53,745 14892 [INFO ] - ============================================================
2020-10-21 12:03:54,382 14892 [INFO ] - Chocolatey v0.10.15
2020-10-21 12:03:54,395 14892 [DEBUG] - Chocolatey is running on Windows v 10.0.18363.0
2020-10-21 12:03:54,401 14892 [DEBUG] - Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
2020-10-21 12:03:54,404 14892 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
2020-10-21 12:03:54,421 14892 [DEBUG] - Command line: "C:\ProgramData\chocolatey\choco.exe" upgrade gitextensions --version 3.4.2 -y --debug --verbose
2020-10-21 12:03:54,427 14892 [DEBUG] - Received arguments: upgrade gitextensions --version 3.4.2 -y --debug --verbose
2020-10-21 12:03:54,485 14892 [DEBUG] - RemovePendingPackagesTask is now ready and waiting for PreRunMessage.
2020-10-21 12:03:54,499 14892 [DEBUG] - Sending message 'PreRunMessage' out if there are subscribers...
2020-10-21 12:03:54,509 14892 [DEBUG] - [Pending] Removing all pending packages that should not be considered installed...
2020-10-21 12:03:54,577 14892 [DEBUG] - Performing validation checks.
2020-10-21 12:03:54,588 14892 [DEBUG] - Global Configuration Validation Checks:
2020-10-21 12:03:54,592 14892 [DEBUG] - - Package Exit Code / Exit On Reboot = Checked
2020-10-21 12:03:54,596 14892 [DEBUG] - System State Validation Checks:
2020-10-21 12:03:54,602 14892 [DEBUG] - Reboot Requirement Checks:
2020-10-21 12:03:54,609 14892 [DEBUG] - - Pending Computer Rename = Checked
2020-10-21 12:03:54,615 14892 [DEBUG] - - Pending Component Based Servicing = Checked
2020-10-21 12:03:54,620 14892 [DEBUG] - - Pending Windows Auto Update = Checked
2020-10-21 12:03:54,625 14892 [DEBUG] - - Pending File Rename Operations = Ignored
2020-10-21 12:03:54,631 14892 [DEBUG] - - Pending Windows Package Installer = Checked
2020-10-21 12:03:54,636 14892 [DEBUG] - - Pending Windows Package Installer SysWow64 = Checked
2020-10-21 12:03:54,643 14892 [INFO ] - 2 validations performed. 2 success(es), 0 warning(s), and 0 error(s).
2020-10-21 12:03:54,648 14892 [DEBUG] - The source 'https://chocolatey.org/api/v2/' evaluated to a 'normal' source type
2020-10-21 12:03:54,654 14892 [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.
2020-10-21 12:03:54,674 14892 [DEBUG] - Configuration: CommandName='upgrade'|
CacheLocation='C:\Users\Daniel\AppData\Local\Temp\chocolatey'|
ContainsLegacyPackageInstalls='True'|
CommandExecutionTimeoutSeconds='2700'|WebRequestTimeoutSeconds='30'|
Sources='https://chocolatey.org/api/v2/'|SourceType='normal'|
Debug='True'|Verbose='True'|Trace='False'|Force='False'|Noop='False'|
HelpRequested='False'|UnsuccessfulParsing='False'|RegularOutput='True'|
QuietOutput='False'|PromptForConfirmation='False'|AcceptLicense='True'|
AllowUnofficialBuild='False'|Input='gitextensions'|Version='3.4.2'|
AllVersions='False'|SkipPackageInstallProvider='False'|
PackageNames='gitextensions'|Prerelease='False'|ForceX86='False'|
OverrideArguments='False'|NotSilent='False'|
ApplyPackageParametersToDependencies='False'|
ApplyInstallArgumentsToDependencies='False'|IgnoreDependencies='False'|
AllowMultipleVersions='False'|AllowDowngrade='False'|
ForceDependencies='False'|Information.PlatformType='Windows'|
Information.PlatformVersion='10.0.18363.0'|
Information.PlatformName='Windows 10'|
Information.ChocolateyVersion='0.10.15.0'|
Information.ChocolateyProductVersion='0.10.15'|
Information.FullName='choco, Version=0.10.15.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|
Information.Is64BitOperatingSystem='True'|
Information.Is64BitProcess='True'|Information.IsInteractive='True'|
Information.UserName='Daniel'|
Information.IsUserAdministrator='True'|
Information.IsUserSystemAccount='False'|
Information.IsUserRemoteDesktop='False'|
Information.IsUserRemote='True'|
Information.IsProcessElevated='True'|
Information.IsLicensedVersion='False'|Information.LicenseType='Foss'|
Information.CurrentDirectory='C:\Windows\system32'|
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'|
Features.ScriptsCheckLastExitCode='False'|
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'|
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.Remove='False'|PinCommand.Command='unknown'|
OutdatedCommand.IgnorePinned='False'|Proxy.BypassOnLocal='True'|
2020-10-21 12:03:54,725 14892 [DEBUG] - _ Chocolatey:ChocolateyUpgradeCommand - Normal Run Mode _
2020-10-21 12:03:54,740 14892 [INFO ] - Upgrading the following packages:
2020-10-21 12:03:54,745 14892 [INFO ] - gitextensions
2020-10-21 12:03:54,752 14892 [INFO ] - By upgrading you accept licenses for the packages.
2020-10-21 12:03:55,811 14892 [WARN ] -
You have gitextensions v3.3.1.20200120 installed. Version 3.4.2 is available based on your source(s).
2020-10-21 12:03:55,941 14892 [DEBUG] - Backing up existing gitextensions prior to operation.
2020-10-21 12:03:55,951 14892 [DEBUG] - Moving 'C:\ProgramData\chocolatey\lib\gitextensions'
to 'C:\ProgramData\chocolatey\lib-bkp\gitextensions'
2020-10-21 12:03:57,961 14892 [DEBUG] - Attempting to create directory "C:\ProgramData\chocolatey\lib\gitextensions".
2020-10-21 12:03:57,983 14892 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\gitextensions\gitextensions.nupkg"
to "C:\ProgramData\chocolatey\lib\gitextensions\gitextensions.nupkg".
2020-10-21 12:03:58,022 14892 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\gitextensions\gitextensions.nuspec"
to "C:\ProgramData\chocolatey\lib\gitextensions\gitextensions.nuspec".
2020-10-21 12:03:58,031 14892 [DEBUG] - Attempting to create directory "C:\ProgramData\chocolatey\lib\gitextensions\legal".
2020-10-21 12:03:58,038 14892 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\gitextensions\legal\LICENSE.md"
to "C:\ProgramData\chocolatey\lib\gitextensions\legal\LICENSE.md".
2020-10-21 12:03:58,046 14892 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\gitextensions\legal\VERIFICATION.txt"
to "C:\ProgramData\chocolatey\lib\gitextensions\legal\VERIFICATION.txt".
2020-10-21 12:03:58,054 14892 [DEBUG] - Attempting to create directory "C:\ProgramData\chocolatey\lib\gitextensions\tools".
2020-10-21 12:03:58,060 14892 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\gitextensions\tools\chocolateyInstall.ps1"
to "C:\ProgramData\chocolatey\lib\gitextensions\tools\chocolateyInstall.ps1".
2020-10-21 12:03:58,068 14892 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\gitextensions\tools\chocolateyUninstall.ps1"
to "C:\ProgramData\chocolatey\lib\gitextensions\tools\chocolateyUninstall.ps1".
2020-10-21 12:03:58,075 14892 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\gitextensions\tools\GitExtensions-3.3.1.7897.msi"
to "C:\ProgramData\chocolatey\lib\gitextensions\tools\GitExtensions-3.3.1.7897.msi".
2020-10-21 12:03:58,100 14892 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\gitextensions\tools\GitExtensions-3.3.1.7897.msi.ignore"
to "C:\ProgramData\chocolatey\lib\gitextensions\tools\GitExtensions-3.3.1.7897.msi.ignore".
2020-10-21 12:03:59,613 14892 [DEBUG] - Deleting file C:\ProgramData\chocolatey\lib\gitextensions\tools\chocolateyInstall.ps1
2020-10-21 12:03:59,621 14892 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\gitextensions\tools\chocolateyInstall.ps1".
2020-10-21 12:03:59,629 14892 [DEBUG] - Deleting file C:\ProgramData\chocolatey\lib\gitextensions\tools\chocolateyUninstall.ps1
2020-10-21 12:03:59,637 14892 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\gitextensions\tools\chocolateyUninstall.ps1".
2020-10-21 12:03:59,658 14892 [DEBUG] - Capturing package files in 'C:\ProgramData\chocolatey\lib\gitextensions'
2020-10-21 12:03:59,745 14892 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\gitextensions\gitextensions.nupkg'
with checksum '6E2FF40B5B2AC37B2B8B51D581FD65CC'
2020-10-21 12:03:59,752 14892 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\gitextensions\gitextensions.nuspec'
with checksum '432FB319FB59F27FE05B60FE8F1BCB0E'
2020-10-21 12:03:59,756 14892 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\gitextensions\legal\LICENSE.md'
with checksum 'C65BD98A28A1650EA6C957EE51B1A341'
2020-10-21 12:03:59,760 14892 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\gitextensions\legal\VERIFICATION.txt'
with checksum '0F136D5C5ABF62C8E1D34CA04A21C9A3'
2020-10-21 12:03:59,828 14892 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\gitextensions\tools\GitExtensions-3.3.1.7897.msi'
with checksum '922A0ABF0413414480D2E622FFFCB48F'
2020-10-21 12:03:59,836 14892 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\gitextensions\tools\GitExtensions-3.3.1.7897.msi.ignore'
with checksum 'BEA07E6D2B8DCE396FE21BAA61B34956'
2020-10-21 12:03:59,842 14892 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\gitextensions\tools\GitExtensions-3.3.1.7897.msi.ignore".
2020-10-21 12:04:02,541 14892 [INFO ] - [NuGet] Attempting to resolve dependency 'git (= 2.17.1.2)'.
2020-10-21 12:04:02,560 14892 [INFO ] - [NuGet] Attempting to resolve dependency 'git.install (= 2.29.0)'.
2020-10-21 12:04:02,572 14892 [INFO ] - [NuGet] Attempting to resolve dependency 'chocolatey-core.extension (= 1.3.3)'.
2020-10-21 12:04:02,587 14892 [ERROR] - gitextensions not upgraded. An error occurred during installation:
Already referencing a newer version of 'chocolatey-core.extension'.
2020-10-21 12:04:02,602 14892 [INFO ] - gitextensions package files upgrade completed. Performing other installation steps.
2020-10-21 12:04:02,621 14892 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\gitextensions.3.4.2\.arguments".
2020-10-21 12:04:02,625 14892 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\gitextensions.3.4.2\.extra".
2020-10-21 12:04:02,628 14892 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\gitextensions.3.4.2\.version".
2020-10-21 12:04:02,632 14892 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\gitextensions.3.4.2\.sxs".
2020-10-21 12:04:02,636 14892 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\gitextensions.3.4.2\.pin".
2020-10-21 12:04:02,647 14892 [DEBUG] - Attempting to delete directory "C:\ProgramData\chocolatey\lib-bad\gitextensions".
2020-10-21 12:04:02,661 14892 [DEBUG] - Sending message 'HandlePackageResultCompletedMessage' out if there are subscribers...
2020-10-21 12:04:02,669 14892 [ERROR] - The upgrade of gitextensions was NOT successful.
2020-10-21 12:04:02,674 14892 [ERROR] - gitextensions not upgraded. An error occurred during installation:
Already referencing a newer version of 'chocolatey-core.extension'.
2020-10-21 12:04:02,679 14892 [DEBUG] - Moving 'C:\ProgramData\chocolatey\lib\gitextensions'
to 'C:\ProgramData\chocolatey\lib-bad\gitextensions'
2020-10-21 12:04:04,689 14892 [DEBUG] - Attempting rollback
2020-10-21 12:04:04,704 14892 [DEBUG] - Moving 'C:\ProgramData\chocolatey\lib-bkp\gitextensions'
to 'C:\ProgramData\chocolatey\lib\gitextensions'
2020-10-21 12:04:06,737 14892 [WARN ] -
Chocolatey upgraded 0/1 packages. 1 packages failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2020-10-21 12:04:06,743 14892 [INFO ] -
2020-10-21 12:04:06,749 14892 [ERROR] - Failures
2020-10-21 12:04:06,754 14892 [ERROR] - - gitextensions (exited 1) - gitextensions not upgraded. An error occurred during installation:
Already referencing a newer version of 'chocolatey-core.extension'.
2020-10-21 12:04:06,760 14892 [WARN ] -
Did you know the proceeds of Pro (and some proceeds from other
licensed editions) go into bettering the community infrastructure?
Your support ensures an active community, keeps Chocolatey tip top,
plus it nets you some awesome features!
https://chocolatey.org/compare
2020-10-21 12:04:06,769 14892 [DEBUG] - Sending message 'PostRunMessage' out if there are subscribers...
2020-10-21 12:04:06,983 14892 [DEBUG] - Exiting with 1
~~~
Contributor guide
Research direction
Reproduce the failure on Windows 10 with Chocolatey v0.10.15 using the four listed choco install and upgrade commands, then inspect the verbose chocolatey.log output. Trace how the upgrade handles the existing chocolatey-core.extension versions; done means gitextensions 3.4.2 upgrades successfully without the “Already referencing a newer version” error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100