cicd system_error ai_generated true

错误:自托管运行器 'self-hosted-runner-01' 处于离线状态,无法接受任务。请确保运行器正在运行并已连接。

Error: The runner 'self-hosted-runner-01' is offline and cannot accept jobs. Ensure the runner is running and connected.

ID: cicd/github-actions-self-hosted-runner-offline

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

版本兼容性

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

根因分析

自托管的 GitHub Actions 运行器因网络问题、运行器进程过期或令牌过期而失去与 GitHub 的连接,导致无法分配任务。

English

The self-hosted GitHub Actions runner has lost connection to GitHub due to network issues, stale runner process, or token expiration, preventing job assignment.

generic

官方文档

https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners

解决方案

  1. Run the runner's config script with --replace to regenerate the token and reconnect: ./config.sh remove --token <token> && ./config.sh --url https://github.com/org/repo --token <new_token>
  2. Check runner logs at ~/actions-runner/_diag/Runner_*.log for specific errors (e.g., HTTP 401) and fix network or proxy settings accordingly.

无效尝试

常见但无效的做法:

  1. 40% 失败

    Restarting the runner service without checking logs may mask underlying issues like token expiry.

  2. 20% 失败

    Uninstalling and re-installing the runner is overkill and loses configuration; often a simple reconnect suffices.

  3. 30% 失败

    Killing the runner process and restarting may not fix token issues if the runner is not properly re-authenticated.