首页 > 解决方案 > 使用 Sublime 编辑 Yocto 文件,导致启动 bitbake 服务器失败

问题描述

如果我在 Ubuntu 16.04 下使用Sublime打开我的 Yocto 项目文件夹并尝试使用以下命令构建:

bitbake <image>

我收到这些错误:

ERROR: Unable to start bitbake server (None)
ERROR: Server log for this session (/local/STM32MP15-Ecosystem-v1.1.0/Distribution-Package/openstlinux-4.19-thud-mp1-19-10-09/build-openstlinuxeglfs-stm32mp1-sw25v00/bitbake-cookerdaemon.log):
--- Starting bitbake server pid 4602 at 2020-02-01 02:59:00.519051 ---
Traceback (most recent call last):
  File "/local/STM32MP15-Ecosystem-v1.1.0/Distribution-Package/openstlinux-4.19-thud-mp1-19-10-09/layers/openembedded-core/bitbake/lib/bb/daemonize.py", line 83, in createDaemon
    function()
  File "/local/STM32MP15-Ecosystem-v1.1.0/Distribution-Package/openstlinux-4.19-thud-mp1-19-10-09/layers/openembedded-core/bitbake/lib/bb/server/process.py", line 469, in _startServer
    self.cooker = bb.cooker.BBCooker(self.configuration, self.featureset)
  File "/local/STM32MP15-Ecosystem-v1.1.0/Distribution-Package/openstlinux-4.19-thud-mp1-19-10-09/layers/openembedded-core/bitbake/lib/bb/cooker.py", line 210, in __init__
    self.initConfigurationData()
  File "/local/STM32MP15-Ecosystem-v1.1.0/Distribution-Package/openstlinux-4.19-thud-mp1-19-10-09/layers/openembedded-core/bitbake/lib/bb/cooker.py", line 396, in initConfigurationData
    self.add_filewatch(mc.getVar("__base_depends", False), self.configwatcher)
  File "/local/STM32MP15-Ecosystem-v1.1.0/Distribution-Package/openstlinux-4.19-thud-mp1-19-10-09/layers/openembedded-core/bitbake/lib/bb/cooker.py", line 306, in add_filewatch
    watcher.add_watch(f, self.watchmask, quiet=False)
  File "/local/STM32MP15-Ecosystem-v1.1.0/Distribution-Package/openstlinux-4.19-thud-mp1-19-10-09/layers/openembedded-core/bitbake/lib/pyinotify.py", line 1924, in add_watch
    raise WatchManagerError(err, ret_)
pyinotify.WatchManagerError: add_watch: cannot watch /local/STM32MP15-Ecosystem-v1.1.0/Distribution-Package/openstlinux-4.19-thud-mp1-19-10-09/build-openstlinuxeglfs-stm32mp1-sw25v00/conf WD=-1, Errno=No space left on device (ENOSPC)
ERROR: No space left on device or exceeds fs.inotify.max_user_watches?
ERROR: To check max_user_watches: sysctl -n fs.inotify.max_user_watches.
ERROR: To modify max_user_watches: sysctl -n -w fs.inotify.max_user_watches=<value>.
ERROR: Root privilege is required to modify max_user_watches.

关闭编辑器并再次发出命令正常工作。其他编辑器(如gedit)没有这种行为。

我知道我可以没有Sublime,但我想了解错误的原因。

标签: sublimetext3yocto

解决方案


你的inotify手表快用完了。诸如 Sublime 之类的软件和您在此处运行的程序(以及其他)使用inotify监视来检测文件系统的更改,例如能够跟踪文件何时更改或目录内容何时更改。

一次可以使用的手表数量有一个(用户可设置的)上限,您在这里看到的相当神秘的错误消息是达到限制并且程序无法获得手表的症状。

对于您正在使用的软件(和文件量),您的系统上的最大观看次数的默认值inotify可能设置得不够高,但您可以根据需要进行更改。

错误诊断信息底部的输出显示了如何查看/调整上限。以下问题还显示了您也可以如何做到这一点。

https://unix.stackexchange.com/questions/13751/kernel-inotify-watch-limit-reached


推荐阅读