Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
venkattoluchuri opened this issue Aug 3, 2020 · 22 comments
Closed

Comments

@venkattoluchuri
Copy link

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/AnsiballZ_setup.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
Copy link
Member

erharb commented Aug 3, 2020

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
Copy link
Author

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
Copy link
Member

erharb commented Aug 3, 2020

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
Copy link
Author

[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
Copy link
Collaborator

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
Copy link
Member

erharb commented Aug 3, 2020

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
Copy link
Author

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
Copy link
Member

erharb commented Aug 3, 2020

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):

ansible-collections/community.kubernetes#135 (comment)

@venkattoluchuri
Copy link
Author

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
Copy link
Member

erharb commented Aug 3, 2020

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
Copy link
Author

[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
Copy link
Member

erharb commented Aug 3, 2020

Is deployTarget same host as the local host running ansible?

@venkattoluchuri
Copy link
Author

yes. it is a single machine

@venkattoluchuri
Copy link
Author

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
Copy link
Member

erharb commented Aug 3, 2020

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
Copy link
Author

venkattoluchuri commented Aug 3, 2020 via email

@erharb
Copy link
Member

erharb commented Aug 3, 2020

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 erharb closed this as completed Aug 3, 2020
@erharb
Copy link
Member

erharb commented Aug 3, 2020

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
Copy link
Author

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
Copy link
Member

erharb commented Aug 3, 2020

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
Copy link
Author

venkattoluchuri commented Aug 3, 2020 via email

@erharb
Copy link
Member

erharb commented Aug 3, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants