question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ssh_config_file fails with "too many open files"

See original GitHub issue

When opening 100+ connections, and passing in ssh_config_file as part of the driver config, I get the following:

File "/home/jf/.local/lib/python3.8/site-packages/scrapli/driver/core/cisco_iosxe/async_driver.py", line 132, in __init__
File "/home/jf/.local/lib/python3.8/site-packages/scrapli/driver/network/async_driver.py", line 48, in __init__
File "/home/jf/.local/lib/python3.8/site-packages/scrapli/driver/generic/async_driver.py", line 40, in __init__
File "/home/jf/.local/lib/python3.8/site-packages/scrapli/driver/base/async_driver.py", line 13, in __init__
File "/home/jf/.local/lib/python3.8/site-packages/scrapli/driver/base/base_driver.py", line 178, in __init__
File "/home/jf/.local/lib/python3.8/site-packages/scrapli/driver/base/base_driver.py", line 381, in _update_ssh_args_from_ssh_config
File "/home/jf/.local/lib/python3.8/site-packages/scrapli/ssh_config.py", line 75, in __init__
OSError: [Errno 24] Too many open files: 'ssh_config.conf'

Steps to reproduce the behavior: open 100+ connections using the following Driver dict

conn_info = {
      "host": ip, 
      "auth_username": ssh_username, 
      "auth_password": ssh_password,
      "auth_strict_key": False,
      "transport": "asyncssh",
      "driver": AsyncIOSXEDriver,
      "ssh_config_file" : "ssh_config.conf",
      }
  }

  • OS: Ubuntu 20

Am I misusing the scrapli config? It could be good to to pass the config in as a string instead of a file path and leave the file handle management to the user.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
forrejamcommented, Aug 30, 2021

Hi @carlmontanari , I am sorry I was not able to test this as my project got delayed, I should be able to test this again in the coming weeks I will let you know.

0reactions
carlmontanaricommented, Aug 30, 2021

Ohhhhhh… I don’t think it was you! It was me 😭 Looked at git blame cuz that sounded wrong/bad and found this – so if you were on 2021.01.30 and recently upgraded to 2021.07.30 you should be good w/ either context manager or just await close.

In any case, really appreciate the updates and glad it is working out well for you – thousands of devices sounds pretty awesome 😁 !!

Carl

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix the 'Too Many Open Files' Error in Linux?
Very often 'too many open files' errors occur on high-load Linux servers. It means that a process has opened too many files (file...
Read more >
SSH client denying connection with error "too many files open"
A ssh tunnel needs a file descriptor for the connection, both on the client and on the server side. Therefor the number of...
Read more >
Fixing the “Too many open files” Error in Linux
This Linux OS error simply implies that too many files (file descriptors) have been opened by a process and therefore no more files...
Read more >
Fixing the “Too many open files” Error in Linux - Baeldung
When working with Linux servers, we may encounter the “Too many open files” error. In this article, we'll go over what this error...
Read more >
How to Solve the “Too Many Open Files” Error on Linux
If you see the "Too many files open" error message in Linux, your process has hit the upper limit of files it's allowed...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found