Error: insufficient permission for adding an object to repository database

Last login: Fri Jun 17 17:33:22 on console Gavin-MacBook-Pro:~ gavin$ ssh root@128.199.200.6 root@128.199.200.6's password: Last failed login: Fri Jun 17 10:41:50 EDT 2016 from 116.31.116.7 on ssh:notty There were 32143 failed login attempts since the last successful login. Last login: Tue Jun 14 18:21:52 2016 from bba424104.alshamil.net.ae -bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory [root@123 ~]# bench update INFO:bench.utils:updating bench remote: Counting objects: 56, done. remote: Compressing objects: 100% (20/20), done. remote: Total 56 (delta 45), reused 47 (delta 36), 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 9, in <module> load_entry_point('bench==0.1', 'console_scripts', 'bench')() File "/home/frappe/bench-repo/bench/cli.py", line 40, in cli bench_command() File "/usr/lib/python2.7/site-packages/click/core.py", line 664, in __call__ return self.main(*args, **kwargs) File "/usr/lib/python2.7/site-packages/click/core.py", line 644, in main rv = self.invoke(ctx) File "/usr/lib/python2.7/site-packages/click/core.py", line 991, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/lib/python2.7/site-packages/click/core.py", line 837, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/lib/python2.7/site-packages/click/core.py", line 464, in invoke return callback(*args, **kwargs) File "/home/frappe/bench-repo/bench/commands/update.py", line 34, in update update_bench() File "/home/frappe/bench-repo/bench/utils.py", line 194, in update_bench exec_cmd("git pull", cwd=cwd) File "/home/frappe/bench-repo/bench/utils.py", line 100, in exec_cmd raise CommandFailedError(cmd) bench.utils.CommandFailedError: git pull

I searched on forum and using pip install --upgrade -e /home/frappe/bench-repo, but error still.

I uninstalled Poll app following, but when i using bench update, error still.
cd /home/frappe/frappe-bench
bench uninstall-app poll # if this doesn’t work, try: bench remove-from-installed-apps poll
./env/bin/pip uninstall poll
Remove poll folder from frappe-bench/apps. Then remove poll from sites/apps.txt.

[frappe@123 ~]$ bench update INFO:bench.utils:updating bench remote: Counting objects: 56, done. remote: Total 56 (delta 41), reused 41 (delta 41), pack-reused 15 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 9, in <module> load_entry_point('bench==0.1', 'console_scripts', 'bench')() File "/home/frappe/bench-repo/bench/cli.py", line 40, in cli bench_command() File "/usr/lib/python2.7/site-packages/click/core.py", line 664, in __call__ return self.main(*args, **kwargs) File "/usr/lib/python2.7/site-packages/click/core.py", line 644, in main rv = self.invoke(ctx) File "/usr/lib/python2.7/site-packages/click/core.py", line 991, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/lib/python2.7/site-packages/click/core.py", line 837, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/lib/python2.7/site-packages/click/core.py", line 464, in invoke return callback(*args, **kwargs) File "/home/frappe/bench-repo/bench/commands/update.py", line 34, in update update_bench() File "/home/frappe/bench-repo/bench/utils.py", line 194, in update_bench exec_cmd("git pull", cwd=cwd) File "/home/frappe/bench-repo/bench/utils.py", line 100, in exec_cmd raise CommandFailedError(cmd) bench.utils.CommandFailedError: git pull [frappe@123 ~]$

Seems there is an issue with the permissions of your folder / files. Have a look at this :

I plan to use the way:
cd .git/objects ls -al sudo chown -R yourname:yourgroup *

or
cd /path/to/repo.git chgrp -R groupname . chmod -R g+rwX . find . -type d -exec chmod g+s '{}' +

But i don’t know where is .git/objects, or repo.git, can anybody can tell me route of these files?