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

win_chocolatey || Failed to resolve dependency #3416

Open
6 tasks done
gurupreet18121990 opened this issue Apr 5, 2024 · 9 comments
Open
6 tasks done

win_chocolatey || Failed to resolve dependency #3416

gurupreet18121990 opened this issue Apr 5, 2024 · 9 comments

Comments

@gurupreet18121990
Copy link

gurupreet18121990 commented Apr 5, 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?

I have below ansible playbook, which was working fine before . From last week, we have been experiencing issues while installing the packages on the windows 2019 server using "win_chocolatey".

Kindly find with the following details.

  1. OS version windows-2019
  2. Ansible version 2.11.12
  3. Chocolatey version: 2.0.0

Below is my playbook

- name: Install PowerShell Core
  win_chocolatey:
    name: powershell-core
    state: present
    install_args: ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 REGISTER_MANIFEST=1 USE_MU=1 ENABLE_MU=1
- name: Install Chromium
  win_chocolatey:
    name: chromium
    state: present

What I tried is to update the "chocolatey" but that didn't work. Although it upgraded from "Chocolatey version: 2.0.0" to "Chocolatey version: 2.2.2", but no luck.

- name: Ensure Chocolatey is up-to-date
  win_chocolatey:
    name: chocolatey
    state: latest

Main issue is that it's not able to resolve the dependency , if I explicit define the dependency which is showing up in the error message, then it will through same error with some other package dependency.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
It's failing with below error messages.

FAILED! => 
{"changed": false, "command": "C:\\ProgramData\\chocolatey\\bin\\choco.exe install powershell-core --fail-on-unfound --yes --no-progress --limit-output 
--install-arguments \"ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 REGISTER_MANIFEST=1 USE_MU=1 ENABLE_MU=1\" --timeout 2700", 
"msg": "Error installing package(s) 'powershell-core'", "rc": 1, "stderr": "", "stderr_lines": [], "stdout": 
"Installing the following packages:\r\npowershell-core\r\nBy installing, you accept licenses for the packages.
Failed to fetch results from V2 feed at 'http://community.chocolatey.org/api/v2/FindPackagesById?id='chocolatey-core.extension'&$skiptoken='1712192601110','1.0.1',
'chocolatey-core.extension'' with following message : An error occurred while sending the request.
Failed to fetch results from V2 feed at 'http://community.chocolatey.org/api/v2/FindPackagesById?id='kb3118401'&$skiptoken='1712171904820','1.0.4',
'kb3118401'' with following message : An error occurred while sending the request.\r\nUnable to resolve dependency 'kb3118401'. 
Source(s) used: 'https://community.chocolatey.org/api/v2/'.\r\n\r\nChocolatey installed 0/1 packages. 
1 packages failed See the log for details (C:\\ProgramData\\chocolatey\\logs\\chocolatey.log).\r\n\r\nFailures\r\n - powershell-core - 
Unable to resolve dependency 'kb3118401'. Source(s) used: 'https://community.chocolatey.org/api/v2/'.", "stdout_lines": 
["Installing the following packages:", "powershell-core", "By installing, you accept licenses for the packages. 
Failed to fetch results from V2 feed at 'http://community.chocolatey.org/api/v2/FindPackagesById?id='chocolatey-core.extension'&$skiptoken='1712192601110','1.0.1',
'chocolatey-core.extension'' with following message : An error occurred while sending the request.", "Failed to fetch results from V2 feed at
 'http://community.chocolatey.org/api/v2/FindPackagesById?id='kb3118401'&$skiptoken='1712171904820','1.0.4','kb3118401''
 with following message : An error occurred while sending the request.", 
 "Unable to resolve dependency 'kb3118401'. Source(s) used: 'https://community.chocolatey.org/api/v2/'.", "",
 "Chocolatey installed 0/1 packages. 1 packages failed.", " See the log for details (C:\\ProgramData\\chocolatey\\logs\\chocolatey.log).", "", 
"Failures", " - powershell-core - Unable to resolve dependency 'kb3118401'. Source(s) used: 'https://community.chocolatey.org/api/v2/'."]}

What is Expected?

win_chocolatey ansible module should resolve the dependency and install the packages on the windows 2019 server.

How Did You Get This To Happen?

  1. I run the below ansible playbook and I have observed this behavior from last week.
    name: Install AWS CLI
    win_chocolatey:
    name: awscli
    state: present
  • name: Install PowerShell Core
    win_chocolatey:
    name: powershell-core
    state: present
    install_args: ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 REGISTER_MANIFEST=1 USE_MU=1 ENABLE_MU=1
  • name: Install Chromium
    win_chocolatey:
    name: chromium
    state: present

