elbb / elbb-dev-environment

Apache License 2.0
0 stars 0 forks source link

cannot push to gitserver #8

Closed mlilien closed 4 years ago

mlilien commented 4 years ago

[marcel@srv tmp]$ git clone http://localhost:8081/myrepo.git
Cloning into 'myrepo'...
warning: You appear to have cloned an empty repository.
[marcel@srv tmp]$ cd myrepo/
[marcel@srv myrepo]$ touch foo.bar
[marcel@srv myrepo]$ git add foo.bar 
[marcel@srv myrepo]$ git commit -m "added foo.bar"
[master (root-commit) 3b8251c] added foo.bar
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 foo.bar
[marcel@srv myrepo]$ git push
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 209 bytes | 209.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
error: RPC failed; HTTP 504 curl 22 The requested URL returned error: 504
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
Everything up-to-date
mlilien commented 4 years ago

Seems to be a local problem. The above error happens in arch linux with git 2.27.0. I tried to verify the problem with ubuntu 18.04 with git 2.17.1 and 2.27.0 and its not reproducable there. It seems to be a kind of routing problem. Thats odd though, because concourse and minio in the same bridged docker network are working as expected.

mlilien commented 4 years ago

Reopening: I can reproduce this issue with a fresh vagrant arch linux box https://app.vagrantup.com/archlinux/boxes/archlinux

mlilien commented 4 years ago

it is a permission problem: what fixed this issue in my dev env:

git init --bare myrepo.git
chmod -R g+w myrepo.git

umask in ubuntu 18.04 is 0002 umask in fedora 32 is 0002 umask in arch is 0022 umask in gentoo is 0022

What do we do? Adapt documentation? Or fix it in docker image? In the image myrepo.git belongs to 1000:1000. The nginx server which needs group write permission is part of the group with gid 1000.

If nginx has a configurable uid instead, we wouldnt have this permission problem, at least if we presume that the user who starts the server is the same which uses git commands later.

Since the image uses hardcoded uids/gids, we have to fix it anyway. Otherwise user with gid!=1000 will experience problems.

siredmar commented 4 years ago

Good catch! Let's fork and fix this.

mlilien commented 4 years ago

closed by removing git env