ubuntu - vscode 启动失败,错误 : EMFILE: too many open files, 观看 '/snap/code'

标签 ubuntu visual-studio-code haskell-snap-framework

几天来,我的 Visual Studio Code 无法启动。从 code --verbose 开始产生:

$ code --verbose
(process:9711): Gtk-WARNING **: 16:56:14.336: Locale not supported by C library.
        Using the fallback 'C' locale.
(code:9711): Gtk-WARNING **: 16:56:14.353: Theme parsing error: gtk.css:68:35: The style property GtkButton:child-displacement-x is deprecated and shouldn't be used anymore. It will be removed in a future version
(code:9711): Gtk-WARNING **: 16:56:14.353: Theme parsing error: gtk.css:69:35: The style property GtkButton:child-displacement-y is deprecated and shouldn't be used anymore. It will be removed in a future version

(code:9711): Gtk-WARNING **: 16:56:14.353: Theme parsing error: gtk.css:73:46: The style property GtkScrolledWindow:scrollbars-within-bevel is deprecated and shouldn't be used anymore. It will be removed in a future version
[9711:1016/165614.456088:ERROR:file_path_watcher_linux.cc(276)] inotify_init() failed: Too many open files (24)
Failed to watch /home/falko/.config/Code/User for changes using fs.watch() (Error: EMFILE: too many open files, watch '/home/falko/.config/Code/User')
[main 2019-10-16T14:56:14.582Z] Starting VS Code
[main 2019-10-16T14:56:14.582Z] from: /snap/code/18/usr/share/code/resources/app
[main 2019-10-16T14:56:14.582Z] args: { _: [], verbose: true, diff: undefined }
[main 2019-10-16T14:56:14.584Z] Resolving machine identifier...
[main 2019-10-16T14:56:14.584Z] Resolved machine identifier: aa83b26b19696e7dcb8a342740bd0a02c994ea16ca0bfc477cb434d622f2df6e (trueMachineId: undefined)
[main 2019-10-16T14:56:14.603Z] update#setState idle
[main 2019-10-16T14:56:14.604Z] telemetry/optInStatus { optIn: true }
[main 2019-10-16T14:56:14.604Z] telemetry/machineIdFallback { usingFallbackGuid: false }
[main 2019-10-16T14:56:14.605Z] Error: EMFILE: too many open files, watch '/snap/code'
    at FSWatcher.start (internal/fs/watchers.js:164:26)
    at Object.watch (original-fs.js:1232:11)
    at new g (/snap/code/18/usr/share/code/resources/app/out/vs/code/electron-main/main.js:391:55)
    at h._createInstance (/snap/code/18/usr/share/code/resources/app/out/vs/code/electron-main/main.js:252:51)
    at h._createServiceInstance (/snap/code/18/usr/share/code/resources/app/out/vs/code/electron-main/main.js:254:51)
    at h._createServiceInstanceWithOwner (/snap/code/18/usr/share/code/resources/app/out/vs/code/electron-main/main.js:253:661)
    at h._createAndCacheServiceInstance (/snap/code/18/usr/share/code/resources/app/out/vs/code/electron-main/main.js:253:336)
    at h._getOrCreateServiceInstance (/snap/code/18/usr/share/code/resources/app/out/vs/code/electron-main/main.js:252:559)
    at Object.get (/snap/code/18/usr/share/code/resources/app/out/vs/code/electron-main/main.js:251:129)
    at t.openFirstWindow (/snap/code/18/usr/share/code/resources/app/out/vs/code/electron-main/main.js:527:871)
    at c.invokeFunction.e (/snap/code/18/usr/share/code/resources/app/out/vs/code/electron-main/main.js:523:709)
    at h.invokeFunction (/snap/code/18/usr/share/code/resources/app/out/vs/code/electron-main/main.js:251:263)
    at t.startup (/snap/code/18/usr/share/code/resources/app/out/vs/code/electron-main/main.js:523:686)
[main 2019-10-16T14:56:14.605Z] Lifecycle#kill()

目前,我正在通过 SNAP 在 Ubuntu 18.04.3 LTS 上安装 1.39.2。

最佳答案

您可以运行 locate gtk.css并找到这些文件的位置:
然后你可以使用如下命令注释掉:

sudo sed -i -E 's~^.*child-displacement-.*$~/* \0 */~g' /usr/share/themes/Breeze/gtk-3.20/gtk.css
对我来说,我还需要运行:
sudo sed -i -E 's~^.*-GtkScrolledWindow-scrollbars-within-bevel.*$~/* \0 */~g' /usr/share/themes/Breeze/gtk-3.20/gtk.css

关于ubuntu - vscode 启动失败,错误 : EMFILE: too many open files, 观看 '/snap/code',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58416315/

相关文章:

haskell - 半组安装因 cabal 失败

bash - 重定向输出时出现 "is not a directory"错误是什么意思? Bash 脚本

python - 在 ubuntu 中安装 gensim 错误

python - 在运行 python 3.8 的机器上用于 python 3.7 的 distutils 和 pygame

visual-studio-code - 将 Visual Studio Code 与 Live Server 或浏览器同步结合使用时,浏览器刷新 html 文件两次

haskell-snap-framework - 快照二进制文件上传

linux - grep 在第一列中搜索数据

typescript - 设置 Visual Studio Code 以在构建和调试时转换 typescript

javascript - 是否可以阻止 prettier 在 Promise.try 之后为 .then() {} 语句添加额外的选项卡?

mysql - Snap Web 应用程序与 MySQL 连接