Bench works then crashes after a minute or two

Hello,

I’ve been installing Bench and erpnext on a VPS, followed these steps : “https://github.com/D-codE-Hub/ERPNext-installation-Guide”. When starting bench, it works for 60 seconds approx and then it crashes. Here’s the logs :

10:19:31 system           | redis_cache.1 started (pid=1617)
10:19:31 system           | redis_queue.1 started (pid=1616)
10:19:31 system           | redis_socketio.1 started (pid=1615)
10:19:31 system           | socketio.1 started (pid=1621)
10:19:31 system           | web.1 started (pid=1624)
10:19:31 system           | watch.1 started (pid=1618)
10:19:31 system           | schedule.1 started (pid=1619)
10:19:31 system           | worker_short.1 started (pid=1639)
10:19:31 system           | worker_long.1 started (pid=1636)
10:19:31 system           | worker_default.1 started (pid=1638)
10:19:31 redis_cache.1    | 1623:C 03 Feb 2022 10:19:31.765 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
10:19:31 redis_cache.1    | 1623:C 03 Feb 2022 10:19:31.765 # Redis version=6.0.15, bits=64, commit=00000000, modified=0, pid=1623, just started
10:19:31 redis_cache.1    | 1623:C 03 Feb 2022 10:19:31.766 # Configuration loaded
10:19:31 redis_cache.1    | 1623:M 03 Feb 2022 10:19:31.767 * Increased maximum number of open files to 10032 (it was originally set to 1024).
10:19:31 redis_queue.1    | 1622:C 03 Feb 2022 10:19:31.770 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
10:19:31 redis_queue.1    | 1622:C 03 Feb 2022 10:19:31.771 # Redis version=6.0.15, bits=64, commit=00000000, modified=0, pid=1622, just started
10:19:31 redis_queue.1    | 1622:C 03 Feb 2022 10:19:31.771 # Configuration loaded
10:19:31 redis_queue.1    | 1622:M 03 Feb 2022 10:19:31.772 * Increased maximum number of open files to 10032 (it was originally set to 1024).
10:19:31 redis_socketio.1 | 1628:C 03 Feb 2022 10:19:31.782 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
10:19:31 redis_socketio.1 | 1628:C 03 Feb 2022 10:19:31.782 # Redis version=6.0.15, bits=64, commit=00000000, modified=0, pid=1628, just started
10:19:31 redis_socketio.1 | 1628:C 03 Feb 2022 10:19:31.783 # Configuration loaded
10:19:31 redis_socketio.1 | 1628:M 03 Feb 2022 10:19:31.784 * Increased maximum number of open files to 10032 (it was originally set to 1024).
10:19:31 redis_queue.1    | 1622:M 03 Feb 2022 10:19:31.793 * Running mode=standalone, port=11000.
10:19:31 redis_queue.1    | 1622:M 03 Feb 2022 10:19:31.794 # Server initialized
10:19:31 redis_queue.1    | 1622:M 03 Feb 2022 10:19:31.795 * Ready to accept connections
10:19:31 redis_cache.1    | 1623:M 03 Feb 2022 10:19:31.795 * Running mode=standalone, port=13000.
10:19:31 redis_cache.1    | 1623:M 03 Feb 2022 10:19:31.795 # Server initialized
10:19:31 redis_cache.1    | 1623:M 03 Feb 2022 10:19:31.796 * Ready to accept connections
10:19:31 redis_socketio.1 | 1628:M 03 Feb 2022 10:19:31.799 * Running mode=standalone, port=12000.
10:19:31 redis_socketio.1 | 1628:M 03 Feb 2022 10:19:31.800 # Server initialized
10:19:31 redis_socketio.1 | 1628:M 03 Feb 2022 10:19:31.801 * Ready to accept connections
10:19:34 socketio.1       | listening on *: 9000
10:19:34 watch.1          | /home/dcode-frappe/frappe-bench/env/lib/python3.9/site-packages/past/builtins/misc.py:45: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
10:19:34 watch.1          |   from imp import reload
10:19:34 web.1            | /home/dcode-frappe/frappe-bench/env/lib/python3.9/site-packages/past/builtins/misc.py:45: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
10:19:34 web.1            |   from imp import reload
10:19:34 schedule.1       | /home/dcode-frappe/frappe-bench/env/lib/python3.9/site-packages/past/builtins/misc.py:45: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
10:19:34 schedule.1       |   from imp import reload
10:19:34 watch.1          | /home/dcode-frappe/frappe-bench/env/lib/python3.9/site-packages/bleach_whitelist/bleach_whitelist.py:3: DeprecationWarning: bleach-whitelist has been renamed bleach-allowlist. It will not receive further updates under the old name. See https://pypi.org/project/bleach-allowlist
10:19:34 watch.1          |   warnings.warn(
10:19:34 web.1            | /home/dcode-frappe/frappe-bench/env/lib/python3.9/site-packages/bleach_whitelist/bleach_whitelist.py:3: DeprecationWarning: bleach-whitelist has been renamed bleach-allowlist. It will not receive further updates under the old name. See https://pypi.org/project/bleach-allowlist
10:19:34 web.1            |   warnings.warn(
10:19:34 schedule.1       | /home/dcode-frappe/frappe-bench/env/lib/python3.9/site-packages/bleach_whitelist/bleach_whitelist.py:3: DeprecationWarning: bleach-whitelist has been renamed bleach-allowlist. It will not receive further updates under the old name. See https://pypi.org/project/bleach-allowlist
10:19:34 schedule.1       |   warnings.warn(
10:19:36 web.1            |  * Running on http://0.0.0.0:8000/ (Press CTRL+C to quit)
10:19:36 web.1            |  * Restarting with inotify reloader
10:19:36 web.1            | /home/dcode-frappe/frappe-bench/env/lib/python3.9/site-packages/past/builtins/misc.py:45: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
10:19:36 web.1            |   from imp import reload
10:19:36 web.1            | /home/dcode-frappe/frappe-bench/env/lib/python3.9/site-packages/bleach_whitelist/bleach_whitelist.py:3: DeprecationWarning: bleach-whitelist has been renamed bleach-allowlist. It will not receive further updates under the old name. See https://pypi.org/project/bleach-allowlist
10:19:36 web.1            |   warnings.warn(
10:19:36 web.1            |  * Debugger is active!
10:19:37 web.1            |  * Debugger PIN: 607-041-400
10:19:37 watch.1          | yarn run v1.22.17
10:19:38 watch.1          | $ node rollup/watch.js
10:19:41 watch.1          |
10:19:41 watch.1          | Rollup Watcher Started
10:19:41 watch.1          |
10:19:41 watch.1          | Watching...
10:19:42 watch.1          | Browserslist: caniuse-lite is outdated. Please run:
10:19:42 watch.1          | npx browserslist@latest --update-db
10:19:42 watch.1          | Rebuilding erpnext.css
10:19:42 watch.1          | Rebuilding marketplace.css
10:19:42 watch.1          | Rebuilding erpnext-web.min.js
10:19:43 watch.1          | Rebuilding erpnext-web.css
10:19:43 watch.1          | Rebuilding marketplace.min.js
10:19:50 watch.1          | Rebuilding erpnext.min.js
10:19:51 watch.1          | Rebuilding item-dashboard.min.js
10:19:51 watch.1          | Rebuilding point-of-sale.min.js
10:19:52 watch.1          | Rebuilding bank-reconciliation-tool.min.js
10:19:53 watch.1          | Rebuilding e-commerce.min.js
10:19:53 watch.1          | Rebuilding hierarchy-chart.min.js
10:19:56 watch.1          | Rebuilding erpnext.css
10:19:56 watch.1          | Rebuilding marketplace.css
10:19:56 watch.1          | Rebuilding erpnext-web.css
10:19:59 watch.1          | Rebuilding frappe-web-b4.css
10:19:59 watch.1          | Rebuilding frappe-recorder.min.js
10:20:04 watch.1          | Rebuilding checkout.min.js
10:20:04 watch.1          | Rebuilding frappe-web.min.js
10:20:07 watch.1          | Rebuilding bootstrap-4-web.min.js
10:20:09 watch.1          | Rebuilding control.min.js
10:20:17 watch.1          | Rebuilding dialog.min.js
10:20:21 watch.1          | Rebuilding desk.min.css
10:20:24 watch.1          | Rebuilding printview.css
10:20:24 watch.1          | Rebuilding desk.min.js
10:21:15 watch.1          | Killed
10:21:15 watch.1          | error Command failed with exit code 137.
10:21:15 watch.1          | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
10:21:16 system           | watch.1 stopped (rc=0)
10:21:16 system           | sending SIGTERM to redis_cache.1 (pid 1617)
10:21:16 system           | sending SIGTERM to redis_socketio.1 (pid 1615)
10:21:16 system           | sending SIGTERM to redis_queue.1 (pid 1616)
10:21:16 system           | sending SIGTERM to web.1 (pid 1624)
10:21:16 system           | sending SIGTERM to socketio.1 (pid 1621)
10:21:16 system           | sending SIGTERM to schedule.1 (pid 1619)
10:21:16 system           | sending SIGTERM to worker_short.1 (pid 1639)
10:21:16 system           | sending SIGTERM to worker_long.1 (pid 1636)
10:21:16 system           | sending SIGTERM to worker_default.1 (pid 1638)
10:21:16 redis_socketio.1 | 1628:signal-handler (1643883676) Received SIGTERM scheduling shutdown...
10:21:16 redis_cache.1    | 1623:signal-handler (1643883676) Received SIGTERM scheduling shutdown...
10:21:16 redis_queue.1    | 1622:signal-handler (1643883676) Received SIGTERM scheduling shutdown...
10:21:16 system           | socketio.1 stopped (rc=-15)
10:21:16 system           | worker_short.1 stopped (rc=-15)
10:21:16 system           | worker_long.1 stopped (rc=-15)
10:21:16 system           | worker_default.1 stopped (rc=-15)
10:21:16 system           | schedule.1 stopped (rc=-15)
10:21:16 redis_queue.1    | 1622:M 03 Feb 2022 10:21:16.170 # User requested shutdown...
10:21:16 redis_cache.1    | 1623:M 03 Feb 2022 10:21:16.173 # User requested shutdown...
10:21:16 redis_cache.1    | 1623:M 03 Feb 2022 10:21:16.173 * Removing the pid file.
10:21:16 redis_queue.1    | 1622:M 03 Feb 2022 10:21:16.173 * Removing the pid file.
10:21:16 redis_queue.1    | 1622:M 03 Feb 2022 10:21:16.174 # Redis is now ready to exit, bye bye...
10:21:16 redis_cache.1    | 1623:M 03 Feb 2022 10:21:16.174 # Redis is now ready to exit, bye bye...
10:21:16 system           | redis_cache.1 stopped (rc=-15)
10:21:16 redis_socketio.1 | 1628:M 03 Feb 2022 10:21:16.179 # User requested shutdown...
10:21:16 redis_socketio.1 | 1628:M 03 Feb 2022 10:21:16.179 * Removing the pid file.
10:21:16 redis_socketio.1 | 1628:M 03 Feb 2022 10:21:16.179 # Redis is now ready to exit, bye bye...
10:21:16 system           | redis_socketio.1 stopped (rc=-15)
10:21:16 system           | redis_queue.1 stopped (rc=-15)
10:21:16 system           | web.1 stopped (rc=-15)

I’ve tried this command in case it was a ENOSPC error :
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

but it still won’t work.

(VPS specs : 2gb RAM and 40Go capacity)

Thanks

I used to encounter this issue some years back. Try to increase RAM or swap space.

I’m at 2gb, it won’t work ? Not sure i want to pay more than what i already do with my hosting…

Try increasing the swap space. This uses the disk storage so no need to increase RAM.

1 Like