IOError: [Errno 25] Inappropriate ioctl for device

1,184 views
Skip to first unread message

P

unread,
Apr 8, 2015, 7:56:12 AM4/8/15
to ansible...@googlegroups.com
Hi all,

while trying to run one of our playbook on RH 5.4 (I know, very old ....) I get the following error:

# ansible-playbook -i hosts.local our_playbook.yml  --limit=server --tags=some-users

PLAY [some.hosts] ***********************************************************

GATHERING FACTS ***************************************************************
failed: [server] => {"failed": true, "parsed": false}
Traceback (most recent call last):
  File "/tmp/ansible-tmp-1428493209.39-20760333181803/setup", line 4194, in ?
    main()
  File "/tmp/ansible-tmp-1428493209.39-20760333181803/setup", line 137, in main
    data = run_setup(module)
  File "/tmp/ansible-tmp-1428493209.39-20760333181803/setup", line 81, in run_setup
    facts = ansible_facts(module)
  File "/tmp/ansible-tmp-1428493209.39-20760333181803/setup", line 4133, in ansible_facts
    facts.update(Hardware().populate())
  File "/tmp/ansible-tmp-1428493209.39-20760333181803/setup", line 2319, in populate
    self.get_device_facts()
  File "/tmp/ansible-tmp-1428493209.39-20760333181803/setup", line 2514, in get_device_facts
    d[key] = get_file_content(sysdir + "/device/" + key)
  File "/tmp/ansible-tmp-1428493209.39-20760333181803/setup", line 4123, in get_file_content
    data = datafile.read().strip()
IOError: [Errno 25] Inappropriate ioctl for device

I tried to debug it with export ANSIBLE_KEEP_REMOTE_FILES=1 and then:

python -m trace --trace /tmp/ansible-tmp-1428493209.39-20760333181803/setup

and it hangs:

subprocess.py(934):                     if p2cread:
subprocess.py(936):                     if c2pwrite:
subprocess.py(937):                         os.dup2(c2pwrite, 1)
                                                                                          <------------------- HANGS ! Have to CTRL-C it ....
setup(1699):         except (OSError, IOError), e:
setup(1701):         except:
setup(1702):             self.fail_json(rc=257, msg=traceback.format_exc(), cmd=clean_args)
 --- modulename: traceback, funcname: format_exc

Can anybody tell what is wrong with it ? I know that this is very old Red Hat but on another node (even older !)
it run without any issue.

Brian Coca

unread,
Apr 8, 2015, 8:57:48 AM4/8/15
to ansible...@googlegroups.com
What version of ansible? i believe these issues were already fixed.

--
Brian Coca

P

unread,
Apr 8, 2015, 9:00:43 AM4/8/15
to ansible...@googlegroups.com
# ansible-playbook --version
ansible-playbook 1.8.4
  configured module search path = /usr/share/ansible


Brian Coca

unread,
Apr 8, 2015, 10:12:13 AM4/8/15
to ansible...@googlegroups.com
try current development
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/e8598ee9-3cc4-405a-b702-51028044d07c%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
Brian Coca

P

unread,
Apr 8, 2015, 10:35:30 AM4/8/15
to ansible...@googlegroups.com
You mean 1.9 or 2.0 ?
I am afraid to use it since we constantly use Ansible on our production.

Brian Coca

unread,
Apr 8, 2015, 12:03:43 PM4/8/15
to ansible...@googlegroups.com
The current git checkout, its easy to use in parallel of any other
version and only for this test

--
Brian Coca

P

unread,
Apr 9, 2015, 3:51:20 AM4/9/15
to ansible...@googlegroups.com
# git clone git://github.com/ansible/ansible.git --recursive
Initialized empty Git repository in /tmp/a/ansible/.git/
remote: Counting objects: 78344, done.
remote: Compressing objects: 100% (42/42), done.
remote: Total 78344 (delta 12), reused 0 (delta 0), pack-reused 78300
Receiving objects: 100% (78344/78344), 24.00 MiB | 6.46 MiB/s, done.
Resolving deltas: 100% (49276/49276), done.
Submodule 'lib/ansible/modules/core' (https://github.com/ansible/ansible-modules-core.git) registered for path 'lib/ansible/modules/core'
Submodule 'lib/ansible/modules/extras' (https://github.com/ansible/ansible-modules-extras.git) registered for path 'lib/ansible/modules/extras'
Submodule 'v2/ansible/modules/core' (https://github.com/ansible/ansible-modules-core.git) registered for path 'v2/ansible/modules/core'
Submodule 'v2/ansible/modules/extras' (https://github.com/ansible/ansible-modules-extras.git) registered for path 'v2/ansible/modules/extras'
Initialized empty Git repository in /tmp/a/ansible/lib/ansible/modules/core/.git/
remote: Counting objects: 22403, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 22403 (delta 1), reused 0 (delta 0), pack-reused 22396
Receiving objects: 100% (22403/22403), 6.24 MiB | 3.91 MiB/s, done.
Resolving deltas: 100% (14887/14887), done.
Submodule path 'lib/ansible/modules/core': checked out '5f58240d176a74b8eb0da0b45cf60e498d11ab34'
Initialized empty Git repository in /tmp/a/ansible/lib/ansible/modules/extras/.git/
remote: Counting objects: 20489, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 20489 (delta 2), reused 0 (delta 0), pack-reused 20478
Receiving objects: 100% (20489/20489), 5.64 MiB | 3.19 MiB/s, done.
Resolving deltas: 100% (13508/13508), done.
Submodule path 'lib/ansible/modules/extras': checked out '4048de9c1e2333aa7880b61f34af8cbdce5cbcec'
Initialized empty Git repository in /tmp/a/ansible/v2/ansible/modules/core/.git/
remote: Counting objects: 22403, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 22403 (delta 1), reused 0 (delta 0), pack-reused 22396
Receiving objects: 100% (22403/22403), 6.24 MiB | 2.94 MiB/s, done.
Resolving deltas: 100% (14887/14887), done.
Submodule path 'v2/ansible/modules/core': checked out '34784b7a617aa35d3b994c9f0795567afc6fb0b0'
Initialized empty Git repository in /tmp/a/ansible/v2/ansible/modules/extras/.git/
remote: Counting objects: 20489, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 20489 (delta 2), reused 0 (delta 0), pack-reused 20478
Receiving objects: 100% (20489/20489), 5.64 MiB | 2.35 MiB/s, done.
Resolving deltas: 100% (13508/13508), done.
Submodule path 'v2/ansible/modules/extras': checked out '21fce8ac730346b4e77427e3582553f2dc93c675'
# cd ansible/
# git tag -l
0.0.1
0.0.2
0.01
0.3
0.3.1
0.4
0.4.1
0.5
0.6
0.7
0.7.1
0.7.2
0.8
v0.9
v1.0
v1.1
v1.2
v1.2.1
v1.2.2
v1.2.3
v1.3.0
v1.3.1
v1.3.2
v1.3.3
v1.3.4
v1.4.0
v1.4.1
v1.4.2
v1.4.3
v1.4.4
v1.4.5
v1.5.0
v1.5.1
v1.5.2
v1.5.3
v1.5.4
v1.5.5
v1.6.0
v1.6.1
v1.6.10
v1.6.2
v1.6.3
v1.6.4
v1.6.5
v1.6.6
v1.6.7
v1.6.8
v1.6.9
v1.7.0
v1.7.1
v1.7.2
v1.8.0
v1.8.1
v1.8.2
v1.8.3
v1.8.4
v1.9.0-0.1.rc1
v1.9.0-0.2.rc2
v1.9.0-1
v1.9.0-2
v1.9.0.1-1
v1.9.1-0.1.rc1
# source ./hacking/env-setup
running egg_info
creating lib/ansible.egg-info
writing requirements to lib/ansible.egg-info/requires.txt
writing lib/ansible.egg-info/PKG-INFO
writing top-level names to lib/ansible.egg-info/top_level.txt
writing dependency_links to lib/ansible.egg-info/dependency_links.txt
writing manifest file 'lib/ansible.egg-info/SOURCES.txt'
reading manifest file 'lib/ansible.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'v2'
no previously-included directories found matching 'docsite'
no previously-included directories found matching 'ticket_stubs'
no previously-included directories found matching 'packaging'
no previously-included directories found matching 'test'
no previously-included directories found matching 'hacking'
writing manifest file 'lib/ansible.egg-info/SOURCES.txt'

Setting up Ansible to run out of checkout...

PATH=/tmp/a/ansible/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
PYTHONPATH=/tmp/a/ansible/lib:
MANPATH=/tmp/a/ansible/docs/man:

Remember, you may wish to specify your host file with -i

Done!

# export PATH=/tmp/a/ansible/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
# export PYTHONPATH=/tmp/a/ansible/lib
# export MANPATH=/tmp/a/ansible/docs/man
# which ansible
/tmp/a/ansible/bin/ansible
# ansible --version
ansible 2.0.0 (devel 1e7f7bfc12) last updated 2015/04/09 07:38:32 (GMT +000)
  lib/ansible/modules/core: (detached HEAD 5f58240d17) last updated 2015/04/09 07:38:36 (GMT +000)
  lib/ansible/modules/extras: (detached HEAD 4048de9c1e) last updated 2015/04/09 07:38:40 (GMT +000)
  v2/ansible/modules/core: (detached HEAD 34784b7a61) last updated 2015/04/09 07:38:45 (GMT +000)
  v2/ansible/modules/extras: (detached HEAD 21fce8ac73) last updated 2015/04/09 07:38:49 (GMT +000)

  configured module search path = /usr/share/ansible
# ls -la
total 264
drwxr-xr-x 14 root root  4096 Apr  9 07:38 .
drwxr-xr-x  3 root root  4096 Apr  9 07:38 ..
drwxr-xr-x  2 root root  4096 Apr  9 07:38 bin
-rw-r--r--  1 root root 90807 Apr  9 07:38 CHANGELOG.md
-rw-r--r--  1 root root 10328 Apr  9 07:38 CODING_GUIDELINES.md
-rw-r--r--  1 root root  1446 Apr  9 07:38 CONTRIBUTING.md
-rw-r--r--  1 root root 35148 Apr  9 07:38 COPYING
-rw-r--r--  1 root root    61 Apr  9 07:38 .coveragerc
drwxr-xr-x  3 root root  4096 Apr  9 07:38 docs
drwxr-xr-x  7 root root  4096 Apr  9 07:38 docsite
drwxr-xr-x  4 root root  4096 Apr  9 07:38 examples
drwxr-xr-x  8 root root  4096 Apr  9 07:38 .git
-rw-r--r--  1 root root    25 Apr  9 07:38 .gitattributes
-rw-r--r--  1 root root   815 Apr  9 07:38 .gitignore
-rw-r--r--  1 root root   596 Apr  9 07:38 .gitmodules
drwxr-xr-x  3 root root  4096 Apr  9 07:38 hacking
-rw-r--r--  1 root root  2230 Apr  9 07:38 ISSUE_TEMPLATE.md
drwxr-xr-x  4 root root  4096 Apr  9 07:39 lib
-rw-r--r--  1 root root  8841 Apr  9 07:38 Makefile
-rw-r--r--  1 root root   456 Apr  9 07:38 MANIFEST.in
drwxr-xr-x  8 root root  4096 Apr  9 07:38 packaging
drwxr-xr-x  5 root root  4096 Apr  9 07:38 plugins
-rw-r--r--  1 root root  3789 Apr  9 07:38 README.md
-rw-r--r--  1 root root  2133 Apr  9 07:38 RELEASES.txt
-rw-r--r--  1 root root  1174 Apr  9 07:38 setup.py
drwxr-xr-x  4 root root  4096 Apr  9 07:38 test
-rw-r--r--  1 root root    62 Apr  9 07:38 test-requirements.txt
drwxr-xr-x  2 root root  4096 Apr  9 07:38 ticket_stubs
-rw-r--r--  1 root root   129 Apr  9 07:38 tox.ini
-rw-r--r--  1 root root   140 Apr  9 07:38 .travis.yml
drwxr-xr-x  8 root root  4096 Apr  9 07:38 v2
-rw-r--r--  1 root root    14 Apr  9 07:38 VERSION
# cd ..
# vi hosts
# ansible -i hosts all -m ping
node10 | success >> {
    "changed": false,
    "ping": "pong"
}

# cd /etc/ansible/playbooks/adhoc
# ansible-playbook -i hosts.local local.yml --limit=node10 --tags=users-local --list-tasks --list-hosts

Traceback (most recent call last):
  File "/tmp/a/ansible/bin/ansible-playbook", line 323, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/tmp/a/ansible/bin/ansible-playbook", line 209, in main
    force_handlers=options.force_handlers,
  File "/tmp/a/ansible/lib/ansible/playbook/__init__.py", line 180, in __init__
    (self.playbook, self.play_basedirs) = self._load_playbook_from_file(playbook, vars)
  File "/tmp/a/ansible/lib/ansible/playbook/__init__.py", line 257, in _load_playbook_from_file
    playbook_data = utils.parse_yaml_from_file(path, vault_password=self.vault_password)
  File "/tmp/a/ansible/lib/ansible/utils/__init__.py", line 778, in parse_yaml_from_file
    return parse_yaml(data, path_hint=path)
  File "/tmp/a/ansible/lib/ansible/utils/__init__.py", line 602, in parse_yaml
    loaded = yaml.load(data, Loader=Loader)
  File "/usr/lib64/python2.6/site-packages/yaml/__init__.py", line 73, in load
    loader.dispose()
AttributeError: 'CSafeLoader' object has no attribute 'dispose'

Brian Coca

unread,
Apr 9, 2015, 9:56:23 AM4/9/15
to ansible...@googlegroups.com
now it looks like your yaml library is not in sync with itself





--
Brian Coca

P

unread,
Apr 15, 2015, 6:17:43 AM4/15/15
to ansible...@googlegroups.com
On Wednesday, April 8, 2015 at 5:03:43 PM UTC+1, Brian Coca wrote:
The current git checkout, its easy to use in parallel of any other
version and only for this test

BTW, if I install it from github how do I switch between each release/branch ?

P

unread,
Apr 15, 2015, 6:18:38 AM4/15/15
to ansible...@googlegroups.com

I mean install it using git clone ...

Brian Coca

unread,
Apr 15, 2015, 9:53:05 AM4/15/15
to ansible...@googlegroups.com
git checkout
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/77c93b2f-6378-4b8e-8552-96180593f78c%40googlegroups.com.

P

unread,
May 19, 2015, 4:58:10 AM5/19/15
to ansible...@googlegroups.com
I have two yaml libraries: one is from standard RHEL 6 channel and the other is from pip.
Can I somehow point which should be used ?

P

unread,
May 19, 2015, 5:05:08 AM5/19/15
to ansible...@googlegroups.com
# git clone git://github.com/ansible/ansible.git --recursive
Initialized empty Git repository in /root/ansible/.git/
remote: Counting objects: 81678, done.
remote: Compressing objects: 100% (82/82), done.
remote: Total 81678 (delta 34), reused 0 (delta 0), pack-reused 81585
Receiving objects: 100% (81678/81678), 25.49 MiB | 6.33 MiB/s, done.
Resolving deltas: 100% (51049/51049), done.

Submodule 'lib/ansible/modules/core' (https://github.com/ansible/ansible-modules-core.git) registered for path 'lib/ansible/modules/core'
Submodule 'lib/ansible/modules/extras' (https://github.com/ansible/ansible-modules-extras.git) registered for path 'lib/ansible/modules/extras'
Submodule 'v2/ansible/modules/core' (https://github.com/ansible/ansible-modules-core.git) registered for path 'v2/ansible/modules/core'
Submodule 'v2/ansible/modules/extras' (https://github.com/ansible/ansible-modules-extras.git) registered for path 'v2/ansible/modules/extras'
Initialized empty Git repository in /root/ansible/lib/ansible/modules/core/.git/
remote: Counting objects: 23606, done.
remote: Total 23606 (delta 0), reused 0 (delta 0), pack-reused 23606
Receiving objects: 100% (23606/23606), 6.53 MiB | 2.11 MiB/s, done.
Resolving deltas: 100% (15652/15652), done.
Submodule path 'lib/ansible/modules/core': checked out '7dd9f57e161b78981eb797a4c77fd6e7042ad7fd'
Initialized empty Git repository in /root/ansible/lib/ansible/modules/extras/.git/
remote: Counting objects: 22327, done.
remote: Compressing objects: 100% (61/61), done.
remote: Total 22327 (delta 29), reused 0 (delta 0), pack-reused 22266
Receiving objects: 100% (22327/22327), 6.10 MiB | 2.66 MiB/s, done.
Resolving deltas: 100% (14724/14724), done.
Submodule path 'lib/ansible/modules/extras': checked out '576d94e8d4fa8e79216441efd65be62cfb0c603f'
Initialized empty Git repository in /root/ansible/v2/ansible/modules/core/.git/
remote: Counting objects: 23606, done.
remote: Total 23606 (delta 0), reused 0 (delta 0), pack-reused 23606
Receiving objects: 100% (23606/23606), 6.53 MiB | 2.42 MiB/s, done.
Resolving deltas: 100% (15652/15652), done.
Submodule path 'v2/ansible/modules/core': checked out '85c8a892c80b92730831d95fa654ef6d35b0eca0'
Initialized empty Git repository in /root/ansible/v2/ansible/modules/extras/.git/
remote: Counting objects: 22327, done.
remote: Compressing objects: 100% (61/61), done.
remote: Total 22327 (delta 29), reused 0 (delta 0), pack-reused 22266
Receiving objects: 100% (22327/22327), 6.10 MiB | 3.55 MiB/s, done.
Resolving deltas: 100% (14724/14724), done.
Submodule path 'v2/ansible/modules/extras': checked out '70ea05856356ad36f48b4bb7267d637efc56d292'
# cd ansible
v1.9.1-0.2.rc2
v1.9.1-0.3.rc3
v1.9.1-0.4.rc4
v1.9.1-1
v1.9.2-0.1.rc1
# git checkout v1.9.1-1
M       lib/ansible/modules/core
M       lib/ansible/modules/extras
M       v2/ansible/modules/core
M       v2/ansible/modules/extras
Note: checking out 'v1.9.1-1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at b47d1d7... Version bump for release 1.9.1-1

# source ./hacking/env-setup
running egg_info
creating lib/ansible.egg-info
writing requirements to lib/ansible.egg-info/requires.txt
writing lib/ansible.egg-info/PKG-INFO
writing top-level names to lib/ansible.egg-info/top_level.txt
writing dependency_links to lib/ansible.egg-info/dependency_links.txt
writing manifest file 'lib/ansible.egg-info/SOURCES.txt'
reading manifest file 'lib/ansible.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'v2'
no previously-included directories found matching 'docsite'
no previously-included directories found matching 'ticket_stubs'
no previously-included directories found matching 'packaging'
no previously-included directories found matching 'test'
no previously-included directories found matching 'hacking'
writing manifest file 'lib/ansible.egg-info/SOURCES.txt'
rm: descend into directory `/root/ansible/lib/ansible.egg-info'?

And now what should be my answer here ?
And why, when I did the previous installation (a few posts above) it didn't ask me that question ?
Has anything changed in the meantime ?

Reply all
Reply to author
Forward
0 new messages