-
Notifications
You must be signed in to change notification settings - Fork 23.8k
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
apt_repository never updates the APT cache on retry #36605
Labels
affects_2.4
This issue/PR affects Ansible v2.4
bug
This issue/PR relates to a bug.
has_pr
This issue has an associated PR.
module
This issue/PR relates to a module.
packaging
Packaging category
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
traceback
This issue/PR includes a traceback.
Comments
Files identified in the description: If these files are inaccurate, please update the |
openstack-gerrit
pushed a commit
to openstack/openstack-ansible-tests
that referenced
this issue
Mar 7, 2018
This rule is designed to prevent the Ansible module `apt_repository` from being used to update the APT cache. There is a bug [1] in `apt_repository` that prevents cache updates from being performed whenever the module is retried. If the cache update fails at the first attempt, it is skipped on the subsequent attempt of the task causing the task to always complete successfully. Until this bug is addressed this rule should prevent it from being introduced into OpenStack-Ansible. Partial-bug: 1750656 [1] ansible/ansible#36605 Change-Id: If440ce129c31fb4e62a8e0ac5094195f4d4d7167
openstack-gerrit
pushed a commit
to openstack/openstack-ansible-tests
that referenced
this issue
Mar 12, 2018
This rule is designed to prevent the Ansible module `apt_repository` from being used to update the APT cache. There is a bug [1] in `apt_repository` that prevents cache updates from being performed whenever the module is retried. If the cache update fails at the first attempt, it is skipped on the subsequent attempt of the task causing the task to always complete successfully. Until this bug is addressed this rule should prevent it from being introduced into OpenStack-Ansible. Partial-bug: 1750656 [1] ansible/ansible#36605 Change-Id: If440ce129c31fb4e62a8e0ac5094195f4d4d7167 (cherry picked from commit 67bfc90)
openstack-gerrit
pushed a commit
to openstack/openstack-ansible-tests
that referenced
this issue
Mar 12, 2018
This rule is designed to prevent the Ansible module `apt_repository` from being used to update the APT cache. There is a bug [1] in `apt_repository` that prevents cache updates from being performed whenever the module is retried. If the cache update fails at the first attempt, it is skipped on the subsequent attempt of the task causing the task to always complete successfully. Until this bug is addressed this rule should prevent it from being introduced into OpenStack-Ansible. Partial-bug: 1750656 [1] ansible/ansible#36605 Change-Id: If440ce129c31fb4e62a8e0ac5094195f4d4d7167 (cherry picked from commit 67bfc90)
openstack-gerrit
pushed a commit
to openstack/openstack-ansible-tests
that referenced
this issue
Mar 13, 2018
This rule is designed to prevent the Ansible module `apt_repository` from being used to update the APT cache. There is a bug [1] in `apt_repository` that prevents cache updates from being performed whenever the module is retried. If the cache update fails at the first attempt, it is skipped on the subsequent attempt of the task causing the task to always complete successfully. Until this bug is addressed this rule should prevent it from being introduced into OpenStack-Ansible. Partial-bug: 1750656 [1] ansible/ansible#36605 Change-Id: If440ce129c31fb4e62a8e0ac5094195f4d4d7167 (cherry picked from commit 67bfc90)
Same issue here, it seems that whole apt-* cache thing is broken, because it fails even with:
With
|
odyssey4me
pushed a commit
to odyssey4me/ansible-grafana
that referenced
this issue
Mar 22, 2018
Given that updating the apt cache/keys is a network operation, they are prone to transient failures and should therefore include the use of retries on the task. However, as noted in [1], if apt_repository fails to update the apt cache after updating the configuration, retries do not register there was a change and so no attempt is made to update the cache by the module on the second attempt. This failure can result in a failure to install packages. This change adds an apt module task to update the cache if the apt_repository tasks or the apt_key tasks register a change. This means updating the cache will get retried on failure and no longer fail silently. The apt cache update is triggered on changes to the apt repository configuration and to the keys to ensure that the cache is always using the right config/key conbination. [1] ansible/ansible#36605
this issue is address in the following PR and also implements multiple repos support. resolved_by_pr #56951 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
affects_2.4
This issue/PR affects Ansible v2.4
bug
This issue/PR relates to a bug.
has_pr
This issue has an associated PR.
module
This issue/PR relates to a module.
packaging
Packaging category
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
traceback
This issue/PR includes a traceback.
ISSUE TYPE
COMPONENT NAME
apt_repository
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial
SUMMARY
On the first attempt
apt_repository
updates the configuration file and then tries to update the cache. If the cache update fails, and the task is set to retry, a second attempt is made to perform the task. This second attempt always succeeds however the cache is never updated.The relevant block of code appears to be https://github.com/ansible/ansible/blob/v2.4.3.0-1/lib/ansible/modules/packaging/os/apt_repository.py#L540-L547. On the first attempt the configuration changes are saved, on the second attempt no changes are detected and so this block is skipped preventing the cache update being retried.
STEPS TO REPRODUCE
EXPECTED RESULTS
When the task is retried it should attempt to update the cache. With the above example the task should fail having exhausted all retries given the repository specified does not exist.
ACTUAL RESULTS
The task succeeds on the first retry even though the cache hasn't been updated.
The text was updated successfully, but these errors were encountered: