viya-ark icon indicating copy to clipboard operation
viya-ark copied to clipboard

Pre-installation playbook failed on

Open peterscp93 opened this issue 3 years ago • 4 comments

Describe the bug A clear and concise description of what the issue is.

In the task to compare require packages for nss and curl, the Viya-ARK is failing with an error shown below pre.package_version_check.yml failed. This issue seems to be similar to the reported issue, https://github.com/sassoftware/viya-ark/issues/61

curl version: curl.x86_64 7.29.0-59.el7_9.1 @rhel-7-server-rpms

nss version: nss.x86_64 3.53.1-3.el7_9 @rhel-7-server-rpms

Environment

  • [ ] Ansible version: 2.8.2
  • [ ] Python version: Python 3.6.8
  • [ ] OS version: Red Hat Enterprise Linux Server release 7.9 (Maipo)
  • [ ] Failed playbook tasks log (or entire playbook log) [Attach] fatal: [opcgg100000322]: FAILED! => {"msg": "The conditional check 'installed_package.rc == 0 and installed_package_version.stdout is version_compare(item.value, '>=')' failed. The error was: Version comparison: '<' not supported between instances of 'str' and 'int'\n\nThe error appears to be in '/sas/install/sas_viya_playbook/viya-ark/playbooks/pre-install-playbook/roles/viya-ark.preinstall/tasks/pre.package_version_check.yml': line 38, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: Set valid installed package flag\n ^ here\n"}
  • [ ] What version of Viya 3.x is being deployed? Viya 3.5

To Reproduce Steps to reproduce the behavior:

  1. Execute pre-installation playbook contained in Viya-ARK. a. ansible-playbook viya-ark/playbooks/pre-install-playbook/viya_pre_install_playbook.yml --skip-tags=sudo_checks,skipstoragefail --check

  2. Playbook fails after successfully passing curl version task. I suspect the playbook has failed on checking nss version.

Expected behavior Successful execution of SAS Viya pre-installation playbook.

Thank you. Seung Park

peterscp93 avatar Apr 07 '21 22:04 peterscp93

We will investigate. Thank you for submitting the issue.

kevinlinglesas avatar Apr 09 '21 14:04 kevinlinglesas

@peterscp93, deep apologies for the neglect of this issue.
I attempted to reproduce the reported issue with two test target hosts, both running RHEL 7.9 and each installed with Ansible 2.8.2 and 4.10.0 respectively. The 4.10.0 was included as it falls in our current support window (2.10 - 2.12 core). Ansible 4.10.0 contains 2.11.12 core.

My understanding of the problem is that on the 'nss' package iteration, the Set valid installed package flag task failed based on mis-match of types used in the version comparison built-in module.

In each instance of execution (curl & nss iterations) in my attempt to reproduce the issue, this task was successful. My environment was one in which both 'curl' and 'nss' packages were at a level exceeding the required versions, so no installation was attempted - not withstanding it was a --check run. Those install and repo version available tasks were skipped once the package_meets_requirement variable was set 'true'. From the curl and nss versions you referenced at the top, I believe your execution would have taken the same path had it made it past the 'nss' check.

Based on failing to reproduce the issue and the outdated Ansible version involved, I am closing this issue.

kevinlinglesas avatar Oct 11 '22 17:10 kevinlinglesas

Hello,

I have faced the same issue lately.

fatal [...] "msg": "The conditional check 'installed_package.rc == 0 and installed_package_version.stdout is version_compare(item.value, '>=')' failed. The error was: Version comparison: '<' not supported between instances of 'str' and 'int' [...]

As you can see, python raises the same error because of two different instances of the objects in the comparison.

If we execute the full command $ sudo yum list installed curl | tail -1 | awk '{print $2}' the stdout is plugins:

because the stdout of the command $ sudo yum list installed curl is

Loaded plugins: enabled_repos_upload, package_upload, product-id, search-disabled-repos, subscription-manager Installed Packages curl.x86_64 7.29.0-59.el7_9.1 @rhel-7-server-rpms Uploading Enabled Repositories Report Loaded plugins: product-id, subscription-manager

That's why...

So, the solution is to set the plugins to 0 in the /etc/yum.conf

But I believe that in the yml command, we could add the --noplugins option as possible tiny improvement ($ sudo yum list installed curl --noplugins | tail -1 | awk '{print $2}').

Thank you for your attention

Cheers

Michel

KaminoU avatar Nov 05 '22 10:11 KaminoU

@KaminoU , thank you for the details on the issue you are facing. Re-opening for further investigation.

kevinlinglesas avatar Nov 06 '22 18:11 kevinlinglesas