Skip to content
New issue

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

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

Already on GitHub? # to your account

Do not install packages if dependencies fail to install #3487

Closed
6 tasks done
vexx32 opened this issue Jul 16, 2024 · 2 comments · Fixed by #3486
Closed
6 tasks done

Do not install packages if dependencies fail to install #3487

vexx32 opened this issue Jul 16, 2024 · 2 comments · Fixed by #3486
Assignees
Milestone

Comments

@vexx32
Copy link
Member

vexx32 commented Jul 16, 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?

When a dependency fails to install, the failure does not prevent other packages which depend on it from installing.

What is Expected?

Failing to install a dependency should not permit anything that depends on it to still install.

How Did You Get This To Happen?

  1. Download download.zip and extract to C:\packages
  2. choco upgrade rootpackageA rootpackageB -y -s c:\packages
  3. The reported failure is rootpackageB despite it not actually depending on the failing dependency nested-dependencyA-failing, and rootpackageA is permitted to install, despite this placing Chocolatey in a broken state where you cannot install any more packages until you rip out all the installed packages further up in the dependency chain.

System Details

  • Operating System: Win10
  • Windows PowerShell version: 5.1
  • Chocolatey CLI Version: 2.3.0
  • Chocolatey Licensed Extension version: 6.2.1
  • Chocolatey License type: Business
  • Terminal/Emulator: PowerShell

Installed Packages

N/A, this reproduces purely with the given test packages.

Output Log

https://gist.github.com/vexx32/26e3a315109a15f897de3ef12f803eff

Additional Context

No response

@vexx32 vexx32 added the Bug label Jul 16, 2024
@vexx32 vexx32 modified the milestone: 2.4.0 Jul 16, 2024
@corbob corbob self-assigned this Aug 15, 2024
corbob added a commit to corbob/choco that referenced this issue Aug 15, 2024
When a package dependency fails to install, we will now fail the
package as well.
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.
corbob added a commit to corbob/choco that referenced this issue Aug 15, 2024
Add a number of tests for dependency scenarios where we did not have
tests before.
gep13 pushed a commit to corbob/choco that referenced this issue Aug 22, 2024
When a package dependency fails to install, we will now fail the
package as well.
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
When a package dependency fails to install, we will now fail the
package as well.
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.
@Ana06
Copy link

Ana06 commented Aug 27, 2024

I have also experienced this issue when installing/upgrading a package with git version >=2.45.0 and <2.46.0 as dependency. git.install fails to install (likely because git 2.46 was already installed) but the git installation and the installation of the package that requires git succeed:

By upgrading, you accept licenses for the packages.
Downloading package from source 'https://community.chocolatey.org/api/v2/'

git.install v2.45.2 (forced) [Approved]
git.install package files upgrade completed. Performing other installation steps.
Using Git LFS
Installing 64-bit git.install...
ERROR: Running ["C:\ProgramData\chocolatey\lib\git.install\tools\Git-2.45.2-64-bit.exe" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /NOCANCEL /SP- /LOG /COMPONENTS="icons,assoc,assoc_sh,ext,ext\shellhere,ext\guihere,gitlfs,icons\quicklaunch"] was not successful. Exit code was '1'. See log for possible error messages.
The upgrade of git.install was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\git.install\tools\chocolateyInstall.ps1'.
 See log for details.
Downloading package from source 'https://community.chocolatey.org/api/v2/'

git v2.45.2 (forced) [Approved]
git package files upgrade completed. Performing other installation steps.
 The upgrade of git was successful.
  Deployed to 'C:\ProgramData\chocolatey\lib\git'

After that packages that are completely unrelated fail to install with:

[NuGet] One or more unresolved package dependency constraints detected in the Chocolatey lib folder. All dependency constraints must be resolved to add or update packages. If these packages are being updated this message may be ignored, if not the following error(s) may be blocking the current package operation: '<package_name> <package_version> constraint: git (>= 2.45.0 && < 2.46.0)'

git should fail to install if git.install fails to install

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
When a package dependency fails to install, we will now fail the
package as well.
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 Failing to install dependencies does not always fail packages which require them, leaving chocolatey in a broken state Do not install packages if dependencies fail to install Nov 12, 2024
@vexx32
Copy link
Member Author

vexx32 commented Nov 12, 2024

🎉 This issue has been resolved in version 2.4.0 🎉

The release is available on:

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

Successfully merging a pull request may close this issue.

4 participants