LoginSignup
0
1

More than 5 years have passed since last update.

Syncthingで「failed to setup inotify handler」の解決法

Posted at

Syncthingで大量のファイルを同期していると発生するのが次のようなエラー:

For the following folders an error occurred while starting to watch for changes. It will be retried every minute, so the errors might go away soon. If they persist, try to fix the underlying issue and ask for help if you can't. suin/dev failed to setup inotify handler. Please increase inotify limits, see https://docs.syncthing.net/users/faq.html#inotify-limits

これはファイルの変更検知をするinotifyが監視できるファイル数の上限より、同期しようとするファイル数が多くなったときに発生すると思われる。

inotifyの上限値は次のコマンドで確認できる:

cat /proc/sys/fs/inotify/max_user_watches

大抵は8192がデフォルトである。

下記のコマンドで一時的にこの上限値を増やすことができる

$ sudo sysctl fs.inotify.max_user_watches=524288
$ sudo sysctl -p

恒久的に変更するには次のコマンドを用い、OSを再起動する

$ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
$ sudo sysctl -p
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