The network of the action container run by runner is inconsistent, which makes it impossible to access the git address in the intranet. #14929

Closed
opened 2025-11-02 11:26:03 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @imblowsnow on GitHub (Sep 6, 2025).

Description

Environment

  • gitea container
    • name = gitea-server
    • network = gitea
  • runner container
    • name = gitea-runner
    • network = gitea

GITEA_INSTANCE_URL = http://gitea-server:3000/

Gitea and the runner are in the same Docker network and are connected properly.

When the runner runs, a network is automatically generated.

GITEA-ACTIONS-TASK-3_WORKFLOW-Gitea-Actions-Demo_JOB-Explore-Gitea-Actions-Explore-Gitea-Actions-network

This is not in the current gitea container's network.

fatal: unable to access 'http://gitea-server:3000/blowsnow/easytier-client/': Could not resolve host: gitea-server

Gitea Version

1.24.2

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

docker

Database

None

Originally created by @imblowsnow on GitHub (Sep 6, 2025). ### Description # Environment - gitea container - name = gitea-server - network = gitea - runner container - name = gitea-runner - network = gitea GITEA_INSTANCE_URL = http://gitea-server:3000/ Gitea and the runner are in the same Docker network and are connected properly. When the runner runs, a network is automatically generated. GITEA-ACTIONS-TASK-3_WORKFLOW-Gitea-Actions-Demo_JOB-Explore-Gitea-Actions-Explore-Gitea-Actions-network This is not in the current gitea container's network. fatal: unable to access 'http://gitea-server:3000/blowsnow/easytier-client/': Could not resolve host: gitea-server ### Gitea Version 1.24.2 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? docker ### Database None
GiteaMirror added the type/bug label 2025-11-02 11:26:03 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Sep 6, 2025):

1640e9a490/custom/conf/app.example.ini (L72-L77)

@wxiaoguang commented on GitHub (Sep 6, 2025): https://github.com/go-gitea/gitea/blob/1640e9a490f61c3abf7fb842eae7d0a0ed6314ce/custom/conf/app.example.ini#L72-L77
Author
Owner

@imblowsnow commented on GitHub (Sep 6, 2025):

gitea/custom/conf/app.example.ini

Lines 72 to 77 in 1640e9a

;; Controls how to detect the public URL.
;; Although it defaults to "legacy" (to avoid breaking existing users), most instances should use the "auto" behavior,
;; especially when the Gitea instance needs to be accessed in a container network.
;; * legacy: detect the public URL from "Host" header if "X-Forwarded-Proto" header exists, otherwise use "ROOT_URL".
;; * auto: always use "Host" header, and also use "X-Forwarded-Proto" header if it exists. If no "Host" header, use "ROOT_URL".
;PUBLIC_URL_DETECTION = legacy

This should be useless. It's not in a network.

fatal: unable to access 'http://gitea-server:3000/blowsnow/easytier-client/': Could not resolve host: gitea-server

Why can't I specify the network of the container?

@imblowsnow commented on GitHub (Sep 6, 2025): > [gitea/custom/conf/app.example.ini](https://github.com/go-gitea/gitea/blob/1640e9a490f61c3abf7fb842eae7d0a0ed6314ce/custom/conf/app.example.ini#L72-L77) > > Lines 72 to 77 in [1640e9a](/go-gitea/gitea/commit/1640e9a490f61c3abf7fb842eae7d0a0ed6314ce) > > ;; Controls how to detect the public URL. > ;; Although it defaults to "legacy" (to avoid breaking existing users), most instances should use the "auto" behavior, > ;; especially when the Gitea instance needs to be accessed in a container network. > ;; * legacy: detect the public URL from "Host" header if "X-Forwarded-Proto" header exists, otherwise use "ROOT_URL". > ;; * auto: always use "Host" header, and also use "X-Forwarded-Proto" header if it exists. If no "Host" header, use "ROOT_URL". > ;PUBLIC_URL_DETECTION = legacy This should be useless. It's not in a network. fatal: unable to access 'http://gitea-server:3000/blowsnow/easytier-client/': Could not resolve host: gitea-server Why can't I specify the network of the container?
Author
Owner
@TheFox0x7 commented on GitHub (Sep 6, 2025): You can? https://gitea.com/gitea/act_runner/src/branch/main/internal/pkg/config/config.example.yaml#L72
Author
Owner

@imblowsnow commented on GitHub (Sep 6, 2025):

You can? https://gitea.com/gitea/act_runner/src/branch/main/internal/pkg/config/config.example.yaml#L72

thanks, it is normal

@imblowsnow commented on GitHub (Sep 6, 2025): > You can? https://gitea.com/gitea/act_runner/src/branch/main/internal/pkg/config/config.example.yaml#L72 thanks, it is normal
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14929