RedHatQE / teflo

Teflo is a standalone orchestration software that controls the flow of a set of testing scenarios, allowing users to provision machines, deploy software, execute tests against them and manage generated artifacts and report results.
https://teflo.readthedocs.io/en/latest/
GNU General Public License v3.0
14 stars 16 forks source link

Teflo failing to install rsync during reporting phase #259

Closed danalanerh closed 1 year ago

danalanerh commented 1 year ago

Starting about 2 days ago, our teflo runs have been failing to install rsync (Log excerpt here)

`2022-11-08 16:48:56,430 INFO TASK [check if rsync package is installed] * 2022-11-08 16:48:56,430 INFO changed: [10.8.0.174] 2022-11-08 16:48:56,910 INFO 2022-11-08 16:48:56,911 INFO TASK [Add repository] ** 2022-11-08 16:48:56,911 INFO ok: [10.8.0.174] 2022-11-08 16:48:58,336 INFO 2022-11-08 16:48:58,337 INFO TASK [Install rsync] *** 2022-11-08 16:48:58,337 INFO task path: /var/lib/jenkins/workspace/RhelLayeredProducts/rhosp-16.1-lv2guest-rhel-8/envs/scenario/openstack_lv2guest_rhel/cbn_execute_synchronize_i33dw.yml:89 2022-11-08 16:48:58,337 INFO fatal: [10.8.0.174]: FAILED! => changed=false 2022-11-08 16:48:58,337 INFO msg: 'Failed to download metadata for repo ''epel'': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried' 2022-11-08 16:48:58,337 INFO rc: 1 2022-11-08 16:48:58,337 INFO results: [] 2022-11-08 16:48:58,405 INFO 2022-11-08 16:48:58,405 INFO TASK [copy failed artifacts results to file] * 2022-11-08 16:48:58,405 INFO task path: /var/lib/jenkins/workspace/RhelLayeredProducts/rhosp-16.1-lv2guest-rhel-8/envs/scenario/openstack_lv2guest_rhel/cbn_execute_synchronize_i33dw.yml:129 2022-11-08 16:48:58,405 INFO fatal: [10.8.0.174 -> localhost]: FAILED! => 2022-11-08 16:48:58,405 INFO msg: '''sync_output'' is undefined' 2022-11-08 16:48:58,444 INFO 2022-11-08 16:48:58,445 INFO PLAY RECAP *** 2022-11-08 16:48:58,445 INFO 10.8.0.174 : ok=4 changed=1 unreachable=0 failed=1 skipped=7 rescued=1 ignored=0 2022-11-08 16:48:58,445 INFO 2022-11-08 16:48:58,561 ERROR [WARNING]: Found variable using reserved name: hosts

2022-11-08 16:48:58,591 ERROR Failed to execute Update result xml name and save artifacts 2022-11-08 16:48:58,592 ERROR A failure occurred while trying to copy test artifacts. 2022-11-08 16:48:58,593 ERROR A exception was raised while processing task: Update result xml name and save artifacts method: run Traceback (most recent call last): File "/var/lib/jenkins/workspace/RhelLayeredProducts/rhosp-16.1-lv2guest-rhel-8/envs/scenario/lib64/python3.9/site-packages/teflo/executors/ext/ansible_executor_plugin/ansible_executor_plugin.py", line 359, in run getattr(self, '%s' % attr)() File "/var/lib/jenkins/workspace/RhelLayeredProducts/rhosp-16.1-lv2guest-rhel-8/envs/scenario/lib64/python3.9/site-packages/teflo/executors/ext/ansible_executor_plugin/ansible_executor_plugin.py", line 238, in artifacts raise TefloExecuteError('A failure occurred while trying to copy ' teflo.exceptions.TefloExecuteError: A failure occurred while trying to copy test artifacts.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/var/lib/jenkins/workspace/RhelLayeredProducts/rhosp-16.1-lv2guest-rhel-8/envs/scenario/lib64/python3.9/site-packages/blaster/blast.py", line 83, in run value = getattr(task_obj, method)() File "/var/lib/jenkins/workspace/RhelLayeredProducts/rhosp-16.1-lv2guest-rhel-8/envs/scenario/lib64/python3.9/site-packages/teflo/tasks/execute.py", line 57, in run self.executor.run() File "/var/lib/jenkins/workspace/RhelLayeredProducts/rhosp-16.1-lv2guest-rhel-8/envs/scenario/lib64/python3.9/site-packages/teflo/executors/execute_manager.py", line 72, in run res = self.plugin.run() File "/var/lib/jenkins/workspace/RhelLayeredProducts/rhosp-16.1-lv2guest-rhel-8/envs/scenario/lib64/python3.9/site-packages/teflo/executors/ext/ansible_executor_plugin/ansible_executor_plugin.py", line 367, in run self.artifacts() File "/var/lib/jenkins/workspace/RhelLayeredProducts/rhosp-16.1-lv2guest-rhel-8/envs/scenario/lib64/python3.9/site-packages/teflo/executors/ext/ansible_executor_plugin/ansible_executor_plugin.py", line 238, in artifacts raise TefloExecuteError('A failure occurred while trying to copy ' teflo.exceptions.TefloExecuteError: A failure occurred while trying to copy test artifacts.`

Looking at the code in playbooks.py;

- name: Add repository ansible.builtin.yum_repository: name: epel-release baseurl: https://dl.fedoraproject.org/pub/epel/{{ ansible_distribution_major_version }}/x86_64 state: present description: EPEL YUM repo gpgcheck: no become: true when: (rsync_installed.rc != 0 ) and (ansible_facts['os_family'] == 'RedHat')

I then compared with the the epel location here; https://dl.fedoraproject.org/pub/epel/8/

IT looks like there is an inconsistency in the way the repos are structured and that this change doesn't work for rhel 8.

rujutashinde commented 1 year ago

@danalanerh this is caused due to the new change for #257 . @guyyaakov1 can you please take a look. for workaround ,please use the version 2.2.7.

danalanerh commented 1 year ago

Thanks for the quick response.

ryankwilliams commented 1 year ago

PR #257 still does not look like it addresses the issue. https://dl.fedoraproject.org/pub/epel/8/x86_64 is invalid.

There are two folders on the server side:

  1. Everything
  2. Modular

https://dl.fedoraproject.org/pub/epel/8/

Though when looking at the packages available, rsync is not available. Seems to have been removed from epel.

You may need to find an alternative repo to use to pull in rsync when attempting to install it. An example of this can be the repo that comes with the UBI8 container image.

https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/x86_64/baseos/os

[root@a297a5d7990c ~]# dnf whatprovides rsync
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Last metadata expiration check: 0:05:17 ago on Wed Nov  9 17:47:31 2022.
rsync-3.1.3-19.el8.x86_64 : A program for synchronizing files over a network
Repo        : ubi-8-baseos
Matched from:
Provide    : rsync = 3.1.3-19.el8
guyyaakov1 commented 1 year ago

Submitted a PR to develop branch with the wanted changes.

You can tests the changes here: https://github.com/RedHatQE/teflo/tree/epel_install_8

@danalanerh Thank you for taking your time to create this issue.

dno-github commented 1 year ago

Jira ticket CCITCARBON-481 has been created for this issue. Url : https://issues.redhat.com/browse/CCITCARBON-481

danalanerh commented 1 year ago

Which teflo release will reflect this change?

rujutashinde commented 1 year ago

Which teflo release will reflect this change?

@danalanerh it is in the latest release 2.2.9. we had a hotfix release https://github.com/RedHatQE/teflo/releases/tag/v2.2.9

danalanerh commented 1 year ago

Thank you! :)