Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent dependency resolution from unexpectedly downgrading packages #3461

Closed
6 tasks done
Terrance opened this issue Jun 8, 2024 · 4 comments · Fixed by #3486
Closed
6 tasks done

Prevent dependency resolution from unexpectedly downgrading packages #3461

Terrance opened this issue Jun 8, 2024 · 4 comments · Fixed by #3486
Assignees
Milestone

Comments

@Terrance
Copy link

Terrance commented Jun 8, 2024

Checklist

  • I confirm there are no unresolved issues reported on the Chocolatey Status page.
  • I have verified this is the correct repository for opening this issue.
  • I have verified no other issues exist related to my problem.
  • I have verified this is not an issue for a specific package.
  • I have verified this issue is not security related.
  • I confirm I am using official, and not unofficial, or modified, Chocolatey products.

What You Are Seeing?

The latest version of vscode.install is 1.90.0, but vscode is still on 1.89.1 as the 1.90.0 release is still in moderation. This seems to cause weird behaviour when upgrading, as 1.89.1 is installed first, then 1.90.0 is attempted and fails, and at that point 1.89.0 rather than 1.89.1 is chosen instead. This means I was actually downgraded as a result of the "upgrade", having originally started on 1.89.1.

What is Expected?

I should be kept on version 1.89.1 as the latest release with matching meta/install packages.

How Did You Get This To Happen?

choco upgrade all, having started on vscode 1.89.1 and vscode.install 1.89.1, resulted in vscode 1.89.0 and vscode.install 1.89.0. Subsequent upgrade attempts stay at these version.

System Details

  • Operating System: 10.0.19045.0
  • Windows PowerShell version: 5.1.19041.4412
  • Chocolatey CLI Version: 2.3.0
  • Chocolatey Licensed Extension version: n/a
  • Chocolatey License type: n/a
  • Terminal/Emulator: PowerShell

Installed Packages

chocolatey 2.3.0
chocolatey-compatibility.extension 1.0.0
chocolatey-core.extension 1.4.0
chocolatey-dotnetfx.extension 1.0.1
chocolatey-font-helpers.extension 0.0.4
chocolatey-misc-helpers.extension 0.0.4
chocolatey-os-dependency.extension 0.0.1
chocolatey-windowsupdate.extension 1.0.5
vscode 1.89.0
vscode.install 1.89.0

Output Log

https://gist.github.com/Terrance/751c1aa8dcf107e2a0e20aaa33519324

Additional Context

There seems to be two issues here: the packages themselves being mismatched, but also the downgrade from the latest meta package (for which the install package is available) to the one before.

@Terrance Terrance added the Bug label Jun 8, 2024
@Outek
Copy link

Outek commented Jun 18, 2024

I have the same bug on servers with a newly upgraded chocolatey client.

# Choco Search cannot find the newest version
PS D:\> choco search vscode
Chocolatey v2.3.0
vscode 1.86.2
1 packages found.

# Pre Package found
PS D:\> choco search vscode -pre
Chocolatey v2.3.0
vscode 1.90.0

# Choco search
PS D:\> choco search vscode -all
Chocolatey v2.3.0
vscode 1.90.0
vscode 1.89.1
vscode 1.89.0
vscode 1.88.1
vscode 1.88.0
vscode 1.87.2
vscode 1.87.0
vscode 1.86.2
vscode 1.86.1
vscode 1.86.0
vscode 1.85.2
vscode 1.85.1
vscode 1.85.0
vscode 1.84.2
vscode 1.84.0
vscode 1.83.1
vscode 1.83.0
vscode 1.81.1
vscode 1.81.0
vscode 1.80.2
vscode 1.80.1
vscode 1.80.0
vscode 1.79.2
vscode 1.79.0
vscode 1.78.2
vscode 1.78.0
vscode 1.77.3
vscode 1.77.1
vscode 1.77.0
vscode 1.76.2
vscode 1.76.1
vscode 1.76.0
vscode 1.75.1
vscode 1.75.0
vscode 1.74.3
vscode 1.73.1

@corbob
Copy link
Member

corbob commented Jul 11, 2024

So, it looks like there are a few things going on here, and I'm going to see if I can lay them out before asking for some more files.

@Terrance, in looking at the logs, it looks like you actually started at 1.89.0 of both vscode and vscode.install. It then detected 1.89.1 of vscode, and installed that version for both vscode and vscode.install. It then went looking for an upgrade to vscode.install, and noted that it had an upgrade. It then determined that the dependency resolution for vscode couldn't be resolved for 1.90.0, so it asked Chocolatey Community Repository for the verisons of vscode that were available. For whatever reason, Chocolatey Community Repository or Chocolatey CLI did not provide back 1.89.1 as an available version, so Chocolatey CLI determined that it needed to install version 1.89.0, and it ensured both vscode and vscode.install were available at that version, and installed it. This is not the expected behaviour for any part of this.

I am able to readily reproduce the behaviour where an install that resolves a dependency to a downgrade version will downgrade to that version, which it should not do. The part I'm not able to readily reproduce is where it seems that Chocolatey Community Repository is providing different results. This part feels like a caching issue, and may be unable to be reproduced at the moment, but if we could try:

Going off of the output that @Outek provided which appears to possibly show the discrepency in what's reported, could you run the following commands as administrator (this will rule out any user vs system ChocolateyHttpCache differences and create a zip file of the contents of C:\ProgramData\ChocolateyHttpCache for each search command? You may want to inspect the contents of the ChocolateyHttpCache directory before providing it as it may contain sensitive information.

choco cache remove
choco search vscode --exact
choco cache remove
choco search vscode --exact --pre
choco cache remove
choco search vscode --exact --all

Hoping that there is an output of different versions that could help us identify the source of the issue.

@Terrance
Copy link
Author

Yes, I believe I originally started at 1.89.0, but the downgrade was more readily reproducible at the time by forcing an install of 1.89.1 first, then requesting an upgrade (which would result in a downgrade to 1.89.0).

I suspect it may be too late to get some meaningful output (I have since updated to 1.91.0 which is the current stable version, and there are no pending releases in Chocolatey), but here you go:

choco search --exact
PS C:\Users\User> choco cache remove
Chocolatey v2.3.0
Cache cleanup
Removed 905 cached items in 'C:\ProgramData\ChocolateyHttpCache'.
Directory 'C:\Users\User\.chocolatey\http-cache' does not exist.
No cached items available to be removed in 'C:\Users\User\.chocolatey\http-cache'.
PS C:\Users\User> choco search vscode --exact
Chocolatey v2.3.0
vscode 1.91.0 [Approved]
1 packages found.

Did you know Pro / Business automatically syncs with Programs and
 Features? Learn more about Package Synchronizer at
 https://chocolatey.org/compare
PS C:\Users\User> choco cache
Chocolatey v2.3.0
System HTTP Cache
We found 1 cached sources.
We found 2 cached items for all sources, where 0 items have expired.

User HTTP Cache
Directory 'C:\Users\User\.chocolatey\http-cache' does not exist.
We found 0 cached sources.
We found 0 cached items for all sources, where 0 items have expired.

📎 ChocolateyHttpCache.zip

choco search --exact --pre
PS C:\Users\User> choco cache remove
Chocolatey v2.3.0
Cache cleanup
Removed 2 cached items in 'C:\ProgramData\ChocolateyHttpCache'.
Directory 'C:\Users\User\.chocolatey\http-cache' does not exist.
No cached items available to be removed in 'C:\Users\User\.chocolatey\http-cache'.
PS C:\Users\User> choco search vscode --exact --pre
Chocolatey v2.3.0
vscode 1.91.0 [Approved]
1 packages found.
PS C:\Users\User> choco cache
Chocolatey v2.3.0
System HTTP Cache
We found 1 cached sources.
We found 2 cached items for all sources, where 0 items have expired.

User HTTP Cache
Directory 'C:\Users\User\.chocolatey\http-cache' does not exist.
We found 0 cached sources.
We found 0 cached items for all sources, where 0 items have expired.

📎 ChocolateyHttpCache-pre.zip

choco search --exact --all
PS C:\Users\User> choco cache remove
Chocolatey v2.3.0
Cache cleanup
Removed 2 cached items in 'C:\ProgramData\ChocolateyHttpCache'.
Directory 'C:\Users\User\.chocolatey\http-cache' does not exist.
No cached items available to be removed in 'C:\Users\User\.chocolatey\http-cache'.
PS C:\Users\User> choco search vscode --exact --all
Chocolatey v2.3.0
vscode 1.91.0 [Approved]
vscode 1.90.2 [Approved]
vscode 1.90.1 [Approved]
vscode 1.90.0 [Approved]
vscode 1.89.1 [Approved]
vscode 1.89.0 [Approved]
vscode 1.88.1 [Approved]
vscode 1.88.0 [Approved]
vscode 1.87.2 [Approved]
vscode 1.87.1 [Approved]
vscode 1.87.0 [Approved]
vscode 1.86.2 [Approved]
vscode 1.86.1 [Approved]
vscode 1.86.0 [Approved]
vscode 1.85.2 [Approved]
vscode 1.85.1 [Approved]
vscode 1.85.0 [Approved]
vscode 1.84.2 [Approved]
vscode 1.84.1 [Approved]
vscode 1.83.1 [Approved]
vscode 1.83.0 [Approved]
vscode 1.82.3 [Approved]
vscode 1.82.2 [Approved]
vscode 1.82.1 [Approved]
vscode 1.82.0 [Approved]
vscode 1.81.1 [Approved]
vscode 1.80.1 [Approved]
vscode 1.79.2 [Approved]
vscode 1.79.1 [Approved]
vscode 1.79.0 [Approved]
vscode 1.78.2 [Approved]
vscode 1.78.1 [Approved]
vscode 1.78.0 [Approved]
vscode 1.77.3 [Approved]
vscode 1.77.2 [Approved]
vscode 1.77.1 [Approved]
vscode 1.77.0 [Approved]
vscode 1.76.2 [Approved]
vscode 1.76.1 [Approved]
vscode 1.76.0 [Approved]
vscode 1.75.1 [Approved]
vscode 1.75.0 [Approved]
vscode 1.74.3 [Approved]
vscode 1.74.2 [Approved]
vscode 1.74.1 [Approved]
vscode 1.74.0 [Approved]
vscode 1.73.1 [Approved]
vscode 1.73.0 [Approved]
vscode 1.72.2 [Approved]
vscode 1.72.1 [Approved]
vscode 1.72.0 [Approved]
vscode 1.71.2 [Approved]
vscode 1.71.1 [Approved]
vscode 1.71.0 [Approved]
vscode 1.70.2 [Approved]
vscode 1.70.1 [Approved]
vscode 1.70.0 [Approved]
vscode 1.69.2 [Approved]
vscode 1.69.1 [Approved]
vscode 1.69.0 [Approved]
vscode 1.68.1 [Approved]
vscode 1.68.0 [Approved]
vscode 1.67.2 [Approved]
vscode 1.67.1 [Approved]
vscode 1.67.0 [Approved]
vscode 1.66.2 [Approved]
vscode 1.66.1 [Approved]
vscode 1.66.0 [Approved]
vscode 1.65.2 [Approved]
vscode 1.65.1 [Approved]
vscode 1.65.0 [Approved]
vscode 1.64.2 [Approved]
vscode 1.64.1 [Approved]
vscode 1.64.0 [Approved]
vscode 1.63.2 [Approved]
vscode 1.63.1 [Approved]
vscode 1.63.0 [Approved]
vscode 1.62.3 [Approved]
vscode 1.62.2 [Approved]
vscode 1.62.1 [Approved]
vscode 1.62.0 [Approved]
vscode 1.61.2 [Approved]
vscode 1.61.1 [Approved]
vscode 1.61.0 [Approved]
vscode 1.60.2 [Approved]
vscode 1.60.1 [Approved]
vscode 1.60.0 [Approved]
vscode 1.59.1 [Approved]
vscode 1.59.0 [Approved]
vscode 1.58.2 [Approved]
vscode 1.58.1 [Approved]
vscode 1.58.0 [Approved]
vscode 1.57.1 [Approved]
vscode 1.57.0 [Approved]
vscode 1.56.2 [Approved]
vscode 1.56.1 [Approved]
vscode 1.56.0 [Approved]
vscode 1.55.2 [Approved]
vscode 1.55.1 [Approved]
vscode 1.55.0 [Approved]
vscode 1.54.3 [Approved]
vscode 1.54.2 [Approved]
vscode 1.54.1 [Approved]
vscode 1.54.0 [Approved]
vscode 1.53.2 [Approved]
vscode 1.53.1 [Approved]
vscode 1.53.0 [Approved]
vscode 1.52.1 [Approved]
vscode 1.52.0 [Approved]
vscode 1.51.1 [Approved]
vscode 1.51.0 [Approved]
vscode 1.50.1 [Approved]
vscode 1.50.0 [Approved]
vscode 1.49.3 [Approved]
vscode 1.49.2 [Approved]
vscode 1.49.1 [Approved]
vscode 1.49.0 [Approved]
vscode 1.48.2 [Approved]
vscode 1.48.1 [Approved]
vscode 1.48.0 [Approved]
vscode 1.47.3 [Approved]
vscode 1.47.2 [Approved]
vscode 1.47.0 [Approved]
vscode 1.46.1 [Approved]
vscode 1.46.0 [Approved]
vscode 1.45.1 [Approved]
vscode 1.45.0 [Approved]
vscode 1.44.2 [Approved]
vscode 1.44.1 [Approved]
vscode 1.44.0 [Approved]
vscode 1.43.2 [Approved]
vscode 1.43.1 [Approved]
vscode 1.43.0 [Approved]
vscode 1.42.1 [Approved]
vscode 1.42.0 [Approved]
vscode 1.41.1 [Approved]
vscode 1.41.0 [Approved]
vscode 1.40.2 [Approved]
vscode 1.40.1 [Approved]
vscode 1.40.0 [Approved]
vscode 1.39.2 [Approved] Downloads cached for licensed users
vscode 1.39.1 [Approved] Downloads cached for licensed users
vscode 1.39.0 [Approved] Downloads cached for licensed users
vscode 1.38.1 [Approved] Downloads cached for licensed users
vscode 1.38.0 [Approved] Downloads cached for licensed users
vscode 1.37.1 [Approved] Downloads cached for licensed users
vscode 1.37.0 [Approved] Downloads cached for licensed users
vscode 1.36.1 [Approved] Downloads cached for licensed users
vscode 1.36.0 [Approved] Downloads cached for licensed users
vscode 1.35.1 [Approved] Downloads cached for licensed users
vscode 1.35.0 [Approved] Downloads cached for licensed users
vscode 1.34.0 [Approved] Downloads cached for licensed users
vscode 1.33.1 [Approved] Downloads cached for licensed users
vscode 1.33.0 [Approved] Downloads cached for licensed users
vscode 1.32.3 [Approved] Downloads cached for licensed users
vscode 1.32.2 [Approved] Downloads cached for licensed users
vscode 1.32.1 [Approved] Downloads cached for licensed users
vscode 1.31.1 [Approved] Downloads cached for licensed users
vscode 1.31.0 [Approved] Downloads cached for licensed users
vscode 1.30.2 [Approved] Downloads cached for licensed users
vscode 1.30.1 [Approved] Downloads cached for licensed users
vscode 1.30.0 [Approved] Downloads cached for licensed users
vscode 1.29.1 [Approved] Downloads cached for licensed users
vscode 1.29.0 [Approved]
vscode 1.28.2 [Approved] Downloads cached for licensed users
vscode 1.28.1 [Approved] Downloads cached for licensed users
vscode 1.28.0 [Approved] Downloads cached for licensed users
vscode 1.27.2 [Approved] Downloads cached for licensed users
vscode 1.27.1 [Approved] Downloads cached for licensed users
vscode 1.27.0 [Approved]
vscode 1.26.1 [Approved] Downloads cached for licensed users
vscode 1.26.0 [Approved] Downloads cached for licensed users
vscode 1.25.1 [Approved] Downloads cached for licensed users
vscode 1.25.0 [Approved] Downloads cached for licensed users
vscode 1.24.1 [Approved] Downloads cached for licensed users
vscode 1.24.0 [Approved] Downloads cached for licensed users
vscode 1.23.1.20180513 [Approved] Downloads cached for licensed users
178 packages found.
PS C:\Users\User> choco cache
Chocolatey v2.3.0
System HTTP Cache
We found 1 cached sources.
We found 7 cached items for all sources, where 0 items have expired.

