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

Ansible 2.4.1.0 fails on nodes with python 2.4.3 #33101

Closed
fadeldamen opened this Issue Nov 20, 2017 · 9 comments

Comments

Projects
None yet
8 participants
@fadeldamen

fadeldamen commented Nov 20, 2017

ISSUE TYPE
  • Bug Report
COMPONENT NAME

plugins ping

ANSIBLE VERSION
ansible 2.4.1.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/xxx/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.13 (default, Jan 19 2017, 14:48:08) [GCC 6.3.0 20170118]

CONFIGURATION

ansible-config dump --only-changed
COLOR_VERBOSE(/etc/ansible/ansible.cfg) = white

OS / ENVIRONMENT
SUMMARY

Ansible fails to run on nodes with python 2.4.3

STEPS TO REPRODUCE

ansible -vvvv ext -i clientes_hosts -m ping

EXPECTED RESULTS
ACTUAL RESULTS
SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/home/xxx/xxx/chaves/llave-infra-V1-des.pem"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/xxx/.ansible/cp/79db15d0e1 -tt 10.246.0.34 '/bin/sh -c '"'"'/usr/bin/python /root/.ansible/tmp/ansible-tmp-1511198958.71-82758060590735/ping.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1511198958.71-82758060590735/" > /dev/null 2>&1 && sleep 0'"'"''
<10.246.0.34> (0, '  File "/tmp/ansible_KSW3Sg/ansible_module_ping.py", line 8\r\n    from __future__ import absolute_import, division, print_function\r\nSyntaxError: future feature absolute_import is not defined\r\n', 'OpenSSH_7.4p1 Ubuntu-10, OpenSSL 1.0.2g  1 Mar 2016\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 23239\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\nShared connection to 10.246.0.34 closed.\r\n')
10.246.0.34 | FAILED! => {
    "changed": false, 
    "failed": true, 
    "module_stderr": "OpenSSH_7.4p1 Ubuntu-10, OpenSSL 1.0.2g  1 Mar 2016\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 23239\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\nShared connection to 10.246.0.34 closed.\r\n", 
    "module_stdout": "  File \"/tmp/ansible_KSW3Sg/ansible_module_ping.py\", line 8\r\n    from __future__ import absolute_import, division, print_function\r\nSyntaxError: future feature absolute_import is not defined\r\n", 
    "msg": "MODULE FAILURE", 
    "rc": 0
}

@ansibot

This comment has been minimized.

Contributor

ansibot commented Nov 20, 2017

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@bcoca

This comment has been minimized.

Member

bcoca commented Nov 20, 2017

Possible Misunderstanding

Hi!

Thanks very much for your submission to Ansible. It sincerely means a lot to us.

We believe the ticket you have filed is being somewhat misunderstood, as one thing works a little differently than stated.

Ansible 2.4 dropped support for Python 2.4 and 2.5, so it is not expected to work on such nodes. You can either upgrade/install a supported Python version or use Ansible 2.3

In the future, this might be a topic more well suited for the user list, which you can also post here if you'd like some more help with the above.

Thank you once again for this and your interest in Ansible!

@bcoca bcoca closed this Nov 20, 2017

@biji

This comment has been minimized.

biji commented Jan 2, 2018

I have similiar error when gathering facts for centos 5.9

"module_stdout": "  File \"/tmp/ansible_OmQA2x/ansible_module_setup.py\", line 7\r\n    from __future__ import absolute_import, division, print_function\r\nSyntaxError: future feature absolute_import is not defined\r\n"

Workaround is using ansible 2.3:

virtualenv env
source env/bin/activate
pip install 'ansible==2.3'
@Akasurde

This comment has been minimized.

Member

Akasurde commented Jan 2, 2018

@biji What is your Python version ? if it is 2.4, it is not supported.

@biji

This comment has been minimized.

biji commented Jan 2, 2018

nodes are using Python 2.4.3, control is Python 2.7.14
I ended up using ansible 2.3 because 4 of the 17 servers are still centos 5.9

@athmane

This comment has been minimized.

athmane commented Jan 10, 2018

CentOS 5.x (EOL btw) targets are easy to fix, just use raw module to bootstrap python26 from epel and add ansible_python_interpreter=/usr/bin/python26 suffix (if using flat inventory)

@ansibot ansibot added bug and removed bug_report labels Mar 7, 2018

@UnitedMarsupials

This comment has been minimized.

UnitedMarsupials commented Jul 10, 2018

@athman, that's only "easy" for people with superuser access. I use Ansible to maintain my own home-directories and ssh-keys on hundreds of machines. Being unable to do that with the older RHEL-5 servers is a big disappointment. I'd understand, why Ansible developers may not want to create new code maintaining backwards compatibility, but they could've kept the already-written implementations -- and use them automatically upon detecting older Python-versions on the remote.

It is, probably, too late now, but, given Python's disregard for backwards compatibility, the issue is likely to popup again in the future, when today's latest versions become "legacy"...

@calston

This comment has been minimized.

calston commented Oct 8, 2018

To be clear Python doesn't "disregard backwards compatibility", Ansible did when they chose to use features with big fat warnings all over the library documentation.

@UnitedMarsupials

This comment has been minimized.

UnitedMarsupials commented Oct 9, 2018

To be clear Python doesn't "disregard backwards compatibility"

Although Ruby's disaster between 1.8 and 1.9 was worse, of course, to a Tcl-bigot like myself, the Python-2.x vs. Python-3.x controversy is quite mind-boggling...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment