hitachienergy / epiphany

Cloud and on-premises automation for Kubernetes centered industrial grade solutions.
Apache License 2.0
138 stars 107 forks source link

[BUG] download-requirements script may fail on re-run on RHEL after failure #3279

Closed przemyslavic closed 2 years ago

przemyslavic commented 2 years ago

Describe the bug The download-requirements script may fail on re-run on RHEL/AlmaLinux OS after failure in first run.

How to reproduce Steps to reproduce the behavior:

  1. Run epicli prepare --os almalinux-8 --arch x86_64
  2. Run docker run -it --platform linux/amd64 -v /path/to/shared/dir:/shared almalinux:8.4
  3. Rename one package to cause an error, e.g. createrepo_c to createrepo_test in packages.yml 2022-09-22 12:59:02,768 [ERROR]: repoquery failed. Cannot find packages: ['createrepo_test]
  4. Restore the proper package name and run download requirements script again

The script will fail at the very beginning with the following error:

2022-09-22 12:48:49,534 [DEBUG]: [1/3] Running: `dnf makecache timer -y`
2022-09-22 12:48:49,738 [DEBUG]: [1/3] Running: `dnf install -y ca-certificates`
2022-09-22 12:49:25,431 [ERROR]: dnf install failed for package `ca-certificates`, reason: `Failed to set locale, defaulting to C.UTF-8
Importing GPG key 0x13EDEF05:
 Userid     : "Rapture Automatic Signing Key (cloud-rapture-signing-key-2022-03-07-08_01_01.pub)"
 Fingerprint: A362 B822 F6DE DC65 2817 EA46 B53D C80D 13ED EF05
 From       : https://packages.cloud.google.com/yum/doc/yum-key.gpg
Importing GPG key 0x307EA071:
 Userid     : "Rapture Automatic Signing Key (cloud-rapture-signing-key-2021-03-01-08_01_09.pub)"
 Fingerprint: 7F92 E05B 3109 3BEF 5A3C 2D38 FEEA 9169 307E A071
 From       : https://packages.cloud.google.com/yum/doc/yum-key.gpg
Importing GPG key 0x836F4BEB:
 Userid     : "gLinux Rapture Automatic Signing Key (//depot/google3/production/borg/cloud-rapture/keys/cloud-rapture-pubkeys/cloud-rapture-signing-key-2020-12-03-16_08_05.pub) <glinux-team@google.com>"
 Fingerprint: 59FE 0256 8272 69DC 8157 8F92 8B57 C5C2 836F 4BEB
 From       : https://packages.cloud.google.com/yum/doc/yum-key.gpg
Importing GPG key 0xDC6315A3:
 Userid     : "Artifact Registry Repository Signer <artifact-registry-repository-signer@google.com>"
 Fingerprint: 35BA A0B3 3E9E B396 F59C A838 C0BA 5CE6 DC63 15A3
 From       : https://packages.cloud.google.com/yum/doc/yum-key.gpg
Importing GPG key 0x3E1BA8D5:
 Userid     : "Google Cloud Packages RPM Signing Key <gc-team@google.com>"
 Fingerprint: 3749 E1BA 95A8 6CE0 5454 6ED2 F09C 394C 3E1B A8D5
 From       : https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
Importing GPG key 0x4D206F89:
 Userid     : "https://packagecloud.io/rabbitmq/rabbitmq-server (https://packagecloud.io/docs#gpg_signing) <support@packagecloud.io>"
 Fingerprint: 8C69 5B02 19AF DEB0 4A05 8ED8 F4E7 8920 4D20 6F89
 From       : https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey

Config files

Environment

epicli version: [2.0.2dev]

Additional context


DoD checklist

sbbroot commented 2 years ago

Bug was caused by not handling already installed info returned by proc.stdout for dnf install