> ## Documentation Index
> Fetch the complete documentation index at: https://docs.domino.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# VSCode Error: ENOSPC: System limit for number of file watchers reached

> VSCode workspaces fail with "ENOSPC: System limit for number of file watchers reached" when large directories exhaust inotify handles. Fix by excluding folders like .venv from files.watcherExclude in VSCode settings, or increase fs.inotify.max_user_watches.

### **Version:**

All supported versions of Domino using VSCode as the workspace IDE.

## **Issue:**

An error prompt appears in a VSCode workspace with the following message:

```
Error: ENOSPC: System limit for number of file watchers reached
```

This error is also visible in the workspace support bundle logs:

```
[File Watcher (node.js)] Failed to watch /home/ubuntu/.local/share/code-server/Machine/settings.json
for changes using fs.watch() (Error: ENOSPC: System limit for number of file watchers reached, watch
'/home/ubuntu/.local/share/code-server/Machine/settings.json')
```

## **Root Cause:**

VSCode uses the Linux `inotify` subsystem to watch files for changes. Each file or directory being watched consumes one inotify handle. When a workspace contains a large number of files — for example, due to a Python virtual environment (`.venv`), `node_modules`, or a large project directory — VSCode exhausts the system's available file watcher handles, triggering this error.

## **Resolution:**

There are two approaches to resolve this issue. Try **Option 1** first before increasing system limits.

**Option 1 – Exclude large directories from file watching (Recommended)**
Configure VSCode to exclude large folders from the file watcher by adding them to the `files.watcherExclude` setting. This reduces the number of handles consumed without changing system limits.

Open your VSCode settings and add the following, expanding the list to include any additional large directories in your workspace (e.g., `.venv`):

```
"files.watcherExclude": {
  "**/.git/objects/**": true,
  "**/.git/subtree-cache/**": true,
  "**/node_modules/*/**": true,
  "**/.hg/store/**": true,
  "**/.venv/**": true
}
```

This setting can be applied at two levels:

* **User Settings** — applies globally to all VSCode instances for the user.
* **Workspace Settings** — stored in the workspace and applies only when that workspace is open.

To edit settings via the UI, first enable the split JSON editor by searching for and enabling the following setting:

```
workbench.settings.useSplitJSON
```

This opens a split pane view with a read-only reference on the left and a writeable editor on the right. Make your changes in the right pane and save.

**Option 2 – Increase the system inotify file watcher limit**
If excluding directories does not resolve the issue, a Domino Admin can increase the maximum number of file watchers at the OS level. Run the following commands on the node hosting the workspace:

```
# Set the new value (maximum is 524288)
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

# Verify the new value was applied
cat /proc/sys/fs/inotify/max_user_watches
```

The maximum supported value is **524288**. Set the value appropriate to the size of the workspaces on the deployment.

### **Notes/Information:**

Option 1 is preferred as it resolves the issue without requiring system-level changes or admin access. Common high-file-count directories to exclude include `.venv`, `node_modules`, and `.git/objects`.

For more information on this error in VSCode, see the official VSCode documentation: [Visual Studio Code – Unable to watch for file changes (ENOSPC)](https://code.visualstudio.com/docs/setup/linux#_visual-studio-code-is-unable-to-watch-for-file-changes-in-this-large-workspace-error-enospc).


## Related topics

- [Troubleshooting](/knowledge-base/troubleshooting-overview.md)
- [VSCode Failed to get latest version {"error":"getaddrinfo ENOTFOUND api.github.com"}](/knowledge-base/vscode-failed-to-get-latest-version-error-getaddrinfo-enotfound-api-github-com.md)
- [Execution queue limits](/cloud/admin/infrastructure-and-compute/manage-compute-resources/execution-queue-limits.md)
- [Open a VS Code Workspace](/cloud/platform-capabilities/core-concepts/workspaces/launch-a-workspace/launch-a-vs-code-workspace.md)