System Details

  1. OS version windows-2019
  2. Ansible version 2.11.12
  3. Chocolatey version: 2.0.0

Installed Packages

NA

Output Log

NA

Additional Context

NA

@gurupreet18121990
Copy link
Author

I have found the work around by specifying the dependency in the ansible playbook.

  • name: Installing dependency packages.
    win_chocolatey:
    name: '{{ item }}'
    state: present
    loop:
    • chocolatey-windowsupdate.extension
    • kb2919442
    • kb2919355
    • kb3118401

But again , its like before installing any packge using chocolatey via ansible, I have to confirm the dependency first from the portal , ensure they are added and then run the playbook.

Whereas this was not required earlier . Does anyone aware why the dependency are not getting resolved by the "win_chocolatey" module?

@pauby
Copy link
Member

pauby commented Apr 6, 2024

There were updates yesterday to the Chocolatey Community Repository that could have caused this and then some updates later that could have fixed this. Can you:

  1. Try again?
  2. Try it with Chocolatey CLI directly and see if you get the same results?

The issue may also be down to caching.

@gurupreet18121990
Copy link
Author

hello @pauby

I have tried to re-run the code with the previous logic and its failing for installing "powershell-core" package, but that gives dependency issue. I have checked on the portal and their are update with its dependency.

@pauby
Copy link
Member

pauby commented Apr 7, 2024

Did you 'Try it with Chocolatey CLI directly and see if you get the same results'?

@gurupreet18121990
Copy link
Author

hello @pauby
I was able to install PowerShell Core by first installing the missing dependency via the CLI (command-line interface). While this is a workaround, I'm interested in knowing if there are any alternative solutions to avoid the dependency issue altogether.

@pauby
Copy link
Member

pauby commented Apr 8, 2024

There were issues with the site last week which could have caused this. These were resolved. Thats why I asked if you could try again to run directly using Chocolatey CLI.

Im unable to reproduce the issue. Without that there isn't anything we can 'fix'.

@gurupreet18121990
Copy link
Author

I am trying with Ansible logic, which is failing with below error. Do they still have issue with their website ?

Ansible logic:

  • name: Ensure Chocolatey is on the latest version
    win_chocolatey:
    name: chocolatey
    state: latest
    register: choco_update_result

Error message:
FAILED! => {"changed": false, "command": "C:\ProgramData\chocolatey\bin\choco.exe upgrade chocolatey --fail-on-unfound --yes --no-progress --limit-output --timeout 2700", "msg": "Error updating package(s) 'chocolatey'", "rc": 1, "stderr": "", "stderr_lines": [], "stdout": "Upgrading the following packages:\r\nchocolatey\r\nBy upgrading, you accept licenses for the packages.\r\nError retrieving packages from source 'https://community.chocolatey.org/api/v2/':\r\n Exception has been thrown by the target of an invocation.\r\n\r\nChocolatey upgraded 0/1 packages. 1 packages failed.\r\n See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).\r\n\r\nFailures\r\n - chocolatey - chocolatey was not found with the source(s) listed.\r\n If you specified a particular version and are receiving this message, it is possible that the package name exists but the version does not.\r\n Version: ""; Source(s): "[https://community.chocolatey.org/api/v2/](https://community.chocolatey.org/api/v2//)"\r\n", "stdout_lines": ["Upgrading the following packages:", "chocolatey", "By upgrading, you accept licenses for the packages.", "Error retrieving packages from source 'https://community.chocolatey.org/api/v2/':", " Exception has been thrown by the target of an invocation.", "", "Chocolatey upgraded 0/1 packages. 1 packages failed.", " See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).", "", "Failures", " - chocolatey - chocolatey was not found with the source(s) listed.", " If you specified a particular version and are receiving this message, it is possible that the package name exists but the version does not.", " Version: ""; Source(s): "[https://community.chocolatey.org/api/v2/](https://community.chocolatey.org/api/v2//)""]}

Copy link

github-actions bot commented May 9, 2024

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue will be closed in 14 days if it continues to be inactive.

@github-actions github-actions bot added the Pending Closure This issue has been marked as having no response or is stale and will soon be closed. label May 9, 2024
@gurupreet18121990
Copy link
Author

We are good to close it.
The issue was with the older version of the Chocolatey in the windows image, I have created a script which removed the chocolately older version and installs the newer version.

@github-actions github-actions bot removed the Pending Closure This issue has been marked as having no response or is stale and will soon be closed. label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants