chocolatey / chocolatey/choco

Forcing new version with meta-package doesn't uninstall cleanly

Open
#1,368 1 comment 0 reactions 0 assignees View on GitHub
0 - Backlog Bug Priority - High
Dominant language
C#
Stars
11.5k
Forks
960
PR merge metrics
No merged PRs in 30d

Description

(Initially raised in https://github.com/chocolatey/cChoco/issues/91)

Given a machine that had successfully ran:

cChocoPackageInstaller node {
Name = "nodejs"
Version = "8.1.0"
DependsOn = @("[cChocoInstaller]Chocolatey")
}

Then if that is updated to

cChocoPackageInstaller node {
Name = "nodejs"
Version = "8.2.1"
DependsOn = @("[cChocoInstaller]Chocolatey")
}

Then the old version is uninstalled and it appears to fail to handle the nodejs/nodejs.install combination (it prompts whether to uinstall nodejs.install but immediately continues assuming no response).

Here is the relevant extract from chocolatey.log

> 2017-07-24 23:30:32,447 5732 [INFO ] - Chocolatey v0.10.7
> 2017-07-24 23:30:32,824 5732 [INFO ] - Uninstalling the following packages:
> 2017-07-24 23:30:32,826 5732 [INFO ] - nodejs
> 2017-07-24 23:30:33,465 5732 [WARN ] - You are uninstalling nodejs, which is likely a metapackage for an
> *.install/*.portable package that it installed
> (nodejs represents discoverability).
> 2017-07-24 23:30:33,490 5732 [INFO ] - For the question below, you have 20 seconds to make a selection.
> 2017-07-24 23:30:33,491 5732 [INFO ] - Would you like to uninstall nodejs.install as well?
> 2017-07-24 23:30:33,491 5732 [INFO ] - 1) yes
> 2017-07-24 23:30:33,492 5732 [INFO ] - 2) no
> 2017-07-24 23:30:53,502 5732 [ERROR] - Timeout or your choice of '' is not a valid selection.
> 2017-07-24 23:30:57,561 5732 [INFO ] - [NuGet] Uninstalling 'nodejs 8.1.4'.
> 2017-07-24 23:30:57,568 5732 [INFO ] -
> nodejs v8.1.4
> 2017-07-24 23:30:57,598 5732 [INFO ] - Skipping auto uninstaller - No registry snapshot.
> 2017-07-24 23:30:57,707 5732 [INFO ] - [NuGet] Successfully uninstalled 'nodejs 8.1.4'.
> 2017-07-24 23:30:57,736 5732 [INFO ] - nodejs has been successfully uninstalled.
> 2017-07-24 23:30:57,795 5732 [WARN ] -
> Chocolatey uninstalled 1/2 packages.
> See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Everything ends up ok eventually as when the new version is installed then that results with nodejs and nodejs.install both being at 8.2.1

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the cChocoPackageInstaller upgrade from nodejs 8.1.0 to 8.2.1 and review the corresponding chocolatey.log output. Trace the uninstall handling for the nodejs/nodejs.install metapackage combination; done means the old packages are handled cleanly without the timed-out prompt and the upgrade completes consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.