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

Bug in cached dependencies for Ansible system environments #1719

Closed
2 tasks done
Selutario opened this issue Aug 17, 2021 · 1 comment · Fixed by #1732
Closed
2 tasks done

Bug in cached dependencies for Ansible system environments #1719

Selutario opened this issue Aug 17, 2021 · 1 comment · Fixed by #1732
Assignees

Comments

@Selutario
Copy link
Contributor

Selutario commented Aug 17, 2021

Description

The following error appears frequently when trying to build (using Ansible) the test environments for the system tests.
imagen

The problem seems to be that the address of the dependencies is cached but that address is no longer available:

- name: "Installing dependencies using apt"
apt:
pkg:
- git
- gcc
- make
- cmake
- libc6-dev
- curl
- policycoreutils
- automake
- autoconf
- libtool
force_apt_get: True
state: present

To fix this, simply add the following lines to all APT tasks in system environments:

    update-cache: true
    cache_valid_time: 3600

This is already done in some places, for example in the X environment:

- name: "Installing dependencies using apt"
apt:
pkg:
- git
- gcc
- make
- cmake
- libc6-dev
- curl
- policycoreutils
- automake
- autoconf
- libtool
- sqlite3
force_apt_get: True
state: present
update-cache: true
cache_valid_time: 3600

To do

  • Review APT tasks for all system test environments.
  • Add the code to expire cache on those sites where it is missing.
@Kondent
Copy link
Contributor

Kondent commented Aug 18, 2021

Issue update

I made those changes but I have encountered a new bug/problem to be fixed.

fatal: [wazuh-master]: FAILED! => changed=false 
  msg: 'Failed to update apt cache: W:This must be accepted explicitly before updates for this repository can be applied. 
See apt-secure(8) manpage for details., E:Repository ''http://security.debian.org/debian-security buster/updates InRelease'' changed its ''Suite'' value from ''stable'' to ''oldstable'', 
W:This must be accepted explicitly before updates for this repository can be applied. 
See apt-secure(8) manpage for details., W:Repository ''http://deb.debian.org/debian buster InRelease'' changed its ''Version'' value from ''10.4'' to ''10.10'', E:Repository ''http://deb.debian.org/debian buster InRelease'' changed its ''Suite'' value from ''stable'' to ''oldstable'', 
W:This must be accepted explicitly before updates for this repository can be applied. 
See apt-secure(8) manpage for details., E:Repository ''http://deb.debian.org/debian buster-updates InRelease'' changed its ''Suite'' value from ''stable-updates'' to ''oldstable-updates'''

Fixed it with a new block inside each .yml file.

- name: "Check and update debian repositories"
  shell:
    cmd: apt-get update --allow-releaseinfo-change

From man pages:

--allow-releaseinfo-change
Allow the update command to continue downloading data from a repository which changed its information of the release contained in the repository indicating e.g a new major release. APT will fail at the update command for such repositories until the change is confirmed to ensure the user is prepared for the change. See also apt-secure(8) for details on the concept and configuration. 

Im currently opening its PR.

Regards,
Alexis

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.

2 participants