fehmelchen
fehmelchen

Reputation: 203

Git push error with insufficient permissions, failed to write object

I have a Git repo on my own server (Ubuntu 14.04) and everything was working fine, but not now if I try to push some commit from the server to the repo on the server I get this error:

Counting objects: 51, done.
Compressing objects: 100% (22/22), done.
Writing objects: 100% (26/26), 2.78 KiB | 0 bytes/s, done.
Total 26 (delta 23), reused 7 (delta 4)
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 ssh://git@myserver/home/git/projects/myproject/
 ! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'ssh://git@myserver/home/git/projects/myproject/'

I know, I shouldn't be pushing from the server, but I need to (I'm not happy about it).

My Git config file is this:

[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[branch "master"]
[remote "origin"]
        url = ssh://git@myserver/home/git/projects/myproject/
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
        remote = origin
        merge = refs/heads/master
[receive]
        denyNonFastForwards = True

If I clone the repo in a new location on the server, the problem keeps coming up. If I push from my Windows PC to the server everything is fine.

Has anyone any idea about it?

I've tried Git Push Error: insufficient permission for adding an object to repository database already without any effect on the problem.

Permissions are set correctly. I pushed a few hours ago data to the repo (from server to server and from pc to server) without a problem.

Upvotes: 1

Views: 3828

Answers (1)

fehmelchen
fehmelchen

Reputation: 203

I changed my git remote url so there is no ssh via

git remote set-url origin /home/git/projects/myproject/

Upvotes: 2

Related Questions