Hi,
I am doing a bench update and it is giving me the below error, seems like it is related to Permission. May anyone, please help me in this context?
vishnu@vishnu-VirtualBox:/home/frappe/frappe-bench$ bench update
INFO:bench.utils:updating bench
error: cannot open .git/FETCH_HEAD: Permission denied
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/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
@ishanloya
After using these commands I got the below error:
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/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 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'
i had the same issue. i’ve tried all solutions everybody mentioned here. after i’ve changed whole bench directory permissions using sudo chmod -R 777 my-bench it worked. thanks everybody