# ERROR: Job failed: artifact 'build.zip' has expired. Artifacts are kept for 30 days by default.

- **ID:** `cicd/gitlab-ci-artifact-expired`
- **Domain:** cicd
- **Category:** resource_error
- **Error Code:** `GITLAB_ARTIFACT_EXPIRED`
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

GitLab CI job fails because it tries to download an artifact from a previous job that has exceeded its retention period, causing the pipeline to break when dependencies rely on expired artifacts.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| GitLab CE/EE 16.5.x | active | — | — |
| GitLab CE/EE 16.6.x | active | — | — |
| GitLab Runner 16.5.x | active | — | — |

## Workarounds

1. **Re-run the entire pipeline from the beginning to regenerate all artifacts: navigate to the pipeline page and click 'Run Pipeline' or trigger a new pipeline via API: `curl --request POST --header "PRIVATE-TOKEN: $TOKEN" "https://gitlab.com/api/v4/projects/$PROJECT_ID/trigger/pipeline?ref=main"`** (95% success)
   ```
   Re-run the entire pipeline from the beginning to regenerate all artifacts: navigate to the pipeline page and click 'Run Pipeline' or trigger a new pipeline via API: `curl --request POST --header "PRIVATE-TOKEN: $TOKEN" "https://gitlab.com/api/v4/projects/$PROJECT_ID/trigger/pipeline?ref=main"`
   ```
2. **If only specific artifacts are needed, re-run the job that produces the artifact using `CI_JOB_TOKEN` to download fresh artifacts: `job: stage: build script: - echo "Rebuilding artifact" artifacts: paths: [build.zip] expire_in: 7 days`** (85% success)
   ```
   If only specific artifacts are needed, re-run the job that produces the artifact using `CI_JOB_TOKEN` to download fresh artifacts: `job: stage: build script: - echo "Rebuilding artifact" artifacts: paths: [build.zip] expire_in: 7 days`
   ```

## Dead Ends

- **** — Increasing the artifact retention period in the project settings does not retroactively extend the expiration of already-uploaded artifacts; only new artifacts will have the updated policy. (80% fail)
- **** — Re-running the failed job without re-running the dependency job that produced the artifact will still reference the expired artifact and fail again. (90% fail)
