Having `fs.inotify.max_user_watches` set to a low value causes gdk run db and gdk run to exit soon after starting
Having fs.inotify.max_user_watches
set to a low value (as default on Ubuntu) causes gdk run db
and gdk run
to exit soon after starting.
A workaround is to add the line fs.inotify.max_user_watches = 1048576
to /etc/sysctl.conf
and then run sudo sysctl -p
, as stated in this AskUbuntu answer: https://askubuntu.com/a/833979
This is the relevant gdk run db
output (note the tail: inotify resources exhausted
warning):
$ gdk run db
(in /home/maurizio/Sviluppo/gitlab-development-kit)
17:17:00 redis.1 | started with pid 11186
17:17:00 postgresql.1 | started with pid 11187
17:17:00 webpack.1 | started with pid 11188
17:17:00 registry.1 | started with pid 11189
17:17:00 redis.1 | 11186:C 22 Dec 17:17:00.938 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
17:17:00 redis.1 | 11186:C 22 Dec 17:17:00.938 # Redis version=4.0.6, bits=64, commit=00000000, modified=0, pid=11186, just started
17:17:00 redis.1 | 11186:C 22 Dec 17:17:00.938 # Configuration loaded
17:17:00 redis.1 | 11186:M 22 Dec 17:17:00.939 * Increased maximum number of open files to 10032 (it was originally set to 1024).
17:17:00 redis.1 | 11186:M 22 Dec 17:17:00.939 * Running mode=standalone, port=0.
17:17:00 redis.1 | 11186:M 22 Dec 17:17:00.939 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
17:17:00 redis.1 | 11186:M 22 Dec 17:17:00.939 # Server initialized
17:17:00 redis.1 | 11186:M 22 Dec 17:17:00.939 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
17:17:00 redis.1 | 11186:M 22 Dec 17:17:00.939 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
17:17:00 redis.1 | 11186:M 22 Dec 17:17:00.939 * The server is now ready to accept connections at /home/maurizio/Sviluppo/gitlab-development-kit/redis/redis.socket
17:17:00 registry.1 | Docker registry disabled.
17:17:00 registry.1 | tail: inotify resources exhausted
17:17:00 registry.1 | tail: inotify cannot be used, reverting to polling
17:17:01 postgresql.1 | LOG: database system was shut down at 2017-12-22 17:16:40 CET
17:17:01 postgresql.1 | LOG: MultiXact member wraparound protections are now enabled
17:17:01 postgresql.1 | LOG: autovacuum launcher started
17:17:01 postgresql.1 | LOG: database system is ready to accept connections
17:17:01 webpack.1 | yarn run v1.3.2
17:17:01 webpack.1 | $ nodemon --watch config/webpack.config.js -- ./node_modules/.bin/webpack-dev-server --config config/webpack.config.js
17:17:01 webpack.1 | [nodemon] 1.11.0
17:17:01 webpack.1 | [nodemon] to restart at any time, enter `rs`
17:17:01 webpack.1 | [nodemon] watching: config/webpack.config.js
17:17:01 webpack.1 | [nodemon] starting `node ./node_modules/.bin/webpack-dev-server --config config/webpack.config.js`
17:17:01 webpack.1 | [nodemon] Internal watch failed: watch /home/maurizio/Sviluppo/gitlab-development-kit/gitlab/config/webpack.config.js ENOSPC
17:17:01 webpack.1 | error Command failed with exit code 1.
17:17:01 webpack.1 | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
17:17:02 webpack.1 | exited with code 1
17:17:02 system | sending SIGTERM to all processes
17:17:02 redis.1 | 11186:signal-handler (1513959422) Received SIGTERM scheduling shutdown...
17:17:02 postgresql.1 | LOG: received fast shutdown request
17:17:02 postgresql.1 | LOG: aborting any active transactions
17:17:02 postgresql.1 | LOG: autovacuum launcher shutting down
17:17:02 postgresql.1 | LOG: shutting down
17:17:02 redis.1 | 11186:M 22 Dec 17:17:02.041 # User requested shutdown...
17:17:02 redis.1 | 11186:M 22 Dec 17:17:02.041 * Removing the unix socket file.
17:17:02 redis.1 | 11186:M 22 Dec 17:17:02.041 # Redis is now ready to exit, bye bye...
17:17:02 redis.1 | exited with code 0
17:17:02 postgresql.1 | LOG: database system is shut down
17:17:02 postgresql.1 | Sending INT to 11201
17:17:02 postgresql.1 | exited with code 0
17:17:02 registry.1 | terminated by SIGTERM
Edited by Maurizio De Santis