LoginSignup
0
1

More than 3 years have passed since last update.

rails webpacker:install実行時にrun() in thread failed: inotify event queue has overflowed

Posted at

現象

rails webpacker:installを実行するとrun() in thread failed: inotify event queue has overflowedと表示される。

環境

docker-composeでruby:2.6.3をベースに構築。

対応

方法その1.Dockerの設定を変更する。

 環境設定→AdvancedのCPUs,Memory,Swapの値を増加する。

方法その2.コンテナ内のファイル以下の記述を追加しsysctl設定にロードする。

/etc/sysctl.conf
fs.inotify.max_user_watches = 999999
fs.inotify.max_queued_events = 999999
fs.inotify.max_user_instances = 999999

以下のコマンドを実行

sudo sysctl -p

実行結果確認

cat /proc/sys/fs/inotify/max_user_watches   #=> 999999
cat /proc/sys/fs/inotify/max_user_instances #=> 999999
cat /proc/sys/fs/inotify/max_user_watches   #=> 999999

補足:以下のエラーが表示される場合、privilegedでコンテナを起動する必要がある。

sysctl: setting key "fs.inotify.max_user_watches": Read-only file system

privilegedを以下の通り記載してコンテナを起動し、再度コンテナ内でsudo sysctl -pを実行する。

docker-compose.yml
version: '3'
services:
  web:
    privileged: true

結果

rails generate react:installでエラーが出なくなる。エラーによってどういう影響があるかわからないがエラーはない方がいいはず。

参考にさせていただいたサイト
https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers
https://github.com/guard/rb-inotify/issues/61
https://qiita.com/osamunmun/items/1786aac5904439522d72
https://wadap.hatenablog.com/entry/20100123/1264211202

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1