Error with unclear next steps from `git push` to hosted repository
Open, Needs TriagePublic

Description

I created a hosted GIT repository. Pretty much all default settings. I was able to clone it. What I noticed is there is no Master branch. When pushing back I get the following errors:

Counting objects: 4, done.
Writing objects: 100% (4/4), 256 bytes | 0 bytes/s, done.
Total 4 (delta 0), reused 0 (delta 0)
error: unpack failed: unpack-objects abnormal exit
To http://sourcecontrol.XXXX.com:8080/diffusion/TESTAGAIN/test-again-report.git
! [remote rejected] master -> master (n/a (unpacker error))
error: failed to push some refs to 'http://sourcecontrol.XXXX.com:8080/diffusion/TESTAGAIN/test-again-report.git'

(I replaced the domain name in the error for security concerns here)

psycoboy updated the task description. (Show Details)
psycoboy raised the priority of this task from to Needs Triage.
psycoboy added a subscriber: psycoboy.

It's expected that there will be no master branch. Like GitHub, we run git init, but do not create any commits or branches. If you want a branch named master, you should create a commit and push to it (as you're doing).

It's not expected that you'll experience an unpacker error. This is probably a permissions error with your configuration, but it's hard to tell from the error message. We may be limited in how effectively we can report errors, but can try exposing them on a side channel or potentially testing for errors preemptively.

epriestley renamed this task from Hosted Repository not creating Master Branch to Error with unclear next steps from `git push` to hosted repository.Apr 15 2014, 4:42 PM

Specifically, this error is not "no master branch exists". It is caused by something like:

  • sudo isn't set up correctly; or
  • the repository is owned by the wrong user; or
  • some subdirectory in the repository is owned by the wrong user; or
  • some specific file in the repository is owned by the wrong user; or
  • some binary on the system is broken; or
  • the disk experienced a write error; or
  • the disk is full.

Ideally, this error message should help you distinguish between these possibilities and give you a clear set of next steps. However, doing this is likely involved and we may be limited in our ability to report issues clearly, given that we don't directly control what git reports.

btrahan added a subscriber: btrahan.
madbarron added a subscriber: madbarron.EditedAug 25 2014, 7:03 PM

I'm getting the same error as OP. It looks like the folder for the created repo is owned by root with drwxr-xr-x. If I chown the folder to my phd user, I can push to the repo.

Should I be running phd as root, or am I missing some setup for my daemon user?

EDIT:
Oops, I am actually getting an additional message in my error:

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

Support Impact Substantial effect and unclear next steps.

We haven't seen other users having difficulty with this.

chad edited projects, added Git; removed Repositories.Jan 16 2015, 4:29 PM

When requesting approvals from 2 different review boards. 1 review board has approved, while the other has yet to take action. Edited the differential and then removed the review board that was still waiting for approval. Executed a git push origin master.

-bash-4.1$ git push origin master
Counting objects: 298, done.
Delta compression using up to 32 threads.
Compressing objects: 100% (249/249), done.
remote: fatal: early EOF
Writing objects: 100% (298/298), 12.46 MiB | 2.70 MiB/s, done.
Total 298 (delta 66), reused 0 (delta 0)
error: unpack failed: index-pack abnormal exit
To https://testingserver.com/diffusion/AUAT/a-directory.git
 ! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'https://testingserver.com/diffusion/AUAT/a-directory.git'

I got this:

Delta compression using up to 4 threads.
Compressing objects: 100% (53/53), done.
POST git-receive-pack (chunked)
Writing objects: 100% (53/53), 38.54 MiB | 2.22 MiB/s, done.
Total 53 (delta 0), reused 0 (delta 0)
error: unpack failed: unpack-objects abnormal exit
To https://..../......git
! [remote rejected] test2 -> test2 (n/a (unpacker error))

I get the above when I try to push a 100MB commit. If, however, I split the commit into parts, I can successfully push each part. The server has 60GB+ free disk space. Is there some limit that I'm hitting? Maybe it's a configuration problem on my part.

I have the same problem.

[murat@archie FooFolder]$ git push origin
Username for 'https://super.secret.domain': Murat
Password for 'https://Murat@super.secret.domain': 
Counting objects: 35, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (34/34), done.
Writing objects: 100% (35/35), 1.17 MiB | 141.00 KiB/s, done.
Total 35 (delta 11), 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 https://super.secret.domain/diffusion/1/FooFolder.git
 ! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'https://super.secret.domain/diffusion/1/FooFolder.git'

Diffusion status page shows all green for the repo. I can clone the empty repo.

So the message is clear. There is permission issue with the repo. The owner of the repo folder is phd user and I made sure that with also 'chown -R'.

Here's the permissions for the objects folder of the host repo folder.

drwxr-xr-x

I've also tried group write permission.

drwxrwxr-x

Result is the same.

I've tried to see something via running ./bin/phd debug for all three daemons, but none of them has shown anything useful. Daemons.log is the same.

I had another Phabricator instance running having no issues via SSH. This one is served over http. Could this be the issue?

Giving full access to all users for the host repo folder solved the issue. As this is a vulnerability, I shouldn't left it as 'chmod a+w'.

Any ideas to follow?

epriestley moved this task from Backlog to Triage on the Diffusion board.Feb 2 2017, 3:58 PM
aubort added a subscriber: aubort.Mar 21 2017, 8:38 PM