sassoftware / viya-ark

SAS Viya Administration Resource Kit (SAS Viya ARK). Tools and utilities to help SAS customers with SAS Viya readiness.
Apache License 2.0
55 stars 34 forks source link

Viya 3.5 Pre-Install failed while running pre_install_playbook.yml #65

Closed venkattoluchuri closed 4 years ago

venkattoluchuri commented 4 years ago

I am trying to run "ansible-playbook viya_pre_install_playbook.yml -i pre-install.inventory.ini -v --check" and failed with below ERROR. I had switched different Ansible version from 2.7 version to 2.9 however still no luck. But I am suspecting Issue should be python module could not load.

ansible --version /usr/lib64/python2.7/site-packages/cryptography/init.py:39: CryptographyDeprecationWarning: Python 2 is no longer supported by the P ython core team. Support for it is now deprecated in cryptography, and will be removed in a future release. CryptographyDeprecationWarning, ansible 2.7.2 config file = None configured module search path = [u'/home/sas/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python2.7/site-packages/ansible executable location = /usr/bin/ansible python version = 2.7.5 (default, May 3 2017, 07:55:04) [GCC 4.8.5 20150623 (Red Hat 4.8.5-14)] [sas@nhisasviyavm pre-install-playbook]$ python -V Python 3.6.9

Please point me with the right fix here ?

ansible-playbook viya_pre_install_playbook.yml -i pre-install.inventory.ini -v --check /usr/lib64/python2.7/site-packages/cryptography/init.py:39: CryptographyDeprecationWarning: Python 2 is no longer supported by the P ython core team. Support for it is now deprecated in cryptography, and will be removed in a future release. CryptographyDeprecationWarning, No config file found; using defaults /opt/sas/viya-ark/playbooks/pre-install-playbook/pre-install.inventory.ini did not meet host_list requirements, check plugin documentati on if this is unexpected /opt/sas/viya-ark/playbooks/pre-install-playbook/pre-install.inventory.ini did not meet script requirements, check plugin documentation if this is unexpected /opt/sas/viya-ark/playbooks/pre-install-playbook/pre-install.inventory.ini did not meet yaml requirements, check plugin documentation if this is unexpected

PLAY [localhost] ***

TASK [Gathering Facts] ***** An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ValueError: Attempted relative import i n non-package fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/home/sas/.ansible/tmp/ ansible-tmp-1596452137.03-64750991737495/AnsiballZ_setup.py\", line 113, in \n _ansiballz_main()\n File \"/home/sas/.ansible /tmp/ansible-tmp-1596452137.03-64750991737495/AnsiballZ_setup.py\", line 105, in _ansiballz_main\n invoke_module(zipped_mod, temp_pat h, ANSIBALLZ_PARAMS)\n File \"/home/sas/.ansible/tmp/ansible-tmp-1596452137.03-64750991737495/AnsiballZsetup.py\", line 48, in invoke module\n imp.load_module('main', mod, module, MOD_DESC)\n File \"/tmp/ansible_setup_payload_QfbLMQ/main.py\", line 131, in < module>\nValueError: Attempted relative import in non-package\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1} to retry, use: --limit @/opt/sas/viya-ark/playbooks/pre-install-playbook/viya_pre_install_playbook.retry

PLAY RECAP ***** localhost : ok=0 changed=0 unreachable=0 failed=1

erharb commented 4 years ago

The Gathering facts phase is an ansible-playbook built-in, not something provided by Viya ARK. Most likely this is some kind of environment/installation problem with ansible itself.

One thing I noticed is that while your default python is version 3.6.9, the version of python which ansible was installed with was Python 2.7: ansible python module location = /usr/lib/python2.7/site-packages/ansible

You might want to try either making python 2.7 the default python, or uninstalling ansible then install it using python 3's pip.

venkattoluchuri commented 4 years ago

Still looks to me an issue; Can you guide me some cleanup process, since If I remove ansible still Python out there.

[sas@nhisasviyavm pre-install-playbook]$ ansible --version /usr/lib64/python2.7/site-packages/cryptography/init.py:39: CryptographyDeprecationWarning: Python 2 is no longer supported by the P ython core team. Support for it is now deprecated in cryptography, and will be removed in a future release. CryptographyDeprecationWarning, ansible 2.7.2 config file = None configured module search path = [u'/home/sas/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python2.7/site-packages/ansible executable location = /usr/bin/ansible python version = 2.7.5 (default, May 3 2017, 07:55:04) [GCC 4.8.5 20150623 (Red Hat 4.8.5-14)] [sas@nhisasviyavm pre-install-playbook]$ ansible-playbook viya_pre_install_playbook.yml -i pre-install.inventory.ini --check /usr/lib64/python2.7/site-packages/cryptography/init.py:39: CryptographyDeprecationWarning: Python 2 is no longer supported by the P ython core team. Support for it is now deprecated in cryptography, and will be removed in a future release. CryptographyDeprecationWarning,

PLAY [localhost] ***

TASK [Gathering Facts] ***** An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ValueError: Attempted relative import i n non-package fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/home/sas/.ansible/tmp/ ansible-tmp-1596462428.35-262927258276294/AnsiballZ_setup.py\", line 113, in \n _ansiballz_main()\n File \"/home/sas/.ansibl e/tmp/ansible-tmp-1596462428.35-262927258276294/AnsiballZ_setup.py\", line 105, in _ansiballz_main\n invoke_module(zipped_mod, temp_p ath, ANSIBALLZ_PARAMS)\n File \"/home/sas/.ansible/tmp/ansible-tmp-1596462428.35-262927258276294/AnsiballZ_setup.py\", line 48, in invo ke_module\n imp.load_module('main', mod, module, MOD_DESC)\n File \"/tmp/ansible_setup_payload_Gr1uPj/main.py\", line 131, i n \nValueError: Attempted relative import in non-package\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1} to retry, use: --limit @/opt/sas/viya-ark/playbooks/pre-install-playbook/viya_pre_install_playbook.retry

erharb commented 4 years ago

ansible is still installed using python 2.7, did you attempt to uninstall it? What version does pip -V report? To make sure python 3 is used reinstall with "python -m pip install ansible" since python -V reports version 3.

Beyond that you may want to file an issue with the Ansible project on Github here since your issue is not Viya ARK related: https://github.com/ansible/ansible

venkattoluchuri commented 4 years ago

[sas@nhisasviyavm pre-install-playbook]$ pip -V report pip 20.2 from /usr/lib/python2.7/site-packages/pip (python 2.7)

[sas@nhisasviyavm pre-install-playbook]$ sudo python -m pip install ansible DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintain ed. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.py pa.io/en/latest/development/release-process/#python-2-support Requirement already satisfied: ansible in /usr/lib/python2.7/site-packages (2.7.2) Requirement already satisfied: jinja2 in /usr/lib64/python2.7/site-packages (from ansible) (2.11.2) Requirement already satisfied: PyYAML in /usr/lib64/python2.7/site-packages (from ansible) (5.3.1) Requirement already satisfied: paramiko in /usr/lib/python2.7/site-packages (from ansible) (2.7.1) Requirement already satisfied: cryptography in /usr/lib64/python2.7/site-packages (from ansible) (3.0) Requirement already satisfied: setuptools in /usr/lib/python2.7/site-packages (from ansible) (44.1.1) Requirement already satisfied: MarkupSafe>=0.23 in /usr/lib64/python2.7/site-packages (from jinja2->ansible) (1.1.1) Requirement already satisfied: pynacl>=1.0.1 in /usr/lib64/python2.7/site-packages (from paramiko->ansible) (1.4.0) Requirement already satisfied: bcrypt>=3.1.3 in /usr/lib64/python2.7/site-packages (from paramiko->ansible) (3.1.7) Requirement already satisfied: six>=1.4.1 in /usr/lib/python2.7/site-packages (from cryptography->ansible) (1.9.0) Requirement already satisfied: cffi!=1.11.3,>=1.8 in /usr/lib64/python2.7/site-packages (from cryptography->ansible) (1.14.1) Requirement already satisfied: ipaddress; python_version < "3" in /usr/lib/python2.7/site-packages (from cryptography->ansible) (1.0.23) Requirement already satisfied: enum34; python_version < "3" in /usr/lib/python2.7/site-packages (from cryptography->ansible) (1.1.10) Requirement already satisfied: pycparser in /usr/lib/python2.7/site-packages (from cffi!=1.11.3,>=1.8->cryptography->ansible) (2.14)

kevinlinglesas commented 4 years ago

My recollection is that you need to uninstall ansible using pip and re-install ansible using pip3 in order for python3 to be used inherently by ansible as I think you are trying to achieve.

sudo pip uninstall --yes ansible sudo pip3 install ansible=="2.9.x" (or whatever version is desired)

erharb commented 4 years ago

Yes so use pip from version 2 to uninstall ansible, then use python 3's pip to install it. Since your default python is 3 you should probably update your path to make pip 3 default instead of pip 2

venkattoluchuri commented 4 years ago

I am trying to do with python 2.7 only. I do not have python 3 now. So I have uninstalled ansible and re-install with pip only. Here is the different error now;

[sas@nhisasviyavm ~]$ whereis python python: /usr/bin/python /usr/bin/python2.7 /usr/bin/python2.7-config /usr/lib/python2.7 /usr/lib64/python2.7 /etc/python /usr/include/py thon2.7 /usr/share/man/man1/python.1.gz [sas@nhisasviyavm ~]$ cd /usr/bin/ [sas@nhisasviyavm bin]$ ls -lrt python* -rwxr-xr-x. 1 root root 1835 May 3 2017 python2.7-config -rwxr-xr-x. 1 root root 7136 May 3 2017 python2.7 lrwxrwxrwx. 1 root root 7 Oct 26 2019 python -> python2 lrwxrwxrwx. 1 root root 9 Oct 26 2019 python2 -> python2.7 lrwxrwxrwx. 1 root root 14 Aug 3 06:40 python-config -> python2-config lrwxrwxrwx. 1 root root 16 Aug 3 06:40 python2-config -> python2.7-config [sas@nhisasviyavm bin]$ python -V Python 2.7.5

[sas@nhisasviyavm pre-install-playbook]$ ansible-playbook viya_pre_install_playbook.yml -i pre-install.inventory.ini /usr/lib64/python2.7/site-packages/cryptography/init.py:39: CryptographyDeprecationWarning: Python 2 is no longer supported by the P ython core team. Support for it is now deprecated in cryptography, and will be removed in a future release. CryptographyDeprecationWarning, ERROR! Unexpected Exception, this is probably a bug: cannot import name AnsibleCollectionLoader the full traceback was:

Traceback (most recent call last): File "/usr/bin/ansible-playbook", line 92, in mycli = getattr(import("ansible.cli.%s" % sub, fromlist=[myclass]), myclass) File "/usr/lib/python2.7/site-packages/ansible/cli/init.py", line 22, in from ansible.inventory.manager import InventoryManager File "/usr/lib/python2.7/site-packages/ansible/inventory/manager.py", line 38, in from ansible.plugins.loader import inventory_loader File "/usr/lib/python2.7/site-packages/ansible/plugins/loader.py", line 25, in from ansible.utils.collection_loader import AnsibleCollectionLoader, AnsibleFlatMapLoader, AnsibleCollectionRef ImportError: cannot import name AnsibleCollectionLoader

erharb commented 4 years ago

You might need to do a deeper clean after uninstall of ansible again, by removing the ansible folder under site-packages /usr/lib64/python2.7/site-packages, then installing again, similar to what was found here (though they had python 3, probably same problem of somehow bad download):

https://github.com/ansible-collections/community.kubernetes/issues/135#issuecomment-661189940

venkattoluchuri commented 4 years ago

After delete ansible folder issue got resolved finally :) thanks for the tip. However, I stuck here;

TASK [viya-ark.preinstall : Check that required RHEL package 'nss.x86_64' is available in a repository at some version] **** fatal: [deployTarget]: FAILED! => {"changed": false, "cmd": "yum list available nss.x86_64", "delta": "0:00:00.658482", "end": "2020-08- 03 15:15:03.999851", "msg": "non-zero return code", "rc": 1, "start": "2020-08-03 15:15:03.341369", "stderr": "Error: No matching Packag es to list", "stderr_lines": ["Error: No matching Packages to list"], "stdout": "Loaded plugins: langpacks, product-id, search-disabled- repos", "stdout_lines": ["Loaded plugins: langpacks, product-id, search-disabled-repos"]} ...ignoring

TASK [viya-ark.preinstall : Assert that package 'nss.x86_64' is available] ***** fatal: [deployTarget]: FAILED! => { "assertion": "package_available.rc == 0", "changed": false, "evaluated_to": false, "msg": "ERROR: Package nss.x86_64 is not available in any registered repository." }

PLAY RECAP ***** deployTarget : ok=56 changed=0 unreachable=0 failed=1 skipped=14 rescued=0 ignored=1
localhost : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

sudo yum install nss-mdns.x86_64 Loaded plugins: langpacks, product-id, search-disabled-repos Package nss-mdns-0.14.1-7.el7.x86_64 already installed and latest version Nothing to do

erharb commented 4 years ago

What version of RHEL is this (on your deployTarget)? And do you have the RHEL repos properly entitled on your target? What happens if you try to manually run yum install nss.x86_64 the the target host, any useful info coming back from yum?

venkattoluchuri commented 4 years ago

[sas@nhisasviyavm pre-install-playbook]$ cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.4 (Maipo)

[sas@nhisasviyavm pre-install-playbook]$ sudo yum install nss.x86_64 Loaded plugins: langpacks, product-id, search-disabled-repos Package nss-3.28.4-15.el7_4.x86_64 already installed and latest version Nothing to do

erharb commented 4 years ago

Is deployTarget same host as the local host running ansible?

venkattoluchuri commented 4 years ago

yes. it is a single machine

venkattoluchuri commented 4 years ago

looks to me it is looking for latest version (3.36) though it had installed (3.28) it. I tried with upgrade but no luck. Any alternate solution ?

TASK [viya-ark.preinstall : Check for installed RHEL package 'nss.x86_64'] ***** ok: [deployTarget] => {"changed": false, "cmd": "yum list installed nss.x86_64", "delta": "0:00:00.412117", "end": "2020-08-03 15:25:22. 955166", "rc": 0, "start": "2020-08-03 15:25:22.543049", "stderr": "", "stderr_lines": [], "stdout": "Loaded plugins: langpacks, product -id, search-disabled-repos\nInstalled Packages\nnss.x86_64 3.28.4-15.el7_4 @rhui-rhel-7-server-rhui-eus-rpms", "stdo ut_lines": ["Loaded plugins: langpacks, product-id, search-disabled-repos", "Installed Packages", "nss.x86_64 3.28.4-15.el7_4 @rhui-rhel-7-server-rhui-eus-rpms"]}

TASK [viya-ark.preinstall : Check that installed RHEL package 'nss.x86_64' meets minimum version 3.36.0-7] ***** ok: [deployTarget] => {"changed": false, "cmd": "yum list installed nss.x86_64 | tail -1 | awk '{print $2}'", "delta": "0:00:00.415324", "end": "2020-08-03 15:25:23.564705", "rc": 0, "start": "2020-08-03 15:25:23.149381", "stderr": "", "stderr_lines": [], "stdout": "3.28. 4-15.el7_4", "stdout_lines": ["3.28.4-15.el7_4"]}

TASK [viya-ark.preinstall : Set valid installed package flag] ** skipping: [deployTarget] => {"changed": false, "skip_reason": "Conditional result was False"}

TASK [viya-ark.preinstall : Check that required RHEL package 'nss.x86_64' is available in a repository at some version] **** fatal: [deployTarget]: FAILED! => {"changed": false, "cmd": "yum list available nss.x86_64", "delta": "0:00:00.656080", "end": "2020-08- 03 15:25:24.445381", "msg": "non-zero return code", "rc": 1, "start": "2020-08-03 15:25:23.789301", "stderr": "Error: No matching Packag es to list", "stderr_lines": ["Error: No matching Packages to list"], "stdout": "Loaded plugins: langpacks, product-id, search-disabled- repos", "stdout_lines": ["Loaded plugins: langpacks, product-id, search-disabled-repos"]} ...ignoring

erharb commented 4 years ago

I'm thinking maybe some RHEL repo isn't enabled that should be to pick up newer version of it. Are you using a mirror or direct to rhel's hosting? What does the output of yum repolist provide, and yum repoinfo for each RHEL repo provide?

venkattoluchuri commented 4 years ago

I am using Rhel hosting. Any instructions how to enable repos if something I missed?

Get Outlook for Androidhttps://aka.ms/ghei36


From: Eric Harbeston notifications@github.com Sent: Monday, August 3, 2020 10:04:12 PM To: sassoftware/viya-ark viya-ark@noreply.github.com Cc: Toluchuri, Venkateswarlu venkat.toluchuri@optum.com; Author author@noreply.github.com Subject: Re: [sassoftware/viya-ark] Viya 3.5 Pre-Install failed while running pre_install_playbook.yml (#65)

I'm thinking maybe some RHEL repo isn't enabled that should be to pick up newer version of it. Are you using a mirror or direct to rhel's hosting? What does the output of yum repolist provide, and yum repoinfo for each RHEL repo provide?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/sassoftware/viya-ark/issues/65#issuecomment-668119994, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AET4YOM4IBUE2BZBP7S4OGTR63RIJANCNFSM4PTHCFCA.

This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately.

erharb commented 4 years ago

It appears the baseline required version of nss.x86_64 was made for Viya 3.5 to discontinue use of insecure TLS ciphers for various CVEs (nss >= 3.36.0-7, along with curl >= 7.19.7-53).

Newer versions are available from the official Red Hat repos some time after RHEL 7.4. You will need to work with Red Hat tech support on how to get the required versions of nss and curl for these security reasons, or upgrade to a newer version of RHEL 7.x which has the required versions.

erharb commented 4 years ago

I think RHEL 7.6 may be earliest version that comes with the correct version, also note that both 7.4 and 7.5 are already past their Red Hat extended update support lifecycle:

https://access.redhat.com/support/policy/updates/errata/

In Red Hat Enterprise Linux 7, EUS is available for the following releases:

7.1 (ended March 31, 2017) 7.2 (ended November 30, 2017) 7.3 (ended November 30, 2018) 7.4 (ends August 31, 2019) 7.5 (ends April 30, 2020) 7.6 (ends May 31, 2021) 7.7 (ends August 30, 2021; Final RHEL 7 EUS Release)

venkattoluchuri commented 4 years ago

If we do not have Install the version of (nss >= 3.36.0-7, along with curl >= 7.19.7-53) were there any issues with the Viya install ? So you recommend to have VM to be Redhat 7.7 instead 7.4 ?

erharb commented 4 years ago

Yes those versions of nss and curl are required for Viya 3.5 to install and run successfully due to SAS requirements for security. RHEL 7.6 or higher so 7.7 should be fine.

venkattoluchuri commented 4 years ago

This is a Azure linux VM. Can I upgrade 7.4 to 7.6 just doing these commands instead relaunch another VM and redo all work?

echo 7.6 > /etc/yum/vars/releasever sudo yum update

Get Outlook for Androidhttps://aka.ms/ghei36


From: Eric Harbeston notifications@github.com Sent: Monday, August 3, 2020 10:48:14 PM To: sassoftware/viya-ark viya-ark@noreply.github.com Cc: Toluchuri, Venkateswarlu venkat.toluchuri@optum.com; Author author@noreply.github.com Subject: Re: [sassoftware/viya-ark] Viya 3.5 Pre-Install failed while running pre_install_playbook.yml (#65)

Yes those versions of nss and curl are required for Viya 3.5 to install and run successfully due to SAS requirements for security. RHEL 7.6 or higher so 7.7 should be fine.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/sassoftware/viya-ark/issues/65#issuecomment-668140895, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AET4YOJBR4LNQ7H7ZOLW4F3R63WNNANCNFSM4PTHCFCA.

This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately.

erharb commented 4 years ago

I don't know, you'd need to ask Azure tech support in that case. Usually sudo yum upgrade but not sure