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

/bin/sh: Ileagal instruction (coredump) when trying to use copy module with AIX #8310

Closed
cmlsharp opened this issue Jul 28, 2014 · 8 comments
Labels
aix AIX community bug This issue/PR relates to a bug.

Comments

@cmlsharp
Copy link

Issue Type:

Bug Report

Ansible Version:

ansible 1.7 (devel 75e5b64) last updated 2014/07/22 14:37:30 (GMT -400)

Environment:

RHEL 6 managing AIX

Summary:

Ansible fails when using copy module on AIX

Steps To Reproduce:

Attempt to copy file to AIX with Python 2.7.8 using copy module

Expected Results:

The file copies successfully

Actual Results:
<fdb> ESTABLISH CONNECTION FOR USER: root on PORT 22 TO fdb
<fdb> EXEC /bin/sh -c 'rc=0; [ -r "/testfile" ] || rc=2; [ -f "/testfile" ] || rc=1; [ -d "/testfile" ] && echo 3 && exit 0; (/usr/bin/md5sum /testfile 2>/dev/null) || (/sbin/md5sum -q /testfile 2>/dev/null) || (/usr/bin/digest -a md5 /testfile 2>/dev/null) || (/sbin/md5 -q /testfile 2>/dev/null) || (/usr/bin/md5 -n /testfile 2>/dev/null) || (/bin/md5 -q /testfile 2>/dev/null) || (/usr/bin/csum -h MD5 /testfile 2>/dev/null) || (/bin/csum -h MD5 /testfile 2>/dev/null) || (echo "${rc} /testfile")'
<fdb> EXEC /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1406560163.65-86612973678860 && echo $HOME/.ansible/tmp/ansible-tmp-1406560163.65-86612973678860'
<fdb> PUT /testfile TO /home/root/.ansible/tmp/ansible-tmp-1406560163.65-86612973678860/source
<fdb> PUT /tmp/tmpcKn29o TO /home/root/.ansible/tmp/ansible-tmp-1406560163.65-86612973678860/copy
<fdb> EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/local/python/python /home/root/.ansible/tmp/ansible-tmp-1406560163.65-86612973678860/copy; rm -rf /home/root/.ansible/tmp/ansible-tmp-1406560163.65-86612973678860/ >/dev/null 2>&1'
fdb | FAILED >> {
    "failed": true,
    "md5sum": "d41d8cd98f00b204e9800998ecf8427e",
    "msg": "/bin/sh: 5046336 Illegal instruction(coredump)\n",
    "parsed": false
}
@cmlsharp
Copy link
Author

Note: I found somewhere on the internet that linking /usr/bin/md5sum and /usr/bin/csum was supposed to work. It didn't. I even copied the md5sum binary and libraries from another AIX box. Still didn't work.

@mpdehaan
Copy link
Contributor

Hmm, that's unusual.

Can you paste the copy line in your playbook that you were executing here (the copy line?)

I don't have an AIX machine in my test infrastructure, is this something you can perhaps help debug?

@cmlsharp
Copy link
Author

Unfortunately, my internship at the place where I was having this issue is now over due to school starting. I'm sorry

@iain2k
Copy link

iain2k commented Sep 8, 2014

I have stumbled across the same bug when trying to copy or get the 'stat' from remote a file for example on AIX hosts.

$ ansible aixbox -i -m copy -a 'src=boo.txt dest=/tmp'

aixbox | FAILED >> {
"failed": true,
"md5sum": "1637756e68f9f131dee6aeacd137a5ca",
"msg": "/bin/sh: 5898308 Illegal instruction(coredump)\r\n",
"parsed": false
}

With verbose output.

