virtualenv icon indicating copy to clipboard operation
virtualenv copied to clipboard

"Too many open files"

Open nedbat opened this issue 10 months ago • 2 comments

(copied from https://github.com/tox-dev/tox/issues/3472)

Issue

Running tox in https://github.com/nedbat/django_coverage_plugin results in "Too many open files" errors from inside tox, virtualenv, etc.

Environment

Provide at least:

  • OS: Mac OS 15.2
Output of pip list of the host Python, where tox is installed
% pip list
Package            Version
------------------ -----------
attrs              25.1.0
backports.tarfile  1.2.0
build              1.2.2.post1
cachetools         5.5.1
certifi            2024.12.14
chardet            5.2.0
charset-normalizer 3.4.1
click              8.1.8
click-log          0.4.0
colorama           0.4.6
distlib            0.3.9
docutils           0.21.2
filelock           3.17.0
id                 1.5.0
idna               3.10
importlib_metadata 8.6.1
jaraco.classes     3.4.0
jaraco.context     6.0.1
jaraco.functools   4.1.0
Jinja2             3.1.5
keyring            25.6.0
markdown-it-py     3.0.0
MarkupSafe         3.0.2
mdurl              0.1.2
more-itertools     10.6.0
nh3                0.2.20
packaging          24.2
pip                24.2
platformdirs       4.3.6
pluggy             1.5.0
Pygments           2.19.1
pyproject-api      1.9.0
pyproject_hooks    1.2.0
readme_renderer    44.0
requests           2.32.3
requests-toolbelt  1.0.0
rfc3986            2.0.0
rich               13.9.4
scriv              1.5.1
setuptools         74.0.0
tomli              2.2.1
tox                4.24.1
twine              6.1.0
typing_extensions  4.12.2
urllib3            2.3.0
virtualenv         20.29.1
wheel              0.44.0
zipp               3.21.0

Output of running tox

Output of tox -rvv

It's 5200 lines, I put it in a gist: https://gist.github.com/nedbat/9f54a1756f4d3d3f34d00cf9cceb8440

Minimal example

% git clone https://github.com/nedbat/django_coverage_plugin.git
% cd django_coverage_plugin
% git checkout a1f1d93bccbd495e0d019052a6e411f88f5cbc6f
% pip install -r requirements.txt
% tox 

Sorry I don't have a smaller example.

nedbat avatar Jan 28 '25 19:01 nedbat

I reallyu don't know what this can be 😆

gaborbernat avatar Feb 10 '25 19:02 gaborbernat

I had a similar error running tox against https://github.com/django-commons/django-debug-toolbar. I'm running macOS 15.3.1 (Sequoia).

ulimit -a shows:

Maximum size of core files created                              (kB, -c) 0
Maximum size of a process’s data segment                        (kB, -d) unlimited
Maximum size of files created by the shell                      (kB, -f) unlimited
Maximum size that may be locked into memory                     (kB, -l) unlimited
Maximum resident set size                                       (kB, -m) unlimited
Maximum number of open file descriptors                             (-n) 256
Maximum stack size                                              (kB, -s) 8176
Maximum amount of CPU time in seconds                      (seconds, -t) unlimited
Maximum number of processes available to current user               (-u) 5333
Maximum amount of virtual memory available to each process      (kB, -v) unlimited

I ran ulimit -n 2560, and tox completed without a "Too many open files" error. I guess 256 is no longer enough!

jwhitlock avatar Mar 06 '25 20:03 jwhitlock