Skip to content

How to Fix Gitea Actions Runner Connection Error

DodaTech Updated 2026-06-24 2 min read

In this tutorial, you'll learn about How to Fix Gitea Actions Runner Connection Error. We cover key concepts, practical examples, and best practices.

Gitea Actions runner shows Failed to register runner: Post "https://git.example.com/api/v1/...": dial tcp: connection refused or jobs stay in the pending queue forever.

The Problem

$ ./act_runner register
INFO Registering runner, arch=amd64, os=linux, version=0.1.0
DEBU Run register...
ERRO Failed to register runner: Post "https://git.example.com/api/v1/..." dial tcp: connection refused

Step-by-Step Fix

Step 1: Verify the Gitea instance can reach itself

curl -v https://git.example.com/api/v1/version

Expected:

{"version":"1.21.0"}

Step 2: Get the runner registration token

From the Gitea UI: Settings > Actions > Runners > Create Runner. Copy the token.

Step 3: Register the runner manually

./act_runner register \
  --instance https://git.example.com \
  --token YOUR_TOKEN \
  --name docker-runner \
  --labels ubuntu-latest:docker://node:20-bullseye

Step 4: Check runner status

./act_runner daemon

Step 5: Verify jobs are picked up

Run a test workflow:

on: [push]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - run: echo "Hello, Gitea Actions!"

Prevention Tips

  • Use docker or host runner mode to match your workflow needs
  • Register multiple runners for concurrent job execution
  • Set GRITEA_RUNNER_TOKEN as an environment variable in CI provisioning scripts

Common Mistakes with actions runner

  1. Using return to exit a function early instead of wrapping a pure value in the monad
  2. Mixing let bindings with <- bindings in do notation, producing type errors
  3. Overlapping type class instances that cause GHC to reject the program with ambiguous dispatch errors

These mistakes appear frequently in real-world GITEA code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.

Practice Exercise

Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.

This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.

FAQ

### Why does act_runner fail with "invalid token"?

The registration token expires after 30 days if not used. Generate a fresh token from Settings > Actions > Runners. Ensure you copy the full token including any trailing characters.

Can I run Gitea Actions runner as a systemd service?

Yes. Copy act_runner to /usr/local/bin and create /etc/systemd/system/act_runner.service. Run sudo systemctl enable --now act_runner to start it on boot.

How do I scale Gitea Actions runners horizontally?

Deploy multiple act_runner instances with the same token. Each registers independently and picks up jobs from the shared queue. Use Kubernetes or Docker Compose to manage them.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro