GitLab CI: ERROR: Job failed: exit code 1
The last command in the job's script returned a non-zero status; the real error is printed earlier in the job log.
ERROR: Job failed: exit code 1Job failed: exit code 1ERROR: Job failed: exit code 127Cleaning up project directory and file based variables ERROR: Job failed Meaning
GitLab runs script lines in order and stops at the first failing command. Scroll up for the first red output. Exit code 127 means command not found, 126 not executable, 137 out of memory/killed. Reproduce locally in the same image to confirm.
Common causes
- Tests, lint or build failing
- Command not found or not executable (127/126)
- Missing variable or file in the image
- Out-of-memory kill (137)
- Script
exit 1on a failed check
⚡ Quick fix
- Read the log above the final line for the first error
- Run the same image locally:
docker run --rm -it -v "$PWD":/w -w /w IMAGE sh - Add
set -euand echo key variables
Detailed fix by platform
GitLab CI
- Debug with
variables: CI_DEBUG_TRACE: "true"(prints all commands; may expose secrets — use carefully)
How to diagnose
- Log — First error line?
- Image — Same tool versions locally?
- Code — Which exit code?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- .gitlab-ci.yml invalid GitLab CI: Found errors in your .gitlab-ci.yml: jobs:build config contains unknown keys: scripts
- Cannot connect to the Docker daemon (GitLab) GitLab CI: Cannot connect to the Docker daemon at tcp://docker:2375. Is the docker daemon running?
- failed to pull image (GitLab) GitLab CI: ERROR: Job failed: failed to pull image "registry.example.com/app:latest" with specified policies [always]: access forbidden
Most viewed in CI/CD
- The process '/usr/bin/git' failed with exit code 128 GitHub Actions: Error: The process '/usr/bin/git' failed with exit code 128
- This job is stuck because you don't have any active runners GitLab CI: This job is stuck because you don't have any active runners online or available with any of these tags assigned to them
- Resource not accessible by integration GitHub Actions: Error: Resource not accessible by integration (403)
Other ways to find it
Where this error sits
Origin: Build & delivery. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 25 Oct 2026