Docker act_runner: “Cannot ping the Gitea instance server” #13570

Closed
opened 2025-11-02 10:46:22 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @awfulwoman on GitHub (Oct 5, 2024).

Description

Hey all. I've already asked this in the forum, but as there was no response I'm trying here.

I'm trying to get runners up and running with my Docker-based Gitea instance, but I'm running into some problems that don't seem to be documented/observed anywhere - hoping for some help.

When I set a runner up, feeding it the token from the Runners page (I've tried instance, org, and repo level) the runner logs indicate that it cannot connect to my instance.

level=error msg="Cannot ping the Gitea instance server" error="unavailable: parse \"\\\"https://gitea.<redacted>\\\"/api/actions/ping.v1.PingService/Ping\": invalid URI for request"

I've entered into the container shell with docker -it exec gitea sh and confirmed that it can connect to the base Gitea instance via ping and curl. This is both via the Docker IP address and via the reverse proxy route.

However, the actual path (/api/actions) that the runner is trying to connect to doesn't seem to exist, neither externally or when looking at the Swagger API. I read somewhere that this won't be created until the runner is registered. But as I understand it the Docker-based runners are meant to attempt registration themselves, so I'm not sure where this would happen.

Is there something fundamental that I'm missing here?

Docker compose file below.

name: "gitea"
services:
  gitea:
    container_name: gitea
    ports:
      - "3000:3000"
      - "222:22"
    image: gitea/gitea:latest
    restart: unless-stopped
    env_file: .environment_vars
    environment:
      - GITEA__actions__ENABLED="true"
    healthcheck:
      test: ["CMD", "curl", "-f", "gitea.<redacted>"]
      interval: 10s
      retries: 3
      start_period: 30s
      timeout: 10s
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.gitea.rule=Host(`gitea.<redacted>`)"
      - "traefik.http.routers.gitea.tls=true"
      - "traefik.http.routers.gitea.tls.certresolver=letsencrypt"
      - "traefik.http.services.gitea.loadbalancer.server.port=3000"
    volumes:
      - "/fastpool/compositions/gitea/config/gitea:/data"
      - /etc/localtime:/etc/localtime:ro
    networks:
      - "<redacted_network>"

  runner01:
    image: gitea/act_runner:latest
    container_name: runner01
    restart: unless-stopped
    privileged: true
    depends_on:
      gitea:
        condition: service_healthy
        restart: true
    volumes:
      - "/fastpool/compositions/gitea/config/runners:/data"
      - "/fastpool/compositions/gitea/config/runners/config.yaml:/config.yaml"
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - GITEA_RUNNER_LOG_LEVEL="trace"
      - GITEA_INSTANCE_URL="https://gitea.<redacted>"
      - GITEA_RUNNER_REGISTRATION_TOKEN="<redacted>"
      - GITEA_RUNNER_JOB_CONTAINER_NETWORK="<redacted_network>"
    networks:
      - "<redacted_network>"

networks:
  "<redacted_network>":
    external: true

Gitea Version

1.22.2 built with GNU Make 4.4.1, go1.22.6 : bindata, timetzdata, sqlite, sqlite_unlock_notify

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

Ubuntu 24.04

How are you running Gitea?

Running both Gitea and the runners from Docker, using the latest tag.

Database

SQLite

Originally created by @awfulwoman on GitHub (Oct 5, 2024). ### Description Hey all. I've already asked this in the forum, but as there was no response I'm trying here. I'm trying to get runners up and running with my Docker-based Gitea instance, but I'm running into some problems that don't seem to be documented/observed anywhere - hoping for some help. When I set a runner up, feeding it the token from the Runners page (I've tried instance, org, and repo level) the runner logs indicate that it cannot connect to my instance. ``` level=error msg="Cannot ping the Gitea instance server" error="unavailable: parse \"\\\"https://gitea.<redacted>\\\"/api/actions/ping.v1.PingService/Ping\": invalid URI for request" ``` I've entered into the container shell with `docker -it exec gitea sh` and confirmed that it can connect to the base Gitea instance via ping and curl. This is both via the Docker IP address and via the reverse proxy route. However, the actual path (`/api/actions`) that the runner is trying to connect to doesn't seem to exist, neither externally or when looking at the Swagger API. I read somewhere that this won't be created until the runner is registered. But as I understand it the Docker-based runners are meant to attempt registration themselves, so I'm not sure where this would happen. Is there something fundamental that I'm missing here? Docker compose file below. ``` name: "gitea" services: gitea: container_name: gitea ports: - "3000:3000" - "222:22" image: gitea/gitea:latest restart: unless-stopped env_file: .environment_vars environment: - GITEA__actions__ENABLED="true" healthcheck: test: ["CMD", "curl", "-f", "gitea.<redacted>"] interval: 10s retries: 3 start_period: 30s timeout: 10s labels: - "traefik.enable=true" - "traefik.http.routers.gitea.rule=Host(`gitea.<redacted>`)" - "traefik.http.routers.gitea.tls=true" - "traefik.http.routers.gitea.tls.certresolver=letsencrypt" - "traefik.http.services.gitea.loadbalancer.server.port=3000" volumes: - "/fastpool/compositions/gitea/config/gitea:/data" - /etc/localtime:/etc/localtime:ro networks: - "<redacted_network>" runner01: image: gitea/act_runner:latest container_name: runner01 restart: unless-stopped privileged: true depends_on: gitea: condition: service_healthy restart: true volumes: - "/fastpool/compositions/gitea/config/runners:/data" - "/fastpool/compositions/gitea/config/runners/config.yaml:/config.yaml" - /var/run/docker.sock:/var/run/docker.sock environment: - GITEA_RUNNER_LOG_LEVEL="trace" - GITEA_INSTANCE_URL="https://gitea.<redacted>" - GITEA_RUNNER_REGISTRATION_TOKEN="<redacted>" - GITEA_RUNNER_JOB_CONTAINER_NETWORK="<redacted_network>" networks: - "<redacted_network>" networks: "<redacted_network>": external: true ``` ### Gitea Version 1.22.2 built with GNU Make 4.4.1, go1.22.6 : bindata, timetzdata, sqlite, sqlite_unlock_notify ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System Ubuntu 24.04 ### How are you running Gitea? Running both Gitea and the runners from Docker, using the `latest` tag. ### Database SQLite
GiteaMirror added the type/bugissue/needs-feedback labels 2025-11-02 10:46:22 -06:00
Author
Owner

@awfulwoman commented on GitHub (Oct 5, 2024):

I just want to emphasise here that /api/actions/ping.v1.PingService/Ping is not present on my Gitea instance, and that this appears to be the fundamental problem.

Is it meant to be there by default, or only after the first runner has registered?

@awfulwoman commented on GitHub (Oct 5, 2024): I just want to emphasise here that `/api/actions/ping.v1.PingService/Ping` is not present on my Gitea instance, and that this appears to be the fundamental problem. Is it meant to be there by default, or only after the first runner has registered?
Author
Owner

@lunny commented on GitHub (Oct 5, 2024):

Have you enabled actions in Gitea side?

@lunny commented on GitHub (Oct 5, 2024): Have you enabled actions in Gitea side?
Author
Owner

@awfulwoman commented on GitHub (Oct 5, 2024):

Have you enabled actions in Gitea side?

I've just edited to show that I've been passing the environment var GITEA__actions__ENABLED="true" to Gitea.

Besides, the quickstart docs say that Actions are enabled by default.

Since 1.21.0, Actions are enabled by default. If you are using versions before 1.21.0, you need to add the following to the configuration file to enable it:

@awfulwoman commented on GitHub (Oct 5, 2024): > Have you enabled actions in Gitea side? I've just edited to show that I've been passing the environment var `GITEA__actions__ENABLED="true"` to Gitea. Besides, [the quickstart docs say that Actions are enabled by default](https://docs.gitea.com/usage/actions/quickstart). > Since 1.21.0, Actions are enabled by default. If you are using versions before 1.21.0, you need to add the following to the configuration file to enable it:
Author
Owner

@yp05327 commented on GitHub (Oct 7, 2024):

Maybe no need to add " in environments.

As the error msg, the URL is "https://gitea.<redacted>"/api/actions/ping.v1.PingService/Ping which can not be handled.

@yp05327 commented on GitHub (Oct 7, 2024): Maybe no need to add `"` in environments. As the error msg, the URL is `"https://gitea.<redacted>"/api/actions/ping.v1.PingService/Ping` which can not be handled.
Author
Owner

@awfulwoman commented on GitHub (Oct 7, 2024):

Okay, but Actions do appear to be enabled as I can go to the Gitea web interface at https://git.<redacted_domain>/admin/actions/runners and request an Actions token.

The problem seems to be that the runners are requesting a URL that doesn't exist on Gitea.

I feel like I've missed something fundamental here...

@awfulwoman commented on GitHub (Oct 7, 2024): Okay, but Actions do appear to be enabled as I can go to the Gitea web interface at `https://git.<redacted_domain>/admin/actions/runners` and request an Actions token. The problem seems to be that the runners are requesting a URL that doesn't exist on Gitea. I feel like I've missed something fundamental here...
Author
Owner

@awfulwoman commented on GitHub (Oct 20, 2024):

hahaha the fundamental part I missed was using the quotes wrongly as @yp05327 suggested.

Folks, do not attempt to debug things when you're falling asleep with exhaustion.

@awfulwoman commented on GitHub (Oct 20, 2024): hahaha the fundamental part I missed was using the quotes wrongly as @yp05327 suggested. Folks, do not attempt to debug things when you're falling asleep with exhaustion.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13570