1

I just set up an ubuntu server in a docker, and installed gogs on it.

Everything seemed to work fine: I can access gogs via firefox without any problem, create repos or add files, but when I try to git clone a repo from it, or git push from my local computer, I get an timeout error:

fatal: unable to access 'http://xx.x.xxx.xx:8001/username/test.git/': Recv failure: Connection was reset

Some informations:

  • As you can see, I do not have a proper dns, I access it via the raw ip and port.
  • Iptables is configured to allow input/output tcp on the port 8001
  • gogs run as an init.d service
  • The gogs service's user has rw access to the gogs_repository directory

Conf: Ubuntu 18.04.1 LTS, Gogs 0.11.66

UPDATE:

  1. I configured apache2 as a proxy to be able to access gogs via the server's name and without specifying the port (by redirecting requests to the port 8001). Problem is still there.
  2. I managed to clone a repo via SSH by using the full path to the repo: git clone ssh://user@myserver/home/user/gogs-repositories/gogs-user/test.git, thanks to this post

But the problem is still there when I try to clone using http. Any idea?

UPDATE2: Here is the detailed trace of the git command that I run from my local computer:

$ git clone http://xx.x.xxx.xx:8001/user/test
14:50:09.131427 exec-cmd.c:236          trace: resolved executable dir: C:/Program Files (x86)/Git/mingw32/bin
14:50:09.132424 git.c:415               trace: built-in: git clone http://10.5.255.28:8001/user/test
Cloning into 'test'...
14:50:09.179300 run-command.c:637       trace: run_command: git remote-http origin http://10.5.255.28:8001/user/test
14:50:09.224179 exec-cmd.c:236          trace: resolved executable dir: C:/Program Files (x86)/Git/mingw32/libexec/git-core
14:50:09.228170 git.c:671               trace: exec: git-remote-http origin http://10.5.255.28:8001/user/test
14:50:09.228170 run-command.c:637       trace: run_command: git-remote-http origin http://10.5.255.28:8001/user/test
14:50:09.280032 exec-cmd.c:236          trace: resolved executable dir: C:/Program Files (x86)/Git/mingw32/libexec/git-core
* Couldn't find host 10.5.255.28 in the _netrc file; using defaults
*   Trying 10.5.255.28...
* TCP_NODELAY set
* Connected to 10.5.255.28 (10.5.255.28) port 8001 (#0)
> GET /user/test/info/refs?service=git-upload-pack HTTP/1.1
Host: 10.5.255.28:8001
User-Agent: git/2.19.1.windows.1
Accept: */*
Accept-Encoding: deflate, gzip
Pragma: no-cache

* Recv failure: Connection was reset
* Closing connection 0
fatal: unable to access 'http://xx.x.xxx.xx:8001/user/test/': Recv failure: Connection was reset
olinox14
  • 6,177
  • 2
  • 22
  • 39

0 Answers0