User HTTP Cache
Directory 'C:\Users\User\.chocolatey\http-cache' does not exist.
We found 0 cached sources.
We found 0 cached items for all sources, where 0 items have expired.

📎 ChocolateyHttpCache-all.zip

corbob added a commit to corbob/choco that referenced this issue Jul 11, 2024
@corbob corbob self-assigned this Jul 12, 2024
corbob added a commit to corbob/choco that referenced this issue Jul 15, 2024
Report package result error instead of throwing exception.

a

Continue on downgrade attempt.
corbob added a commit to corbob/choco that referenced this issue Jul 15, 2024
Report package result error instead of throwing exception.

a

Continue on downgrade attempt.
corbob added a commit to corbob/choco that referenced this issue Jul 15, 2024
corbob added a commit to corbob/choco that referenced this issue Jul 15, 2024
corbob added a commit to corbob/choco that referenced this issue Jul 15, 2024
corbob added a commit to corbob/choco that referenced this issue Jul 15, 2024
corbob added a commit to corbob/choco that referenced this issue Jul 15, 2024
corbob added a commit to corbob/choco that referenced this issue Jul 18, 2024
corbob added a commit to corbob/choco that referenced this issue Jul 18, 2024
corbob added a commit to josh-cooley/choco that referenced this issue Jul 18, 2024
This commit adds pester tests and files required for the pester tests.
The tests include ensuring that installing a package that contains a
dependency tree that spans lots of versions does not take unnecessarily
long. As well as duplicating an integration test into the pester tests
to provide us with some belt and suspenders to help us catch issues at
both the integration and the pester test levels.
corbob added a commit to josh-cooley/choco that referenced this issue Jul 19, 2024
This commit adds pester tests and files required for the pester tests.
The tests include ensuring that installing a package that contains a
dependency tree that spans lots of versions does not take unnecessarily
long. As well as duplicating an integration test into the pester tests
to provide us with some belt and suspenders to help us catch issues at
both the integration and the pester test levels.
corbob added a commit to josh-cooley/choco that referenced this issue Aug 6, 2024
This commit adds pester tests and files required for the pester tests.
The tests include ensuring that installing a package that contains a
dependency tree that spans lots of versions does not take unnecessarily
long. As well as duplicating an integration test into the pester tests
to provide us with some belt and suspenders to help us catch issues at
both the integration and the pester test levels.
corbob added a commit to corbob/choco that referenced this issue Aug 7, 2024
corbob added a commit to corbob/choco that referenced this issue Aug 7, 2024
corbob added a commit to corbob/choco that referenced this issue Aug 12, 2024
corbob added a commit to corbob/choco that referenced this issue Aug 12, 2024
corbob added a commit to corbob/choco that referenced this issue Aug 15, 2024
corbob added a commit to corbob/choco that referenced this issue Aug 15, 2024
corbob added a commit to corbob/choco that referenced this issue Aug 15, 2024
Some of these package already existed on our internal repository, while
some of them have been added for the tests being added.
corbob added a commit to corbob/choco that referenced this issue Aug 15, 2024
We have added some tests for the install all command. This adds a new
package source to the testing environment so that we can run the tests
locally and in Test Kitchen.
gep13 pushed a commit to corbob/choco that referenced this issue Aug 22, 2024
Some of these package already existed on our internal repository, while
some of them have been added for the tests being added.
gep13 pushed a commit to corbob/choco that referenced this issue Aug 22, 2024
We have added some tests for the install all command. This adds a new
package source to the testing environment so that we can run the tests
locally and in Test Kitchen.
gep13 pushed a commit to corbob/choco that referenced this issue Aug 22, 2024
Add a number of tests for dependency scenarios where we did not have
tests before.
corbob added a commit to corbob/choco that referenced this issue Aug 26, 2024
corbob added a commit to corbob/choco that referenced this issue Aug 26, 2024
corbob added a commit to corbob/choco that referenced this issue Aug 26, 2024
Some of these package already existed on our internal repository, while
some of them have been added for the tests being added.
corbob added a commit to corbob/choco that referenced this issue Aug 26, 2024
We have added some tests for the install all command. This adds a new
package source to the testing environment so that we can run the tests
locally and in Test Kitchen.
corbob added a commit to corbob/choco that referenced this issue Aug 26, 2024
Add a number of tests for dependency scenarios where we did not have
tests before.
corbob added a commit to corbob/choco that referenced this issue Aug 30, 2024
We have added some tests for the install all command. This adds a new
package source to the testing environment so that we can run the tests
locally and in Test Kitchen.
corbob added a commit to corbob/choco that referenced this issue Aug 30, 2024
Add a number of tests for dependency scenarios where we did not have
tests before.
corbob added a commit to corbob/choco that referenced this issue Aug 30, 2024
corbob added a commit to corbob/choco that referenced this issue Aug 30, 2024
corbob added a commit to corbob/choco that referenced this issue Sep 23, 2024
Address review comments by using full version string for PackageResults,
and use case insensitive compares when determining if a package has
dependencies that failed to install.
AdmiringWorm pushed a commit to corbob/choco that referenced this issue Sep 27, 2024
AdmiringWorm pushed a commit to corbob/choco that referenced this issue Sep 27, 2024
AdmiringWorm pushed a commit to corbob/choco that referenced this issue Sep 27, 2024
Some of these package already existed on our internal repository, while
some of them have been added for the tests being added.
AdmiringWorm pushed a commit to corbob/choco that referenced this issue Sep 27, 2024
We have added some tests for the install all command. This adds a new
package source to the testing environment so that we can run the tests
locally and in Test Kitchen.
AdmiringWorm pushed a commit to corbob/choco that referenced this issue Sep 27, 2024
Add a number of tests for dependency scenarios where we did not have
tests before.
AdmiringWorm pushed a commit to corbob/choco that referenced this issue Sep 27, 2024
AdmiringWorm pushed a commit to corbob/choco that referenced this issue Sep 27, 2024
AdmiringWorm pushed a commit to corbob/choco that referenced this issue Sep 27, 2024
Address review comments by using full version string for PackageResults,
and use case insensitive compares when determining if a package has
dependencies that failed to install.
@corbob corbob added this to the 2.4.0 milestone Nov 5, 2024
@vexx32 vexx32 changed the title Incompatible meta/install packages lead to unnecessary downgrade Prevent dependency resolution from unexpectedly downgrading packages Nov 12, 2024
@vexx32
Copy link
Member

vexx32 commented Nov 12, 2024

🎉 This issue has been resolved in version 2.4.0 🎉

The release is available on:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants