Docker networks are not cleaned after an action has ruined

It seems that the docker networks for the actions are not cleaned. After a while I get this error from the runner

Error response from daemon: could not find an available, non-overlapping IPv4 address pool among the defaults to assign to the network

Checking the networks on the runner it seems growing

IPv4 address for br-0577fa4b1190: 192.168.208.1
  IPv4 address for br-0c3862391fab: 172.25.0.1
  IPv4 address for br-145a1aecbadd: 192.168.192.1
  IPv4 address for br-3801964bb427: 172.29.0.1
  IPv4 address for br-3807d7c3b4c5: 192.168.224.1
  IPv4 address for br-3e0eff041f50: 172.23.0.1
  IPv4 address for br-443cbfadafb0: 192.168.128.1
  IPv4 address for br-4539edea2bd8: 192.168.32.1
  IPv4 address for br-4ee75151194c: 172.30.0.1
  IPv4 address for br-5200112b60b3: 172.26.0.1
  IPv4 address for br-5475ea3ff854: 172.21.0.1
  IPv4 address for br-55b8bb49ff55: 192.168.80.1
  IPv4 address for br-587854069e90: 192.168.240.1
  IPv4 address for br-595d84d8110a: 172.18.0.1
  IPv4 address for br-700118ab19d1: 172.20.0.1
  IPv4 address for br-7086efb55d31: 172.22.0.1
  IPv4 address for br-7efdbee3a6ff: 172.27.0.1
  IPv4 address for br-9108ab3f168c: 192.168.48.1
  IPv4 address for br-a07bddd0a967: 192.168.160.1
  IPv4 address for br-a84b412cbd8d: 192.168.112.1
  IPv4 address for br-ab589f2ca475: 172.24.0.1
  IPv4 address for br-b06646b350f3: 192.168.64.1
  IPv4 address for br-b95ecb29923a: 172.28.0.1
  IPv4 address for br-cdd17d910441: 192.168.144.1
  IPv4 address for br-d50c8007e699: 192.168.176.1
  IPv4 address for br-d8f2e74b7a82: 172.19.0.1
  IPv4 address for br-e827a4d58e64: 192.168.96.1
  IPv4 address for br-e86aa9ab6347: 192.168.0.1
  IPv4 address for br-f3f12887cf4b: 172.31.0.1
  IPv4 address for docker0:         172.17.0.1
  IPv4 address for eno1:            192.168.20.203

After running docker network prune it removed all the actions container networks

~$ sudo docker network prune
WARNING! This will remove all custom networks not used by at least one container.
Are you sure you want to continue? [y/N] y
Deleted Networks:
GITEA-ACTIONS-TASK-89_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-86_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-104_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-106_WORKFLOW-Deployment-to-DO_JOB-Build-network
GITEA-ACTIONS-TASK-105_WORKFLOW-Deployment-to-DO_JOB-Build-network
GITEA-ACTIONS-TASK-99_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-94_WORKFLOW-Deployment-to-DO_JOB-Build-network
GITEA-ACTIONS-TASK-92_WORKFLOW-Deployment-to-DO_JOB-Build-network
GITEA-ACTIONS-TASK-84_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-96_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-91_WORKFLOW-Deployment-to-DO_JOB-Build-network
GITEA-ACTIONS-TASK-107_WORKFLOW-Deployment-to-DO_JOB-Build-network
GITEA-ACTIONS-TASK-82_WORKFLOW-Deployment-to-DO_JOB-Build-network
GITEA-ACTIONS-TASK-93_WORKFLOW-Deployment-to-DO_JOB-Build-network
GITEA-ACTIONS-TASK-88_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-83_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-101_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-108_WORKFLOW-Deployment-to-DO_JOB-Build-network
GITEA-ACTIONS-TASK-102_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-103_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-97_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-90_WORKFLOW-Deployment-to-DO_JOB-Build-network
GITEA-ACTIONS-TASK-81_WORKFLOW-Deployment-to-DO_JOB-Build-network
GITEA-ACTIONS-TASK-87_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-95_WORKFLOW-Deployment-to-DO_JOB-Build-network
GITEA-ACTIONS-TASK-98_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-85_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-100_WORKFLOW-Release_JOB-Build-network

Re-running the actions is now working without the docker error.

Is this a known issue, or did I miss some configuration?

Running Gitea: 1.19.3

Are you start runner with docker image? and what’s the version of your runner?

Yes, the runner is in a docker container with version 0.1.8 of the runner.

My docker-compose is looking like this

version: "3"

services:
  gitea_runner:
    image: gitea/act_runner:0.1.8
    container_name: gitea_runner
    restart: always
    volumes:
      - ./data/act_runner:/data
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - GITEA_INSTANCE_URL=http://gitea.local
      - GITEA_RUNNER_REGISTRATION_TOKEN=Div7z6Z1DNFUQgSuGasp1IAr4ldHcQXlaCp2eYKP

Could you try with the image of gitea/act_runner:nightly? I made some improvements to the network.
Here are related PRs:

If the network is still not deleted, feel free to reply.

1 Like

Thanks for the update. Installed/updated and I’ll keep an eye onto this.