2

There are a couple good posts on this subject, but I am not sure if they apply to my circumstances.

Error pushing to GitHub - insufficient permission for adding an object to repository database

Git Push Error: insufficient permission for adding an object to repository database

When performing a push as a normal user, I receive the following error:

remote: error: insufficient permission for adding an object to
    repository database ./objects

Note that I can push if I am logged on the local machine as root. I see from the below that the origin is git@easybbb.com:root I don't know if it matters, but the remote repository I am trying to push to is hosted by me using GitLab.

The local git directory is 0775 and belongs to group "www", I've executed chmod -R g+rwxs /var/www/ to ensure that new files are of group "www", the normal user that is trying to push belongs to group "www", and I've executed git config core.sharedRepository group.

How do I fix this error?

git push origin master
Counting objects: 11, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 487 bytes | 0 bytes/s, done.
Total 6 (delta 5), reused 0 (delta 0)
remote: error: insufficient permission for adding an object to repository database ./objects
remote: fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
To git@easybbb.com:root/bidjunction.git
 ! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'git@easybbb.com:root/bidjunction.git'

git remote -v
origin  git@easybbb.com:root/bidjunction.git (fetch)
origin  git@easybbb.com:root/bidjunction.git (push)
Community
  • 1
  • 1
user1032531
  • 24,767
  • 68
  • 217
  • 387
  • You have no privileges on the server you are pushing on. Maybe the user does not exist. – Eddwin Paz May 05 '14 at 17:38
  • delete your local repo and --clone the repo again. thats a quick fix else try git push --all – Eddwin Paz May 05 '14 at 17:40
  • @eddwinpaz. Turned out I only had the original user configured on GitLab which was "root". I've since created a new user. This user is different than a Linux user, right? I have a Linux user called "git" which GitLab uses to access Git. – user1032531 May 05 '14 at 19:50

1 Answers1

1

It has nothing to do regarding the many similar questions. The key is "remote: error: ". The problem is the remote repository (GitLab which is similar to GitHub). Making all associated files owned by git solved the problem.

user1032531
  • 24,767
  • 68
  • 217
  • 387