# 将工件上传到协调器...太大

- **ID:** `cicd/gitlab-runner-artifact-size-limit`
- **领域:** cicd
- **类别:** resource_error
- **验证级别:** ai_generated
- **修复率:** 85%

## 根因

GitLab Runner 无法上传作业工件，因为其超出了 GitLab 实例或 runner 上配置的最大允许大小。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| GitLab CE 15.0+ | active | — | — |
| GitLab Runner 15.0+ | active | — | — |
| GitLab EE 15.0+ | active | — | — |

## 解决方案

1. ```
   Increase the maximum artifact size in the GitLab admin panel (Admin Area > Settings > CI/CD > Artifacts > Maximum artifacts size (MB)) and restart the runner: `gitlab-runner restart`
   ```
2. ```
   Compress the artifact before uploading by adding a job step to tar and gzip the output: `tar -czf output.tar.gz build/ && artifacts: paths: [output.tar.gz]`
   ```

## 无效尝试

- **Increasing the artifact size limit in the project's CI/CD settings without restarting the runner** — The runner's cache or configuration may still enforce the old limit; a runner restart is required for the new limit to take effect. (40% 失败率)
- **Setting the artifact size limit to an extremely high value (e.g., 999999 MB) in the GitLab admin panel** — The GitLab instance may have a hard-coded maximum limit (e.g., 1 GB) that cannot be overridden via the admin UI; also, unlimited size can cause disk space issues. (60% 失败率)
