vim-ai icon indicating copy to clipboard operation
vim-ai copied to clipboard

E903: Process failed to start: too many open files

Open kurko opened this issue 2 years ago • 3 comments

I'm getting an error that I'm not sure its root cause is vim-ai, but it is happening when using the plugin.

I'm getting the error from the title when the plugin outputs lines to the editor, generally after the 14th line.

Here's an example prompt:

:AI write an rspec file template so I can start coding on it. the class name is SomeJob

It starts outputting code, and when it finishes line 14, it errors out with the following:

Error detected while processing function vim_ai#AIRun[19]..provider#python3#Call:
line   18:
Error invoking 'python_execute_file' on channel 2254 (python3-script-host):
Traceback (most recent call last):
  File "/Users/alex/.vim/plugins/vim-ai/py/complete.py", line 55, in <module>
    handle_completion_error(error)
  File "/Users/alex/.vim/plugins/vim-ai/py/utils.py", line 172, in handle_completion_error
    raise error
  File "/Users/alex/.vim/plugins/vim-ai/py/complete.py", line 52, in <module>
    render_text_chunks(text_chunks)
  File "/Users/alex/.vim/plugins/vim-ai/py/utils.py", line 57, in render_text_chunks
    vim.command("normal! a" + text)
  File "/opt/homebrew/lib/python3.11/site-packages/pynvim/api/nvim.py", line 287, in command
    return self.request('nvim_command', string, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/pynvim/api/nvim.py", line 182, in request
    res = self._session.request(name, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/pynvim/msgpack_rpc/session.py", line 102, in request
    raise self.error_wrapper(err)
pynvim.api.common.NvimError: function vim_ai#AIRun[19]..provider#python3#Call[18]..vim_ai#AIRun[19]..InsertLeave Autocommands for "*"..function ale#Queue[33]..<SNR>1
37_Lint[20]..ale#engine#RunLinters[4]..<SNR>173_GetLintFileValues[27]..<lambda>4966[1]..<SNR>173_RunLinters[12]..<SNR>173_RunLinter[6]..<SNR>173_RunIfExecutable[43].
.<SNR>173_RunJob[27]..ale#command#Run[65]..ale#job#Start, line 21: Vim(let):E903: Process failed to start: too many open files: "/bin/bash"
Press ENTER or type command to continue

kurko avatar Aug 12 '23 17:08 kurko

I have the same issue!

aessiane avatar Oct 05 '23 13:10 aessiane

I had this issue too on macOS, but after running ulimit -n 5000 in my shell it has seemed to have gone away

willemt avatar Nov 13 '23 00:11 willemt

No luck for me with ulimit 🙂

kurko avatar Nov 15 '23 17:11 kurko