Skip to content

Failed to create a PTY. Operation not permitted [on CentOS7] #462

Closed
@yhafri

Description

@yhafri

I'm getting the following error when running my playbook to update a remote CentOS7 machine
(the same playbook works perfectly well on all my Ubuntu instances).

  ____________
< PLAY [all] >
 ------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

 ________________________
< TASK [Gathering Facts] >
 ------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

fatal: [centos7]: FAILED! => {"msg": "error occurred on host xxx.xxx.xxx.xxx: Failed to create a PTY: [Errno 1] Operation not permitted. It is likely the maximum number of PTYs has been reached. Consider increasing the 'kern.tty.ptmx_max' sysctl on OS X, the 'kernel.pty.max' sysctl on Linux, or modifying your configuration to avoid PTY use."}
        to retry, use: --limit @/Users/xxx/ansible/script/update.retry
 ____________
< PLAY RECAP >
 ------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

centos7                 : ok=0    changed=0    unreachable=0    failed=1

My CentOS7 instance has enough PTYs as you can see:

# sysctl kernel.pty.max
kernel.pty.max = 5120

Moreover, it's an idle machine. No service is running on it except the default ones.

My host config is:

  1. macOS High Sierra 10.13.6
  2. Mitogen from GIT master (ec05604)
  3. Python
$ python
Python 2.7.15 (default, Oct  2 2018, 11:47:18)
[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
  1. Ansible from brew
$ ansible --version 
ansible 2.7.5
  config file = /Users/xxx/.ansible.cfg
  configured module search path = ['/Users/xxx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/2.7.5/libexec/lib/python3.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.7.1 (default, Nov 28 2018, 11:51:54) [Clang 10.0.0 (clang-1000.11.45.5)]
  1. My ~/.ansible.cfg is:
[ssh_connection]
retries=3
pipelining = True

[defaults]
timeout = 20
host_key_checking = False
ssh_args = -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ServerAliveInterval=60
strategy_plugins = ~/.ansible/plugins/mitogen/ansible_mitogen/plugins/strategy
strategy = mitogen_linear

[ IMPORTANT ]
if I disable mitogen, the playbook works well for CentOS7 !!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    ansibleIssues relating to Mitogen for AnsiblesudoIssues impacting mostly sudo.pyuser-reported

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions