You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
EMFILE: too many open files, watch 'home/user/.local/state/opencode/latest/tui' #50566
changed the title [-]EMFILE: too many open filees, watch 'home/user/.local/state/opencode/latest/tui'[/-][+]EMFILE: too many open files, watch 'home/user/.local/state/opencode/latest/tui'[/+]on Sep 22, 2026
Error: EMFILE: too many open files, watch '/home/gandb/.config/opencode'
at watch (unknown)
at new FSWatcher (internal:fs/watch:101:31)
at watch (internal:fs/watch:172:23)
at Dpe (/$bunfs/root/chunk-e5561drs.js:3:55263)
at Ri (///root/chunk-s6m57scs.js:2:6899)
at get (///root/chunk-s6m57scs.js:2:17800)
at children (///root/chunk-pa6pb7e8.js:2590:3713)
at (///root/chunk-s6m57scs.js:2:14480)
at je (///root/chunk-s6m57scs.js:2:9876)
at K (///root/chunk-s6m57scs.js:2:9657)
Error: EMFILE: too many open files, watch '/home/gandb/.config/opencode'
Stack trace:
Error: EMFILE: too many open files, watch '/home/gandb/.config/opencode'
at watch (unknown)
at new FSWatcher (internal:fs/watch:101:31)
at watch (internal:fs/watch:172:23)
at Dpe (/$bunfs/root/chunk-e5561drs.js:3:55263)
at Ri (/$bunfs/root/chunk-s6m57scs.js:2:6899)
at get (/$bunfs/root/chunk-s6m57scs.js:2:17800)
at children (/$bunfs/root/chunk-pa6pb7e8.js:2590:3713)
at <anonymous> (/$bunfs/root/chunk-s6m57scs.js:2:14480)
at je (/$bunfs/root/chunk-s6m57scs.js:2:9876)
at K (/$bunfs/root/chunk-s6m57scs.js:2:9657)
Additional context: This error appeared inside the orca app when opencode is triggered from there. The issue occurs specifically when using OpenCode within the orca application environment.
Environment:
- OpenCode version: 2.1.2
- OS: Linux 7.0.0-38-generic (x64)
- Terminal: Orca 1.4.235
Reproduction: Is intermitent, but some hours using orca is possible to reproduce.
1. Install orca from https://www.onorca.dev/download
2. Use some hours opencode into the IDE
---
You can now copy this text and paste it into the GitHub issue form at the URL that was opened in your browser. The form should be pre-filled with the template and title, and you just need to paste the body and submit.
### Plugins
_No response_
### OpenCode version
2.1.2
### Steps to reproduce
Reported automatically from the OpenCode crash screen. If you can, describe what you were doing when it crashed.
### Screenshot
_No response_
### Operating System
Linux 7.0.0-38-generic (x64)
### Terminal
Orca 1.4.235
Thanks for the report! I think this is a duplicate of #51208. In 2.0.12 the TUI watched its state directory (~/.local/state/opencode/<channel>/tui) with fs.watch and didn't handle errors. So when the system ran out of inotify instances (EMFILE), the whole TUI crashed instead of just turning off live-reload.
Possible duplicates and related issues, ordered by likelihood:
As of v2.1.4, all TUI file watchers handle this error: a watch that fails disables live-reload instead of crashing the TUI. Please upgrade to v2.1.4 or later.
If you hit this before you can upgrade, either of these should help:
Raise the inotify limit: sudo sysctl -w fs.inotify.max_user_instances=2048
Or, on v2.1.4 or later, turn off file watching with OPENCODE_DISABLE_FILEWATCHER=1
The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different, for example if it still happens on v2.1.4 or later.
Closing this as a duplicate of #51208, since we haven't heard back. This crash came from the TUI's fs.watch on ~/.local/state/opencode/<channel>/tui not handling inotify exhaustion (EMFILE). #51210, #51243 and #51536 fixed it: as of v2.1.4, a watch that fails just disables live-reload instead of crashing the TUI. The related ~/.config/opencode variant is tracked in #51489.
Please upgrade to v2.1.4 or later. If you still see this crash on v2.1.4 or later, comment here with your version and the stack trace and we'll take another look. Thanks for the report!
Activity
github-actions commentedon Sep 22, 2026
This issue might be a duplicate of existing issues. Please check:
sudo sysctl -w fs.inotify.max_user_instances=2048.[-]EMFILE: too many open filees, watch 'home/user/.local/state/opencode/latest/tui'[/-][+]EMFILE: too many open files, watch 'home/user/.local/state/opencode/latest/tui'[/+]CGuiho commentedon Oct 4, 2026
I've got it today.
gandb commentedon Oct 21, 2026
The same here:
Error: EMFILE: too many open files, watch '/home/gandb/.config/opencode'
at watch (unknown)
at new FSWatcher (internal:fs/watch:101:31)
at watch (internal:fs/watch:172:23)
at Dpe (/$bunfs/root/chunk-e5561drs.js:3:55263)
at Ri (///root/chunk-s6m57scs.js:2:6899)
at get (///root/chunk-s6m57scs.js:2:17800)
at children (///root/chunk-pa6pb7e8.js:2590:3713)
at (///root/chunk-s6m57scs.js:2:14480)
at je (///root/chunk-s6m57scs.js:2:9876)
at K (///root/chunk-s6m57scs.js:2:9657)
opencodejr commentedon Oct 28, 2026
Thanks for the report! I think this is a duplicate of #51208. In 2.0.12 the TUI watched its state directory (
~/.local/state/opencode/<channel>/tui) withfs.watchand didn't handle errors. So when the system ran out of inotify instances (EMFILE), the whole TUI crashed instead of just turning off live-reload.Possible duplicates and related issues, ordered by likelihood:
state/opencode/.../tuicrashing the TUI (reported withENOSPC), fixed by fix(tui): don't crash when fs.watch throws (e.g. ENOSPC) #51210 and fix(tui): handle storage watcher errors after startup #51243~/.config/opencode(the variant @gandb hit on 2.1.2), fixed by fix(tui): degrade gracefully when fs.watch fails #51536EMFILEat startupAs of v2.1.4, all TUI file watchers handle this error: a watch that fails disables live-reload instead of crashing the TUI. Please upgrade to v2.1.4 or later.
If you hit this before you can upgrade, either of these should help:
sudo sysctl -w fs.inotify.max_user_instances=2048OPENCODE_DISABLE_FILEWATCHER=1The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different, for example if it still happens on v2.1.4 or later.
opencodejr commentedon Oct 29, 2026
Closing this as a duplicate of #51208, since we haven't heard back. This crash came from the TUI's
fs.watchon~/.local/state/opencode/<channel>/tuinot handling inotify exhaustion (EMFILE). #51210, #51243 and #51536 fixed it: as of v2.1.4, a watch that fails just disables live-reload instead of crashing the TUI. The related~/.config/opencodevariant is tracked in #51489.Please upgrade to v2.1.4 or later. If you still see this crash on v2.1.4 or later, comment here with your version and the stack trace and we'll take another look. Thanks for the report!