Ansible 1.3 Command Module: "OSError: [Errno 24] Too many open files"

498 views
Skip to first unread message

Matt Ferrante

unread,
Sep 18, 2013, 5:43:32 PM9/18/13
to ansible...@googlegroups.com
I started using Ansible 1.3.0, installed via pip, and have a found an issue that went away when I used Ansible 1.2.2 (the version I was previously using) instead. I have gone back to 1.2.2 for increased stability.

I did not see this error every time I used the command module, only in some places, particularly with extracting a tarball and with making or installing. On the commands that it happens to, it happens every time.

Command:
command: /bin/tar xfz libvorbis-1.3.3.tar.gz chdir=/var/tmp/ansible creates=/var/tmp/ansible/libvorbis-1.3.3

Error:

TASK: [unpack libvorbis-1.3.3] ************************************************ 
fatal: [ui.test.net] => Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/ansible/runner/__init__.py", line 382, in _executor
    exec_rc = self._executor_internal(host, new_stdin)
  File "/Library/Python/2.7/site-packages/ansible/runner/__init__.py", line 471, in _executor_internal
    return self._executor_internal_inner(host, self.module_name, self.module_args, inject, port, complex_args=complex_args)
  File "/Library/Python/2.7/site-packages/ansible/runner/__init__.py", line 654, in _executor_internal_inner
    result = handler.run(conn, tmp, module_name, module_args, inject, complex_args)
  File "/Library/Python/2.7/site-packages/ansible/runner/action_plugins/normal.py", line 54, in run
    return self.runner._execute_module(conn, tmp, module_name, module_args, inject=inject, complex_args=complex_args)
  File "/Library/Python/2.7/site-packages/ansible/runner/__init__.py", line 290, in _execute_module
    (remote_module_path, module_style, shebang) = self._copy_module(conn, tmp, module_name, args, inject, complex_args)
  File "/Library/Python/2.7/site-packages/ansible/runner/__init__.py", line 845, in _copy_module
    self._transfer_str(conn, tmp, module_name, module_data)
  File "/Library/Python/2.7/site-packages/ansible/runner/__init__.py", line 256, in _transfer_str
    conn.put_file(afile, remote)
  File "/Library/Python/2.7/site-packages/ansible/runner/connection_plugins/ssh.py", line 268, in put_file
    stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1120, in _execute_child
    errpipe_read, errpipe_write = os.pipe()
OSError: [Errno 24] Too many open files


Dag Wieers

unread,
Sep 18, 2013, 5:59:37 PM9/18/13
to ansible...@googlegroups.com
On Wed, 18 Sep 2013, Matt Ferrante wrote:

> I started using Ansible 1.3.0, installed via pip, and have a found an issue
> that went away when I used Ansible 1.2.2 (the version I was previously
> using) instead. I have gone back to 1.2.2 for increased stability.
>
> I did not see this error every time I used the command module, only in some
> places, particularly with extracting a tarball and with making or
> installing. On the commands that it happens to, it happens every time.

Try increasing the number of open files (nofile). Look at the "ulimit -a"
output. Then add something like below to
/etc/security/limits.d/99-nofile.conf:

* soft nofile 10240

Test again by re-login to the system with the user having this problem.

(Feel free to replace * with the user that requires this change, and
10240 with something more suitable for your environment, maybe unlimited)

Kind regards,
--
-- dag wieers, d...@wieers.com, http://dag.wieers.com/
-- dagit linux solutions, con...@dagit.net, http://dagit.net/

[Any errors in spelling, tact or fact are transmission errors]

Michael DeHaan

unread,
Sep 18, 2013, 6:11:17 PM9/18/13
to ansible...@googlegroups.com
Incidentally I believe we have a pull request for a fix to pty handling that should address most of this.

It's in queue for testing:





--
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-project+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Michael DeHaan <mic...@ansibleworks.com>
CTO, AnsibleWorks, Inc.
http://www.ansibleworks.com/

Matt Ferrante

unread,
Sep 19, 2013, 10:51:30 AM9/19/13
to ansible...@googlegroups.com
That pull request looks like it would do the trick. The max number of files I have is 100000, that should be sufficient to do a lot, I wouldn't expect to have to raise it any further.


--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/erj1KLbPl9M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages