跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://docs.devinenterprise.com/llms.txt

Use this file to discover all available pages before exploring further.

在 Linux 上,Devin Desktop 的 语言服务器 可能无法启动,并显示包含 “设备上没有剩余空间” 的错误,即使系统其实还有充足的可用磁盘空间。其原因并非实际磁盘用量不足,而是 Linux 内核的 inotify watchinotify instance 限制已耗尽。 语言服务器 使用 inotify 监视你 的工作区中的文件变更。当达到内核限制时,系统会返回 ENOSPC 错误——通常就会显示为“设备上没有剩余空间”。

现象

你可能会在 Devin Desktop 的输出日志中看到以下内容:
Language server failed - no space left on device: no space left on device
通常会伴随出现引用以下组件的堆栈跟踪:
  • file_watcher
  • AddTrackedWorkspace
  • AddDirectoriesRecursive
你通常会观察到以下现象:
  • Devin Desktop 可正常打开
  • 语言服务器启动后立即退出
  • 依赖语言服务器的功能 (例如 Cascade、自动补全) 无法使用

排查

1. 检查你当前的 inotify 上限

运行以下命令:
# 检查每个用户的 inotify watches 最大数量
cat /proc/sys/fs/inotify/max_user_watches

# 检查每个用户的 inotify instances 最大数量
cat /proc/sys/fs/inotify/max_user_instances
常见的默认值是:watches 为 8192,instances 为 128。对于大型工作区 (尤其是 monorepo) 中的 IDE 使用场景来说,这些值往往偏低;如果还有其他进程占用 inotify 资源 (如容器、同步工具、其他编辑器和后台服务) ,可用值还会进一步下降。

2. 查看当前正在使用的 inotify 实例数

find /proc/*/fd -lname anon_inode:inotify 2>/dev/null | wc -l
如果这个数量接近 (或超过) 你的 max_user_instances,新的 inotify 用户 (如语言服务器) 可能无法初始化。

解决方案

提高 inotify 限制。你可以临时应用这些更改 (重启前有效) ,也可以永久应用。

临时修复 (重启后失效)

sudo sysctl fs.inotify.max_user_watches=524288
sudo sysctl fs.inotify.max_user_instances=1024

永久性修复 (重启后仍然生效)

echo "fs.inotify.max_user_watches=524288" | sudo tee -a /etc/sysctl.conf
echo "fs.inotify.max_user_instances=1024" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
应用任一修复后,重启 Devin Desktop。语言服务器应可正常启动。 这是 Linux 上一个众所周知的限制,也会影响其他依赖文件监控机制的 IDE 和开发工具。如果你的组织集中管理系统配置,请让你的 IT / 基础设施团队配置这些 sysctl 参数。

何时使用哪个值

  • fs.inotify.max_user_watches=524288 建议用于大型代码仓库或 monorepo。每个被监视的文件/目录都会占用内核内存 (在 64 位系统上,通常每个监视项约占 ~1 KB) ,因此 524288 个监视项 大约会占用 ~512 MB 的内核内存。
  • fs.inotify.max_user_instances=1024 如果你运行了多个会创建 inotify 实例的应用程序 (多个 IDE 窗口、容器、文件同步工具等) ,建议使用该值。在开发环境中,默认值 128 很容易就会用尽。