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

Error EMFILE opening Tabby VS Code client (causes client extension to exit at startup) #3516

Open
jtbr opened this issue Dec 5, 2024 · 3 comments

Comments

@jtbr
Copy link
Contributor

jtbr commented Dec 5, 2024

Describe the bug
Upon opening the tabby client extension, it bonks saying "Server initialization failed", "Handling connection close failed". This may be related to an upgrade of VS Code (or some system library/component). I am not sure what else changed from when it was working. I upgraded tabby to the latest release, same result (tabby's web interface is working). I removed the .tabby-client directory, same result. I removed and re-installed the extension, same result.

Here is the output:

2024-12-05 12:54:44.690 [info] [Tabby] Activating Tabby extension...
2024-12-05 12:54:44.690 [info] [Tabby] GitProvider created.
2024-12-05 12:54:44.848 [info] (node:1534512) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 newAttached listeners added to [IS]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit
(Use `code --trace-warnings ...` to show where the warning was created)

2024-12-05 12:54:44.850 [info] [Warn  - 12:54:44 PM] [DataStore] Failed to read /home/me/.tabby-client/agent/data.json: Error: ENOENT: no such file or directory, open '/home/me/.tabby-client/agent/data.json'
2024-12-05 12:54:44.853 [info] [Info  - 12:54:44 PM] [ConfigFile] Config file not exist, creating template config file.
2024-12-05 12:54:44.856 [info] node:internal/fs/watchers:247
    const error = new UVException({
                  ^

Error: EMFILE: too many open files, watch '/home/me/.tabby-client'
    at FSWatcher.<computed> (node:internal/fs/watchers:247:19)
    at Object.watch (node:fs:2512:36)
    at zY (/home/me/.vscode/extensions/tabbyml.vscode-tabby-1.14.0/dist/tabby-agent/node/index.js:189:7996)
    at A0e (/home/me/.vscode/extensions/tabbyml.vscode-tabby-1.14.0/dist/tabby-agent/node/index.js:189:8270)
    at uR._watchWithNodeFs (/home/me/.vscode/extensions/tabbyml.vscode-tabby-1.14.0/dist/tabby-agent/node/index.js:189:9654)
    at uR._handleDir (/home/me/.vscode/extensions/tabbyml.vscode-tabby-1.14.0/dist/tabby-agent/node/index.js:189:12317)
    at uR._addToNodeFs (/home/me/.vscode/extensions/tabbyml.vscode-tabby-1.14.0/dist/tabby-agent/node/index.js:189:12976)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /home/me/.vscode/extensions/tabbyml.vscode-tabby-1.14.0/dist/tabby-agent/node/index.js:189:24741
    at async Promise.all (index 0)
Emitted 'error' event on pC instance at:
    at pC._handleError (/home/me/.vscode/extensions/tabbyml.vscode-tabby-1.14.0/dist/tabby-agent/node/index.js:189:27175)
    at uR._addToNodeFs (/home/me/.vscode/extensions/tabbyml.vscode-tabby-1.14.0/dist/tabby-agent/node/index.js:189:13498)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /home/me/.vscode/extensions/tabbyml.vscode-tabby-1.14.0/dist/tabby-agent/node/index.js:189:24741
    at async Promise.all (index 0) {
  errno: -24,
  syscall: 'watch',
  code: 'EMFILE',
  path: '/home/me/.tabby-client',
  filename: '/home/me/.tabby-client'
}

Node.js v20.18.0

2024-12-05 12:54:44.860 [info] [Error - 12:54:44 PM] Server process exited with code 1.
2024-12-05 12:54:44.861 [info] [Error - 12:54:44 PM] Server initialization failed.
2024-12-05 12:54:44.861 [info]   Message: Pending response rejected since connection got disposed
  Code: -32097 
2024-12-05 12:54:44.861 [info] [Info  - 12:54:44 PM] Connection to server got closed. Server will restart.
2024-12-05 12:54:44.861 [info] true
2024-12-05 12:54:44.862 [info] [Error - 12:54:44 PM] Handling connection close failed
2024-12-05 12:54:44.862 [info] Error: Method not implemented.
	at fu.clear (/home/me/.vscode/extensions/tabbyml.vscode-tabby-1.14.0/dist/node/extension.js:71:4250)
	at Sh.cleanUp (/home/me/.vscode/extensions/tabbyml.vscode-tabby-1.14.0/dist/node/extension.js:61:9458)
	at Sh.handleConnectionClosed (/home/me/.vscode/extensions/tabbyml.vscode-tabby-1.14.0/dist/node/extension.js:61:13424)
2024-12-05 12:54:44.862 [info] [Error - 12:54:44 PM] Tabby client: couldn't create connection to server.
2024-12-05 12:54:44.862 [info]   Message: Pending response rejected since connection got disposed
  Code: -32097

Information about your version
tabby 0.21.0 (docker on GPU)
tabby-client 0.14.0 (0.12.1 also seems affected)
VS Code: Version: 1.95.3 for Linux

Additional context
It seemed to stop working from one day to another...

@icycodes
Copy link
Member

icycodes commented Dec 5, 2024

Hi @jtbr

Thank you for reporting this issue.
I attempted to reproduce the problem in my environment but was unable to do so. I updated VSCode to the latest version, reinstalled the latest Tabby extension (1.14.0), and removed the ~/.tabby-client directory. Here are the details of my VSCode environment:

Version: 1.95.3
Commit: f1a4fb101478ce6ec82fe9627c43efbf9e98c813
Date: 2024-11-13T14:50:04.152Z
Electron: 32.2.1
ElectronBuildId: 10427718
Chromium: 128.0.6613.186
Node.js: 20.18.0
V8: 12.8.374.38-electron.0
OS: Linux x64 5.15.0-126-generic snap

It seems there may be another underlying cause for this issue. For your reference, the Tabby agent uses the chokidar library to watch two files: ~/.tabby-client/agent/data.json and ~/.tabby-client/agent/config.toml.

@jtbr
Copy link
Contributor Author

jtbr commented Dec 5, 2024

This is the full version info for my VS Code

Version: 1.95.3
Commit: f1a4fb101478ce6ec82fe9627c43efbf9e98c813
Date: 2024-11-13T14:50:04.152Z
Browser: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Code/1.95.3 Chrome/128.0.6613.186 Electron/32.2.1 Safari/537.36

I'm running on Linux Mint 21.3, based upon Ubuntu 22.04. I'll try updating packages later.

@jtbr
Copy link
Contributor Author

jtbr commented Dec 5, 2024

I updated Chrome and Firefox and restarted VS Code, and now it started normally. Go figure. Hopefully this will not recur. But I'll comment again if it does.

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

No branches or pull requests

2 participants