ansible -vvvv aixbox -i aix_inventory -m copy -a 'src=boo.txt dest=/tmp'
ESTABLISH CONNECTION FOR USER: iain
EXEC ['ssh', '-C', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/Users/iain/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'StrictHostKeyChecking=no', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'User=iain', '-o', 'ConnectTimeout=10', 'aixbox', u'/bin/sh -c 'rc=0; [ -r "/tmp" ] || rc=2; [ -f "/tmp" ] || rc=1; [ -d "/tmp" ] && echo 3 && exit 0; (/usr/bin/md5sum /tmp 2>/dev/null) || (/sbin/md5sum -q /tmp 2>/dev/null) || (/usr/bin/digest -a md5 /tmp 2>/dev/null) || (/sbin/md5 -q /tmp 2>/dev/null) || (/usr/bin/md5 -n /tmp 2>/dev/null) || (/bin/md5 -q /tmp 2>/dev/null) || (/usr/bin/csum -h MD5 /tmp 2>/dev/null) || (/bin/csum -h MD5 /tmp 2>/dev/null) || (echo "${rc} /tmp")'']
EXEC ['ssh', '-C', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/Users/iain/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'StrictHostKeyChecking=no', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'User=iain', '-o', 'ConnectTimeout=10', 'aixbox', u'/bin/sh -c 'rc=0; [ -r "/tmp/boo.txt" ] || rc=2; [ -f "/tmp/boo.txt" ] || rc=1; [ -d "/tmp/boo.txt" ] && echo 3 && exit 0; (/usr/bin/md5sum /tmp/boo.txt 2>/dev/null) || (/sbin/md5sum -q /tmp/boo.txt 2>/dev/null) || (/usr/bin/digest -a md5 /tmp/boo.txt 2>/dev/null) || (/sbin/md5 -q /tmp/boo.txt 2>/dev/null) || (/usr/bin/md5 -n /tmp/boo.txt 2>/dev/null) || (/bin/md5 -q /tmp/boo.txt 2>/dev/null) || (/usr/bin/csum -h MD5 /tmp/boo.txt 2>/dev/null) || (/bin/csum -h MD5 /tmp/boo.txt 2>/dev/null) || (echo "${rc} /tmp/boo.txt")'']
EXEC ['ssh', '-C', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/Users/iain/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'StrictHostKeyChecking=no', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'User=iain', '-o', 'ConnectTimeout=10', 'aixbox', "/bin/sh -c 'mkdir -p /var/tmp/$USER/ansible/tmp/ansible-tmp-1410192465.98-122879759656905 && chmod a+rx /var/tmp/$USER/ansible/tmp/ansible-tmp-1410192465.98-122879759656905 && echo /var/tmp/$USER/ansible/tmp/ansible-tmp-1410192465.98-122879759656905'"]
PUT /Users/iain/src/ldap/boo.txt TO /var/tmp/iain/ansible/tmp/ansible-tmp-1410192465.98-122879759656905/source
PUT /var/folders/5r/0xk7yrkj5b98k_sc1zw4k4ym0000gn/T/tmphf2YOq TO /var/tmp/iain/ansible/tmp/ansible-tmp-1410192465.98-122879759656905/copy
EXEC ['ssh', '-C', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/Users/iain/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'StrictHostKeyChecking=no', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'User=iain', '-o', 'ConnectTimeout=10', 'aixbox', u"/bin/sh -c 'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python /var/tmp/iain/ansible/tmp/ansible-tmp-1410192465.98-122879759656905/copy; rm -rf /var/tmp/iain/ansible/tmp/ansible-tmp-1410192465.98-122879759656905/ >/dev/null 2>&1'"]
aixbox | FAILED >> {
"failed": true,
"md5sum": "1637756e68f9f131dee6aeacd137a5ca",
"msg": "/bin/sh: 9109528 Illegal instruction(coredump)\r\nOpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011\ndebug1: Reading configuration data /Users/iain/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh_config\r\ndebug1: /etc/ssh_config line 20: Applying options for *\r\ndebug1: /etc/ssh_config line 53: 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 = 31428\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 aixbox closed.\r\n",
"parsed": false
}

This leaves a core file from Python in my home directory so it may be a bug in Python not Ansible.

$ file core
core: AIX core file fulldump 32-bit, python2.7

I have access to AIX servers and can help debug.

Iain

@iain2k
Copy link

iain2k commented Sep 9, 2014

If I disable md5 checksums when using the stat module it runs successfully.

---
  - hosts: aixbox

    tasks:

      - name: Stat file
        stat: path=/tmp/boo.txt get_md5=no
        register: st

@iain2k
Copy link

iain2k commented Sep 9, 2014

Okay basically hashlib is broken on AIX Python using the rpm's from AIX Linux Toolbox http://www-03.ibm.com/systems/power/software/aix/linux/

$ python
Python 2.7.5 (default, Aug 16 2013, 14:02:06) [C] on aix6
Type "help", "copyright", "credits" or "license" for more information.
>>> import hashlib
>>> hashlib.sha256(b"x"*200000).hexdigest() 
Illegal instruction (core dumped)

Salt users seem to be having the same problem.

https://groups.google.com/forum/#!msg/salt-users/bwW0gxzv5Oc/rVEyCbklQd4J

Iain

@cmlsharp
Copy link
Author

It should be noted that on the AIX servers I used, I compiled Python 2.7 from source with gcc rather than installing from AIX toolbox

@mpdehaan
Copy link
Contributor

Hi!

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

On September 26, 2014, due to enormous levels of contribution to the project Ansible decided to reorganize module repos, making it easier
for developers to work on the project and for us to more easily manage new contributions and tickets.

We split modules from the main project off into two repos, http://github.com/ansible/ansible-modules-core and http://github.com/ansible/ansible-modules-extras

If you would still like this ticket attended to, we will need your help in having it reopened in one of the two new repos, and instructions are provided below.

We apologize that we are not able to make this transition happen seamlessly, though this is a one-time change and your help is greatly appreciated --
this will greatly improve velocity going forward.

Both sets of modules will ship with Ansible, though they'll receive slightly different ticket handling.

To locate where a module lives between 'core' and 'extras'

Additionally, should you need more help with this, you can ask questions on:

Thank you very much!

@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 6, 2018
@dagwieers dagwieers added the aix AIX community label Jan 8, 2019
@ansible ansible locked and limited conversation to collaborators Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
aix AIX community bug This issue/PR relates to a bug.
Projects
None yet
Development

No branches or pull requests

5 participants