Hi,
I’m facing this issue with ERPNext 12 running on VM (Allotted 2GB RAM and 2 Cores - Xeon processors on the host), and I haven’t been able to figure out a solution for it. While I’m usually using ERPNext (No development, just like a normal user), it stops working. Ultimately nothing works and I have to restart my VM machine.
Also, it’s happening a lot lately that after making some changes in .py when I fire bench restart, or even when opening a new DocType, say Sales Invoice, ERPNext hangs and stops loading. Since I’m using a reverse proxy, it shows me 502 Proxy Error after a few minutes.
Now, I got to restart the server to fix it. And it happens every time I make some changes in the code and it’s getting really annoying.
Then I saw worker.error.log, it showed issues with resources, all of them are now fixed by using the following (Except redis.exceptions.ConnectionError: Error 111 connecting to localhost:11000. Connection refused):
LimitNOFILE=65536 in /etc/systemd/system/redis.service
vm.overcommit_memory = 1 and net.core.somaxconn=1024 in /etc/sysctl.conf
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
in /etc/rc.local
fs.inotify.max_user_watches=524288 in /etc/sysctl.conf
Here’s an excerpt from worker.error.log:
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/frappe/frappe-bench/env/lib/python3.5/site-packages/redis/connection.py", line 484, in connect
sock = self._connect()
File "/home/frappe/frappe-bench/env/lib/python3.5/site-packages/redis/connection.py", line 541, in _connect
raise err
File "/home/frappe/frappe-bench/env/lib/python3.5/site-packages/redis/connection.py", line 529, in _connect
sock.connect(socket_address)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 97, in <module>
main()
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
click.Group(commands=commands)(prog_name='bench')
File "/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/scheduler.py", line 161, in start_worker
start_worker(queue, quiet = quiet)
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/background_jobs.py", line 147, in start_worker
Worker(queues, name=get_worker_name(queue)).work(logging_level = logging_level)
File "/home/frappe/frappe-bench/env/lib/python3.5/site-packages/rq/worker.py", line 502, in work
self.register_death()
File "/home/frappe/frappe-bench/env/lib/python3.5/site-packages/rq/worker.py", line 300, in register_death
p.execute()
File "/home/frappe/frappe-bench/env/lib/python3.5/site-packages/redis/client.py", line 2894, in execute
return execute(conn, stack, raise_on_error)
File "/home/frappe/frappe-bench/env/lib/python3.5/site-packages/redis/client.py", line 2749, in _execute_transaction
connection.send_packed_command(all_cmds)
File "/home/frappe/frappe-bench/env/lib/python3.5/site-packages/redis/connection.py", line 585, in send_packed_command
self.connect()
File "/home/frappe/frappe-bench/env/lib/python3.5/site-packages/redis/connection.py", line 489, in connect
raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 111 connecting to localhost:11000. Connection refused.
09:18:07 RQ worker 'rq:worker:ubuntu.1785.default' started, version 0.12.0
09:18:07 *** Listening on default...
09:18:07 Cleaning registries for queue: default
09:18:07 RQ worker 'rq:worker:ubuntu.1787.long' started, version 0.12.0
09:18:07 *** Listening on long...
09:18:07 Cleaning registries for queue: long
09:18:07 RQ worker 'rq:worker:ubuntu.1788.short' started, version 0.12.0
09:18:07 *** Listening on short...
09:18:07 Cleaning registries for queue: short
It’s really frustrating as I’m hardly able to do anything. I’m sorry to bother you @rmehta, I just would be really grateful to you if you invest a little bit of your time on this.
Thanks!