Error when run bench update

INFO:bench.utils:updating bench
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 5 (delta 3), reused 4 (delta 2), pack-reused 0
error: insufficient permission for adding an object to repository database .git/objects
fatal: failed to write object
fatal: unpack-objects failed
Traceback (most recent call last):
File “/usr/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/.bench/bench/”, line 40, in cli
File “/usr/lib64/python2.7/site-packages/click/”, line 716, in call
return self.main(*args, **kwargs)
File “/usr/lib64/python2.7/site-packages/click/”, line 696, in main
rv = self.invoke(ctx)
File “/usr/lib64/python2.7/site-packages/click/”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/lib64/python2.7/site-packages/click/”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/lib64/python2.7/site-packages/click/”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/frappe/.bench/bench/commands/”, line 35, in update
File “/home/frappe/.bench/bench/”, line 227, in update_bench
exec_cmd(“git pull”, cwd=cwd)
File “/home/frappe/.bench/bench/”, line 127, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: git pull

You have issues with the perms. What user are you using to run the command bench update?
See if this can help: File and folder Permissions

Or you can type in the console ll -h to see who is the owner of the frappe apps folders (also files and subfolders recursively) and then logging in with that user and password to the operating system.

thanks I’ll try that

found out some of the folders belong to root. So I change owner of /home/frappe/.bench to frappe with the command chown -R frappe:frappe /home/frappe/.bench. after that login as frappe user and run bench update --upgrade.
Solved the perm problem.