Skip to content

Crashes with 'too many open files in system' #815

Open
@HansKre

Description

Describe the bug

When changing git branches and installing npm dependencies, I am regularly seeing this error:

After that, my terminal hangs and other applications, e.g. Chrome, Teams crash.

To Reproduce

Following error happens only if zsh-autosuggestions is enabled.
Use VScode's built-in terminal.

# checkout an old git-brach with many changed files
% git checkout feature1
% rm -rf node_modules && npm i
# ...
node: OpenSSL configuration error:
40B858EF01000000:error:80000017:system library:BIO_new_file:Too many open files in system:../deps/openssl/openssl/crypto/bio/bss_file.c:67:calling fopen(/System/Library/OpenSSL//openssl.cnf, rb)

omz_termsupport_cwd:3: pipe failed: too many open files in system                                                 
zsh: pipe failed: too many open files in system

% git checkout feature2
M       CompanyData.tsx
Switched to branch 'feature2'
Your branch is up to date with 'origin/feature2.
error: cannot open '.git/FETCH_HEAD': Too many open files in system
prompt_status:5: pipe failed: too many open files in system                                    
prompt_git:2: pipe failed: too many open files in system

Expected behavior

Should not produce 'too many open files in system'-Error.

Desktop

  • OS + distribution: MacOS 15.1.1 (24B91) @ Apple M3 Max, 64 GB
  • Zsh version: 5.9
  • Plugin version: 0e810e5 v0.7.1

Additional context

Here are parts of my .zshrc

ZSH_THEME="agnoster"

plugins=(
   git
   docker
   dotenv
   zsh-autosuggestions
)

# attempt to fix the issue by setting BUFFER_MAX_SIZE
ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20

# attempt to fix the issue by increasing ulimit
ulimit -n 16384

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions