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

ValueError: filedescriptor out of range in select() #254

Closed
ipv6freely opened this issue Jul 19, 2018 · 9 comments
Closed

ValueError: filedescriptor out of range in select() #254

ipv6freely opened this issue Jul 19, 2018 · 9 comments

Comments

@ipv6freely
Copy link

I'm using nornir to automate configuration of about 400 devices in parallel.

I'm getting this traceback:

Traceback (most recent call last):
  File "/Users/cjones/.local/share/virtualenvs/python-LG6-DRlH/lib/python3.6/site-packages/jnpr/junos/device.py", line 1251, in open
    device_params={'name': 'junos', 'local': False})
  File "/Users/cjones/.local/share/virtualenvs/python-LG6-DRlH/lib/python3.6/site-packages/ncclient/manager.py", line 162, in connect
    return connect_ssh(*args, **kwds)
  File "/Users/cjones/.local/share/virtualenvs/python-LG6-DRlH/lib/python3.6/site-packages/ncclient/manager.py", line 127, in connect_ssh
    session.connect(*args, **kwds)
  File "/Users/cjones/.local/share/virtualenvs/python-LG6-DRlH/lib/python3.6/site-packages/ncclient/transport/ssh.py", line 451, in connect
    self._post_connect()
  File "/Users/cjones/.local/share/virtualenvs/python-LG6-DRlH/lib/python3.6/site-packages/ncclient/transport/session.py", line 107, in _post_connect
    raise error[0]
  File "/Users/cjones/.local/share/virtualenvs/python-LG6-DRlH/lib/python3.6/site-packages/ncclient/transport/ssh.py", line 539, in run
    r, w, e = select([chan], [], [], TICK)
ValueError: filedescriptor out of range in select()

A lot of googling has brought me to the same conclusion - that select() should be replaced with kqueue. Have a look at these:

ansible/ansible#10157
ansible/ansible#20934

I'm on macOS 10.14 using python 3.6. I have already tried increasing the open files limit on my system to 200,000 but that hasn't helped.

@einarnn
Copy link
Contributor

einarnn commented Jul 23, 2018

Please take a look at and test the patch from #258. This patches the SSHSession to use the selectors module on Python 3.x and selectors2 module on Python 2.7

@ipv6freely
Copy link
Author

Fantastic. Will try and report back.

@einarnn
Copy link
Contributor

einarnn commented Jul 23, 2018

Great, thanks! I meant to ask explicitly if you could test in your scaled environment as I don't have one currently.

Cheers,

Einar

@ipv6freely
Copy link
Author

I assumed that's what you meant :)

@einarnn
Copy link
Contributor

einarnn commented Jul 28, 2018

Due to a mistaken commit, these changes are now in PR #260. Sorry for any inconvenience.

@ipv6freely
Copy link
Author

PR #260 seems to have cleared up my issues!

@einarnn
Copy link
Contributor

einarnn commented Aug 9, 2018

Great! Will see if I can get that committed and spin a new release.

@einarnn
Copy link
Contributor

einarnn commented Aug 20, 2018

Addressed in #260.

@einarnn einarnn closed this as completed Aug 20, 2018
@einarnn
Copy link
Contributor

einarnn commented Aug 21, 2018

Released in 0.6.2, up on PyPi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants