CONNECTION_TIMEOUT cicd network_error ai_generated true

错误:无法连接到 github.com 端口 443:连接超时

Error: Failed to connect to github.com port 443: Connection timed out

ID: cicd/github-actions-connect-timeout

其他格式: JSON · Markdown 中文 · English
80%修复率
85%置信度
1证据数
2023-05-12首次发现

版本兼容性

版本状态引入弃用备注
GitHub Actions Runner 2.308.0 active
Ubuntu 22.04 active
Windows Server 2022 active

根因分析

GitHub Actions 运行器无法访问 github.com,原因是运行器环境中的 DNS 解析失败、防火墙规则或代理配置错误。

English

GitHub Actions runner cannot reach github.com due to DNS resolution failures, firewall rules, or proxy misconfiguration in the runner environment.

generic

官方文档

https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners#communication-between-self-hosted-runners-and-github

解决方案

  1. Configure proxy environment variables on the runner: export http_proxy=http://proxy.example.com:8080; export https_proxy=http://proxy.example.com:8080; export no_proxy=localhost,127.0.0.1
  2. Update DNS resolver on the runner host: echo 'nameserver 8.8.8.8' > /etc/resolv.conf
  3. Check firewall rules to allow outbound HTTPS (port 443) to github.com IP ranges: nslookup github.com; sudo ufw allow out on eth0 to any port 443 proto tcp

无效尝试

常见但无效的做法:

  1. Restarting the runner service without checking network connectivity 95% 失败

    The underlying network issue persists after restart; runner will hit the same timeout on next job.

  2. Adding more retries via workflow configuration (e.g., 'retry-on-error: true') 90% 失败

    GitHub Actions retries only the step, not the underlying TCP connection; connection timeout is fatal and not recoverable by retrying the step.

  3. Clearing runner cache and reinstalling the runner agent 85% 失败

    The runner agent itself is functional; the issue is at the network layer, not the agent software.