Bench update gives an error

Hello, running bench update today gave me an error.

Already up-to-date.
error: cannot open .git/FETCH_HEAD: Permission denied

Error: None
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.1’, ‘console_scripts’, ‘bench’)()
File “/home/fozilex/bench-repo/bench/cli.py”, line 38, in cli
return bench()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 488, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 474, in main
self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 758, in invoke
return self.invoke_subcommand(ctx, cmd, cmd_name, ctx.args[1:])
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 767, in invoke_subcommand
return cmd.invoke(cmd_ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 659, in invoke
ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 325, in invoke
return callback(*args, **kwargs)
File “/home/fozilex/bench-repo/bench/cli.py”, line 163, in update
pull_all_apps()
File “/home/fozilex/bench-repo/bench/app.py”, line 73, in pull_all_apps
exec_cmd(“git pull {rebase} upstream {branch}”.format(rebase=rebase, branch=get_current_branch(app_dir)), cwd=app_dir)
File “/home/fozilex/bench-repo/bench/utils.py”, line 61, in exec_cmd
subprocess.check_call(cmd, cwd=cwd, shell=True)
File “/usr/lib/python2.7/subprocess.py”, line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'git pull upstream develop
’ returned non-zero exit status 1

I have checked the .git folder permission and everything seems to be ok. What should I do?

sudo chown fozilex:fozilex -R /home/fozilex/frappe-bench/apps and try again.

1 Like

Thank you for your tip. It’s work.