I am tring to get the latest updates from github, but failed

I trying to update with the command bench update but got an error cannot open .git/FETCH_HEAD:
Permission denied.

Could you help me please.

error: cannot open .git/FETCH_HEAD: Permission denied

Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==0.92', 'console_scripts', 'bench')()
  File "/bench-repo/bench/cli.py", line 60, in cli
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/bench-repo/bench/cli.py", line 229, in _update
  File "/bench-repo/bench/utils.py", line 219, in update_bench
    exec_cmd("git pull", cwd=cwd)
  File "/bench-repo/bench/utils.py", line 104, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: git pull

Mohammed Redha

Isn’t this clear?

Hi @rmehta,

Im not sure if this is what Mohammed is experiencing but im having a similar issue.

When I run bench update then when bench gets to pull from my custom app repository its getting access denied, but if I rub git via terminal then all good using ssh.

Is there a place or somehow setting the user that bench is using to run the git pull requests for the custom apps we create?


anthoer workaround is run git pull from all frappe-bench/app/appname
then run bench migrate command


I tried that and I get the updates from repository, but when I run bench update its still trying to git command and fails complete. I think my error might be some how related to the fact that I used root to do all installs and did not create a seperate user. I say this cause on my local machine I have created a vm and managed to install app from git and do bench update.

Maybe I should re-install server with another user other then root.

Your thoughts?


@hpema108 Is your server updated?
I have provided another option for bench update.
Using git pull for specific app and bench migrate you can update specific app.

If you want to do bench update, please past your error message.

@kolate_sambhaji I re-installed the server and managed to get this to work is I dont login as root. I created a user account, and got erpnext and my app installed and updated using bench and git. Now its exciting times as I can work off the dev machine and move across the tested dev to productions using git and bench.

I tried the alternative you recommended but I think my problems was that I was logged in with the ‘root’ account.

Thanks for your assistance

1 Like