Closed przemyslavic closed 2 years ago
Worth to check whether Ubuntu is affected as well, since there is different logic there, see comment
We may also change paths from /tmp/epi-repository-setup-scripts
to /var/tmp/epi-repository-setup-scripts
and from /tmp/epi-download-requirements
to /var/tmp/epi-download-requirements
in order to preserve files after OS restart.
They are removed in teardown
playbook (task Clean up temporary files
).
A similar problem also occurs on Ubuntu:
2021-11-25T12:45:18.9960903Z 12:45:18 INFO cli.engine.ansible.AnsibleCommand - TASK [repository : Run download-requirements script, this can take a long time
2021-11-25T12:45:18.9962164Z 12:45:18 INFO cli.engine.ansible.AnsibleCommand - You can check progress on repository host with: journalctl -f -t download-requirements.sh] ***
2021-11-25T12:45:25.8500190Z 12:45:25 ERROR cli.engine.ansible.AnsibleCommand - fatal: [ec2-1-1-1-1.eu-west-1.compute.amazonaws.com]: FAILED! => {"changed": true, "cmd": "set -o pipefail && /tmp/epi-download-requirements/download-requirements.sh /var/www/html/epirepo --no-logfile |& tee >(systemd-cat --identifier=download-requirements.sh)", "delta": "0:00:06.139469", "end": "2021-11-25 12:45:25.784458", "msg": "non-zero return code", "rc": 1, "start": "2021-11-25 12:45:19.644989", "stderr": "", "stderr_lines": [], "stdout": "Detected arch: x86_64\nDocker platform: linux/amd64\nOS repositories seems missing, restoring...\n/etc/apt/sources.list\n/etc/apt/sources.list.d/\nTesting apt connection:\n- /etc/apt/sources.list...\nConnection failure, reason: [ WARNING: apt does not have a stable CLI interface. Use with caution in scripts. E: Failed to fetch http://10.1.11.207/epirepo/packages/./Packages 404 Not Found [IP: 10.1.11.207 80] E: Some index files failed to download. They have been ignored, or old ones used instead.]", "stdout_lines": ["Detected arch: x86_64", "Docker platform: linux/amd64", "OS repositories seems missing, restoring...", "/etc/apt/sources.list", "/etc/apt/sources.list.d/", "Testing apt connection:", "- /etc/apt/sources.list...", "Connection failure, reason: [ WARNING: apt does not have a stable CLI interface. Use with caution in scripts. E: Failed to fetch http://10.1.11.207/epirepo/packages/./Packages 404 Not Found [IP: 10.1.11.207 80] E: Some index files failed to download. They have been ignored, or old ones used instead.]"]}
:heavy_check_mark: The apply
and upgrade
commands have been tested many times after the previous build was successfully completed and also on failure. No issues were noticed with the repository on re-run.
Tested on RHEL
, Ubuntu
, CentOS
.
Describe the bug Similar to #2324 but for upgrade mode. Failed
epicli upgrade
may lead to broken repository machine.How to reproduce Steps to reproduce the behavior:
epicli upgrade
commandepirepo
is enabled andsystem repositories
are disabledupgrade
after about 2 hours (download_done_flag_expire_minutes
is 120 by default) or manually remove download-requirements-done.flag file and re-runupgrade
TASK [repository : Run download-requirements script, this can take a long time
because all packages are removed from epirepo and no system repositories are available.Full output:
To solve this I had to login to the repository vm and execute there:
sudo /tmp/epi-repository-setup-scripts/disable-epirepo-client.sh && sudo /tmp/epi-repository-setup-scripts/enable-system-repos.sh
.Expected behavior Re-run should succeed at least when it comes to configuring the repository vm.
Config files If applicable, add config files to help explain your problem.
Environment
epicli version: [
1.3.0dev
]Additional context Add any other context about the problem here.
DoD checklist