Unable to commit files to Gitea instance running on a Docker container #5938

Closed
opened 2025-11-02 06:40:49 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @Keith3679 on GitHub (Sep 2, 2020).

We have an instance of Gitea running on a Docker container within our cluster of services running on a CentOS 7 VM using Hyper-V on a Windows 10 Laptop. This Gitea server is listening on port 8443 on the Docker network (internally) and port 11002 (externally) which can be connected to via :11002 which is mapped to 8443 by the Docker Compose file, from my Windows box or any other box on my physical network.

I am able to connect to the repo and pull the repo down just fine, so the port forwarding is working correctly. Whenever I try to commit a file to :11002/.git, which is 192.168.2.56, I get the attached pre-receive hook declined error message with a dial tcp message. The here is my global public IP address. How does this know about my global public IP and why is it trying to connect to :8443?

I've talked to the Gitea Admin and he said they do not have any pre-receive hooks defined.

The funny thing is, if I connect my laptop via WiFi to a mobile hotspot, everything works great! Why am I getting this error when I plugged into ethernet only?

I've looked at all the gitea logs and container logs and I'm not seeing anything stick out other than...

[Macaron] 2020-09-02 13:18:22: Started GET /centralrepo.git/info/refs?service=git-receive-pack for 192.168.2.52
[Macaron] 2020-09-02 13:18:22: Completed GET /centralrepo.git/info/refs?service=git-receive-pack 401 Unauthorized in 3.428415ms
[Macaron] 2020-09-02 13:18:22: Started GET /centralrepo.git/info/refs?service=git-receive-pack for 192.168.2.52
[Macaron] 2020-09-02 13:18:22: Completed GET /centralrepo.git/info/refs?service=git-receive-pack 200 OK in 75.915127ms
[Macaron] 2020-09-02 13:18:23: Started POST /centralrepo.git/git-receive-pack for 192.168.2.52
[Macaron] 2020-09-02 13:18:23: Completed POST /centralrepo.git/git-receive-pack 200 OK in 350.232111ms
[root@noms ~]#

but I eventually get an OK 200.

error

Originally created by @Keith3679 on GitHub (Sep 2, 2020). We have an instance of Gitea running on a Docker container within our cluster of services running on a CentOS 7 VM using Hyper-V on a Windows 10 Laptop. This Gitea server is listening on port 8443 on the Docker network (internally) and port 11002 (externally) which can be connected to via <CentOS HOST IP>:11002 which is mapped to 8443 by the Docker Compose file, from my Windows box or any other box on my physical network. I am able to connect to the repo and pull the repo down just fine, so the port forwarding is working correctly. Whenever I try to commit a file to <CentOS HOST IP>:11002/<REPO>.git, which is 192.168.2.56, I get the attached pre-receive hook declined error message with a dial tcp <GLOBAL IP> message. The <GLOBAL IP> here is my global public IP address. How does this know about my global public IP and why is it trying to connect to <GLOBAL IP>:8443? I've talked to the Gitea Admin and he said they do not have any pre-receive hooks defined. The funny thing is, if I connect my laptop via WiFi to a mobile hotspot, everything works great! Why am I getting this error when I plugged into ethernet only? I've looked at all the gitea logs and container logs and I'm not seeing anything stick out other than... [Macaron] 2020-09-02 13:18:22: Started GET /centralrepo.git/info/refs?service=git-receive-pack for 192.168.2.52 [Macaron] 2020-09-02 13:18:22: Completed GET /centralrepo.git/info/refs?service=git-receive-pack 401 Unauthorized in 3.428415ms [Macaron] 2020-09-02 13:18:22: Started GET /centralrepo.git/info/refs?service=git-receive-pack for 192.168.2.52 [Macaron] 2020-09-02 13:18:22: Completed GET /centralrepo.git/info/refs?service=git-receive-pack 200 OK in 75.915127ms [Macaron] 2020-09-02 13:18:23: Started POST /centralrepo.git/git-receive-pack for 192.168.2.52 [Macaron] 2020-09-02 13:18:23: Completed POST /centralrepo.git/git-receive-pack 200 OK in 350.232111ms [root@noms ~]# but I eventually get an OK 200. ![error](https://user-images.githubusercontent.com/12281546/92043114-7801c980-ed49-11ea-8ad0-4d6a7815e8f9.jpg)
GiteaMirror added the issue/stale label 2025-11-02 06:40:49 -06:00
Author
Owner

@imloama commented on GitHub (Sep 9, 2020):

i modify the config of gitea, and it works, 'cause i save the data in the host

edit the config file in path of ${data}/gitea/conf/app.ini

change the HTTP_PORT to 3000 and add LOCAL_ROOT_URL


[server]
APP_DATA_PATH    = /data/gitea
DOMAIN           =  your domain
SSH_DOMAIN       = your ssh domain
HTTP_PORT        = 3000 # the right port
ROOT_URL         =  your domain
DISABLE_SSH      = false
SSH_PORT         = 100022
SSH_LISTEN_PORT  = 22
LFS_START_SERVER = true
LFS_CONTENT_PATH = /data/git/lfs
LFS_JWT_SECRET   = QwXxlJDRSRWM4aqYBFjVUvYbVyc_kGBctDJpaIeBXA4
OFFLINE_MODE     = false
LOCAL_ROOT_URL   = your domain

@imloama commented on GitHub (Sep 9, 2020): i modify the config of gitea, and it works, 'cause i save the data in the host edit the config file in path of `${data}/gitea/conf/app.ini` change the `HTTP_PORT` to 3000 and add `LOCAL_ROOT_URL` ``` [server] APP_DATA_PATH = /data/gitea DOMAIN = your domain SSH_DOMAIN = your ssh domain HTTP_PORT = 3000 # the right port ROOT_URL = your domain DISABLE_SSH = false SSH_PORT = 100022 SSH_LISTEN_PORT = 22 LFS_START_SERVER = true LFS_CONTENT_PATH = /data/git/lfs LFS_JWT_SECRET = QwXxlJDRSRWM4aqYBFjVUvYbVyc_kGBctDJpaIeBXA4 OFFLINE_MODE = false LOCAL_ROOT_URL = your domain ```
Author
Owner

@stale[bot] commented on GitHub (Nov 9, 2020):

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale[bot] commented on GitHub (Nov 9, 2020): This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.
Author
Owner

@wxiaoguang commented on GitHub (Apr 29, 2022):

It's caused by incorrect LOCAL_ROOT_URL in app.ini

@wxiaoguang commented on GitHub (Apr 29, 2022): It's caused by incorrect `LOCAL_ROOT_URL` in `app.ini`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5938