Ansible upgrade fails with error "Too many open files"

Solution In Progress - Updated -


During the ansible upgrade the following error is shown and the upgrade process fails:

<> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/25c15210b6 '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
The full traceback is:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ansible/executor/", line 125, in run
    res = self._execute()
  File "/usr/lib/python2.7/site-packages/ansible/executor/", line 521, in _execute
    result =
  File "/usr/lib/python2.7/site-packages/ansible/plugins/action/", line 45, in run
    results = merge_hash(results, self._execute_module(tmp=tmp, task_vars=task_vars, wrap_async=wrap_async))
  File "/usr/lib/python2.7/site-packages/ansible/plugins/action/", line 644, in _execute_module
    tmp = self._make_tmp_path()
  File "/usr/lib/python2.7/site-packages/ansible/plugins/action/", line 255, in _make_tmp_path
    tmpdir =  self._remote_expand_user(C.DEFAULT_REMOTE_TMP, sudoable=False)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/action/", line 552, in _remote_expand_user
    data = self._low_level_execute_command(cmd, sudoable=False)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/action/", line 890, in _low_level_execute_command
    rc, stdout, stderr = self._connection.exec_command(cmd, in_data=in_data, sudoable=sudoable)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/connection/", line 772, in exec_command
    (returncode, stdout, stderr) = self._run(cmd, in_data, sudoable=sudoable)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/connection/", line 72, in wrapped
    return_tuple = func(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/connection/", line 442, in _run
    p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "/usr/lib64/python2.7/", line 703, in __init__
    errread, errwrite), to_close = self._get_handles(stdin, stdout, stderr)
  File "/usr/lib64/python2.7/", line 1134, in _get_handles
    errread, errwrite = self.pipe_cloexec()
  File "/usr/lib64/python2.7/", line 1168, in pipe_cloexec
    r, w = os.pipe()
OSError: [Errno 24] Too many open files
fatal: []: FAILED! => {
    "failed": true


Unexpected failure during module execution.


  • Openshift Container Platform 3.4
  • Extra Packages for Enterprise Linux (EPEL) repository installed

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In