HTTP server not responding when using custom networks settings #6610

Closed
opened 2025-11-02 07:01:21 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @gbwebdev on GitHub (Dec 30, 2020).

  • Gitea version (or commit ref): 1.13.1
  • Git version: 2.26.2
  • Operating system:
    docker (using gitea/gitea:latest-rootless) on Debian 10.
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:
    Docker console :
    Attaching to git_gbweb_fr__docker-compose_app_1
    app_1  | 2020/12/30 17:42:17 cmd/web.go:113:runWeb() [I] Starting Gitea on PID: 1
    app_1  | 2020/12/30 17:42:17 ...dules/setting/git.go:94:newGit() [I] Git Version: 2.26.2, Wire Protocol Version 2 Enabled
    app_1  | 2020/12/30 17:42:17 routers/init.go:127:PreInstallInit() [T] AppPath: /usr/local/bin/gitea
    app_1  | 2020/12/30 17:42:17 routers/init.go:128:PreInstallInit() [T] AppWorkPath: /var/lib/gitea
    app_1  | 2020/12/30 17:42:17 routers/init.go:129:PreInstallInit() [T] Custom path: /var/lib/gitea/custom
    app_1  | 2020/12/30 17:42:17 routers/init.go:130:PreInstallInit() [T] Log path: /var/lib/gitea/data/log
    app_1  | 2020/12/30 17:42:17 routers/init.go:131:PreInstallInit() [T] Preparing to run install page
    app_1  | 2020/12/30 17:42:17 routers/init.go:134:PreInstallInit() [I] SQLite3 Supported
    app_1  | 2020/12/30 17:42:19 cmd/web.go:223:listen() [I] Listen: http://0.0.0.0:3000
    app_1  | 2020/12/30 17:42:19 ...s/graceful/server.go:55:NewServer() [I] Starting new server: tcp:0.0.0.0:3000 on PID: 1
    app_1  | 2020/12/30 17:42:19 ...s/graceful/server.go:66:func1() [D] Starting server on tcp:0.0.0.0:3000 (PID: 1)
    

There is simply nothing to see !
Same in the log file in the data volume.

It is as if the HTTP request does not even reach the server.

Description

I run Gitea using Docker, with the following docker-compose file :

version: "3.5"

networks:
  frontend:
    name: git_frontend
    ipam:
      config:
        - subnet: "172.30.40.0/26"

services:
  app:
    image: gitea/gitea:latest-rootless
    env_file:
      - gitea.env
    restart: always
    networks:
      frontend:
        ipv4_address: "172.30.40.8"
    volumes:
      - ./gitea:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - 127.0.0.2:3004:3000
      - {{ my_server_address }}:****:22    

And the following env-file :

APP_NAME=****
RUN_MODE=prod
DOMAIN=*****
SSH_DOMAIN=*****
ROOT_URL=https://*****/
SSH_PORT=*****
SSH_LISTEN_PORT=22
DB_PASSWD=*****
DISABLE_REGISTRATION=true
USER_UID=2004
USER_GID=2004

Up to yesterday, it worked quite fine.
But after an update (I cannot tell if it was from 1.13.0 or older) it does not work anymore :

  • Whether I use my browser or a simple curl http://127.0.0.2:3004 on the server, it times out.
  • I get nothing in the logs (as if the HTTP request does not even reach the server).

If I comment the network settings, however, it works :

version: "3.5"

services:
  app:
    image: gitea/gitea:latest-rootless
    env_file:
      - gitea.env
    restart: always
    volumes:
      - ./gitea:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - 127.0.0.2:3004:3000
      - {{ my_server_address }}:****:22

I also tried to set the HTTP listening address in the env-file :

HTTP_ADDR=172.30.40.8
[...]

But it seems this setting is ignored (I still read "Listen: http://0.0.0.0:3000" in the logs).

I even tried with a fresh install and the result is the same...

Originally created by @gbwebdev on GitHub (Dec 30, 2020). - Gitea version (or commit ref): 1.13.1 - Git version: 2.26.2 - Operating system: docker (using gitea/gitea:latest-rootless) on Debian 10. - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - Log gist: Docker console : ```Recreating git_gbweb_fr__docker-compose_app_1 ... done Attaching to git_gbweb_fr__docker-compose_app_1 app_1 | 2020/12/30 17:42:17 cmd/web.go:113:runWeb() [I] Starting Gitea on PID: 1 app_1 | 2020/12/30 17:42:17 ...dules/setting/git.go:94:newGit() [I] Git Version: 2.26.2, Wire Protocol Version 2 Enabled app_1 | 2020/12/30 17:42:17 routers/init.go:127:PreInstallInit() [T] AppPath: /usr/local/bin/gitea app_1 | 2020/12/30 17:42:17 routers/init.go:128:PreInstallInit() [T] AppWorkPath: /var/lib/gitea app_1 | 2020/12/30 17:42:17 routers/init.go:129:PreInstallInit() [T] Custom path: /var/lib/gitea/custom app_1 | 2020/12/30 17:42:17 routers/init.go:130:PreInstallInit() [T] Log path: /var/lib/gitea/data/log app_1 | 2020/12/30 17:42:17 routers/init.go:131:PreInstallInit() [T] Preparing to run install page app_1 | 2020/12/30 17:42:17 routers/init.go:134:PreInstallInit() [I] SQLite3 Supported app_1 | 2020/12/30 17:42:19 cmd/web.go:223:listen() [I] Listen: http://0.0.0.0:3000 app_1 | 2020/12/30 17:42:19 ...s/graceful/server.go:55:NewServer() [I] Starting new server: tcp:0.0.0.0:3000 on PID: 1 app_1 | 2020/12/30 17:42:19 ...s/graceful/server.go:66:func1() [D] Starting server on tcp:0.0.0.0:3000 (PID: 1) ``` There is simply nothing to see ! Same in the log file in the data volume. It is as if the HTTP request does not even reach the server. ## Description I run Gitea using Docker, with the following docker-compose file : ``` version: "3.5" networks: frontend: name: git_frontend ipam: config: - subnet: "172.30.40.0/26" services: app: image: gitea/gitea:latest-rootless env_file: - gitea.env restart: always networks: frontend: ipv4_address: "172.30.40.8" volumes: - ./gitea:/data - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro ports: - 127.0.0.2:3004:3000 - {{ my_server_address }}:****:22 ``` And the following env-file : ``` APP_NAME=**** RUN_MODE=prod DOMAIN=***** SSH_DOMAIN=***** ROOT_URL=https://*****/ SSH_PORT=***** SSH_LISTEN_PORT=22 DB_PASSWD=***** DISABLE_REGISTRATION=true USER_UID=2004 USER_GID=2004 ``` Up to yesterday, it worked quite fine. But after an update (I cannot tell if it was from 1.13.0 or older) it does not work anymore : - Whether I use my browser or a simple `curl http://127.0.0.2:3004` on the server, it times out. - I get nothing in the logs (as if the HTTP request does not even reach the server). If I comment the network settings, however, it works : ``` version: "3.5" services: app: image: gitea/gitea:latest-rootless env_file: - gitea.env restart: always volumes: - ./gitea:/data - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro ports: - 127.0.0.2:3004:3000 - {{ my_server_address }}:****:22 ``` I also tried to set the HTTP listening address in the env-file : ``` HTTP_ADDR=172.30.40.8 [...] ``` But it seems this setting is ignored (I still read "Listen: http://0.0.0.0:3000" in the logs). I even tried with a fresh install and the result is the same...
GiteaMirror added the topic/distribution label 2025-11-02 07:01:21 -06:00
Author
Owner

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

Outdated

@wxiaoguang commented on GitHub (Apr 16, 2022): Outdated
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6610