[build Error initializing DaemonStateData] how to fix it
Hi,
I want to use executorch to build the example by buck2, but face the issue like it.
So I try the hello_world project, and face the same build error.
How could I fix it?
OS: Linux Ubuntu 20.04.4 LTS x86_64 buck2 version: 2023-07-18 (buck2-x86_64-unknown-linux-musl.zst )
Thanks, Kris
I add the sudo and it can build success.
Hi,
How can I want to do buck2 build without using sudo at command?
Thanks, Kris
This sounds a bit like this issue, or at least the error message is the same. Are you using inotify? If so, have you tried increasing the limits as @thoughtpolice mentioned here? You shouldn't need to run buck2 with sudo
You'll need to increase the inotify limit (and run buck2 kill afterwards):
Our systems show (credit to inotify-watch-limits):
>sysctl fs.inotify.{max_queued_events,max_user_instances,max_user_watches}
fs.inotify.max_queued_events = 16384
fs.inotify.max_user_instances = 128
fs.inotify.max_user_watches = 8192
The 8k max_user_watches is probably too low for most repositories, causing buck2 to fail due to reaching the watch limit. Systems need to be updated to increase this limit.
# Temporarily increase for the current shell to 1M files.
sudo sysctl fs.inotify.max_user_watches=1048576
# Increase for everyone on the system to 1M files
echo fs.inotify.max_user_watches=1048576 | sudo tee -a /etc/sysctl.conf # or manually edit the sysctl.conf file.
sudo sysctl -p
Useful script to see how many files are being watched: inotify-consumers.
Internally we use the watchman file watcher, which can be set with a .buckconfig of:
[buck2]
file_watcher = watchman
That may help reduce the notification count. Upping the limits is probably a good idea anyway though.