Failure to Update erpNext which is being self hosted

Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/.bench/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1057, in invoke
Command.invoke(self, ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/frappe/.bench/bench/commands/init.py”, line 21, in bench_command
setup_logging(bench_path=bench_path)
File “/home/frappe/.bench/bench/utils.py”, line 265, in setup_logging
hdlr = logging.FileHandler(log_file)
File “/usr/lib/python2.7/logging/init.py”, line 913, in init
StreamHandler.init(self, self._open())
File “/usr/lib/python2.7/logging/init.py”, line 943, in _open
stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: ‘/home/frappe/frappe-bench/logs/bench.log’

1 Like

@WilbrodDreamChaser

Update permissions for logs folder in frappe-bench using sudo chown -R frappe:frappe logs

Hope that helps to solve your problem

I managed to do that but tried updating i using the command sudo bench update, Then got the following error:

INFO:bench.utils:updating bench
Updating b07de26…f0b67b2
error: Your local changes to the following files would be overwritten by merge:
bench/patches/v4/update_node.py
playbooks/develop/ubuntu.yml
Please, commit your changes or stash them before you can merge.
Aborting
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/.bench/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/frappe/.bench/bench/commands/update.py”, line 34, in update
update_bench()
File “/home/frappe/.bench/bench/utils.py”, line 227, in update_bench
exec_cmd(“git pull”, cwd=cwd)
File “/home/frappe/.bench/bench/utils.py”, line 127, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: git pull

So i have done the git commits however I have received the following error when I tried updating it

INFO:bench.utils:updating bench
Updating b07de26…f0b67b2
error: Your local changes to the following files would be overwritten by merge:
bench/patches/v4/update_node.py
playbooks/develop/ubuntu.yml
Please, commit your changes or stash them before you can merge.
Aborting
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/.bench/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/frappe/.bench/bench/commands/update.py”, line 34, in update
update_bench()
File “/home/frappe/.bench/bench/utils.py”, line 227, in update_bench
exec_cmd(“git pull”, cwd=cwd)
File “/home/frappe/.bench/bench/utils.py”, line 127, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: git pull

Go to your bench repo, do git checkout master and then go back to frappe-bench and do bench update

Still the same error

I am also having the same problem updating a self hosted ERPNext version. I have perused all possible solutions.
did the node.js upgrade
have tried fixing permissions
and nothing budges… I need some help please!

auserr@erpnext-test:/home/frappe/frappe-bench$ bench update --upgrade Traceback (most recent call last): File "/usr/local/bin/bench", line 11, in <module> load_entry_point('bench', 'console_scripts', 'bench')() File "/home/frappe/bench-repo/bench/cli.py", line 40, in cli bench_command() File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __call__ return self.main(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main rv = self.invoke(ctx) File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1057, in invoke Command.invoke(self, ctx) File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke return callback(*args, **kwargs) File "/home/frappe/bench-repo/bench/commands/__init__.py", line 21, in bench_command setup_logging(bench_path=bench_path) File "/home/frappe/bench-repo/bench/utils.py", line 265, in setup_logging hdlr = logging.FileHandler(log_file) File "/usr/lib/python2.7/logging/__init__.py", line 903, in __init__ StreamHandler.__init__(self, self._open()) File "/usr/lib/python2.7/logging/__init__.py", line 928, in _open stream = open(self.baseFilename, self.mode) IOError: [Errno 13] Permission denied: '/home/frappe/frappe-bench/logs/bench.log' (env) auser@erpnext-test:/home/frappe/frappe-bench$

Ok, just as I was asking for help, resolved the permission issue as such:

chown -R auser frappe-bench
chown -R auser bench-repo

Ignore this request for help…