diff --git a/ansible/roles/gitea_runner/templates/runner-healthcheck.sh.j2 b/ansible/roles/gitea_runner/templates/runner-healthcheck.sh.j2 index 3df68a1..c86528e 100644 --- a/ansible/roles/gitea_runner/templates/runner-healthcheck.sh.j2 +++ b/ansible/roles/gitea_runner/templates/runner-healthcheck.sh.j2 @@ -234,7 +234,10 @@ if [[ "$disk_pct" -ge {{ gitea_runner_healthcheck_disk_critical }} ]]; then | awk '{print $1}' \ | xargs -r docker rm -f 2>/dev/null || true docker system prune -af --volumes || true - docker network prune -f || true + # Prune networks older than 1 hour only — removing ALL networks can + # race with Gitea Actions jobs that are mid-startup (network created + # but container not yet attached), causing "network not found" errors. + docker network prune -f --filter "until=1h" || true docker builder prune -af || true disk_pct=$(df -P / | awk 'NR==2 {gsub(/%/, "", $5); print $5}') echo "INFO: Disk usage after full prune: ${disk_pct}%"