本文主要列举云效 Flow 流水线常见的错误及相应解决方案。
CodeRepoNotFound:代码库不存在或无权限访问
-
问题描述:构建步骤克隆代码失败,报错。Repository path not found, please check if the repository path is correct...
-
解决方案:可能是配置流水线代码源的人员离职或者被回收权限导致无法正常克隆代码,请检查相应服务连接授权账号的克隆该代码库的权限是否正常。
RunnerRegisterFailed:主机Runner注册失败
-
问题描述:主机安装Runner失败,报错
Runner register failed.,典型报错如下。Connecting to agent-install-cn-qingdao.oss-cn-qingdao-internal.aliyuncs.com (agent-install-cn-qingdao.oss-cn-qingd ao-internal.aliyuncs.com)|100.115.173.8|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 3441 (3.4K) [text/x-sh] Saving to: '/tmp/aliyun/yunxiao-runner/install.sh' 0K ... 100% 349M=0s 2023-03-10 09:33:06 (349 MB/s) – '/tmp/aliyun/yunxiao-runner/install.sh' saved [3441/3441] INFO[2023-03-10T09:33:06+08:00] [Register] options: {"URL":"https://gray-devops-build.aliyuncs.com","Token":"PRRvr Mb4sKhgCGrqLzgt","Tenant":"be-yxctbiii2ml4aydisrlfozvk","Workspace":"/root/yunxiao/be-yxctbiii2ml4aydisrlfozvk/run ner","SceanInterval":5,"Concurrency":50,"RunnerGroupUUID":"HY8UhW1PmS2hpw27","ConfigPath":"/root/yunxiao/be-yxctbiii2ml4ayd isrlfozvk/runner/config","InstanceId":"i-m5e1ct61ztfma76svxr4","InstanceName":"flow-deploy-test2","AutoUpgrade":tr ue,"UpgradeInterval":1200} INFO[2023-03-10T09:33:06+08:00] Runner config file not exists, generating... INFO[2023-03-10T09:33:06+08:00] bind to HY8UhW1PmS2hpw27 INFO[2023-03-10T09:33:26+08:00] POST /api/v2/runner/register, time spent 20.00 s INFO[2023-03-10T09:33:26+08:00] register runner=074d1122e7bb4abeaf2fcc5d5184a3ab ERRO[2023-03-10T09:33:26+08:00] Runner register failed. WARN[2023-03-10T09:33:26+08:00] configfile /root/yunxiao/be-yxctbiii2ml4aydisrlfozvk/runner/config/config.yml remo ved. FATA[2023-03-10T09:33:26+08:00] couldn't execute POST against https://gray-devops-build.aliyuncs.com/api/v2/runne r/register: Post https://gray-devops-build.aliyuncs.com/api/v2/runner/register: net/http: request canceled while w aiting for connection (Client.Timeout exceeded while awaiting headers) -
解决方案:通常为偶发性Runner注册异常导致,可稍后重试安装。
RunnerUnavailable:主机Runner状态不可用
-
问题描述:主机部署失败,报错。
-
解决方案:
-
检查主机磁盘是否满了
df -hl,如果磁盘已满请尝试清理后重试。 -
检查 Runner service 状态,如果状态非 active(running),通过命令
systemctl restart runner-{版本}-{租户名称}.service重启 Runner service。 -
检查网络连通性是否正常。
-
通过
systemctl status runner-{版本}-{租户名称}.service查询 Runner service 状态,并截取 service 进程参数 --configPath=***,如下所示。[root@ecs-for-batch-deploy-1 ~]# systemctl status runner-v0.5-be-bnyxxxlllzpci0q606yt.service ● runner-v0.5-be-xxxlllzpci0q606yt.service – Aliyun yunxiao runner polling jobs to execute Loaded: loaded (/etc/systemd/system/runner-v0.5-be-bxxxpci0q606yt.service; enabled; vendor preset: disabled) Active: active (running) since Tue 2022-10-11 10:50:56 CST; 41min ago Main PID: 1405243 (runner) Tasks: 10 (limit: 48875) Memory: 13.7M CGroup: /system.slice/runner-v0.5-be-bnyxxxq606yt.service └─1405243 /usr/local/share/yunxiao-runner/v0.5/runner run --configPath=/root/yunxiao/be-bnykv60t83lllzpci0q606yt/runner/config 10月 11 11:31:46 ecs-for-batch-deploy-1 runner[1405243]: INFO[2022-10-11T11:31:46+08:00] [runner] no new job, skip. runner=9e7073c92b2fa8b35bc0efd3eec051f8 10月 11 11:31:46 ecs-for-batch-deploy-1 runner[1405243]: INFO[2022-10-11T11:31:46+08:00] counter current: 0, limit: 50 10月 11 11:32:01 ecs-for-batch-deploy-1 runner[1405243]: WARN[2022-10-11T11:32:01+08:00] Response status code: 204 body data: 10月 11 11:32:01 ecs-for-batch-deploy-1 runner[1405243]: INFO[2022-10-11T11:32:01+08:00] POST /api/v2/builds/request, time spent 15.07 s 10月 11 11:32:01 ecs-for-batch-deploy-1 runner[1405243]: INFO[2022-10-11T11:32:01+08:00] [runner] no new job, skip. runner=9e7073c92b2fa8b35bc0efd3eec051f8 10月 11 11:32:01 ecs-for-batch-deploy-1 runner[1405243]: INFO[2022-10-11T11:32:01+08:00] counter current: 0, limit: 50 10月 11 11:32:16 ecs-for-batch-deploy-1 runner[1405243]: WARN[2022-10-11T11:32:16+08:00] -
查看 configPath 中URL
cat {***}/config.yml | grep url。[root@ecs-for-batch-deploy-1 config]# cat /root/yunxiao/be-bnykv60t83lllzpci0q606yt/runner/config/config.yml | grep url url: https://xxx.com [root@ecs-for-batch-deploy-1 config]# -
通过以下命令判断是否可以正常访问。
# 注意替换下面命令中的url curl '{url}/api/v2/runner/storage/latest?os=linux&arch=amd64'
-
-
RamRoleNoPermission:RAM角色无权限获取资源
-
问题描述:通过阿里云服务连接授权获取阿里云资源时,报错「RAM角色无权限获取资源」。
-
解决方案:检查当前服务连接授权账号下是否存在 AliyunDevopsRolePolicy 权限策略,查看当前云效组织 ID 是否被 Deny。如果存在,删除该条策略,等待5-10分钟后重试即可。
在策略 JSON 的 Statement 中,
Action为devops:UseServiceAuth,Resource值的最后一段即为云效组织 ID(例如643f85d1b0e1dda6507e5a23),Effect为Deny。确认该云效组织 ID 与当前组织一致后,删除该策略即可。