ERROR: Job failed: exit code 1 CI/CD Origin: Build & delivery Last updated 25 Oct 2026

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.

Exact message you may see 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
Seen on: GitLab CI

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 1 on a failed check

⚡ Quick fix

  1. Read the log above the final line for the first error
  2. Run the same image locally: docker run --rm -it -v "$PWD":/w -w /w IMAGE sh
  3. Add set -eu and echo key variables

Detailed fix by platform

GitLab CI

  1. Debug with variables: CI_DEBUG_TRACE: "true" (prints all commands; may expose secrets — use carefully)

How to diagnose

  1. Log — First error line?
  2. Image — Same tool versions locally?
  3. 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:

Where this error sits

Origin: Build & delivery. Errors that are often confused with or caused by this one (click to open):

.gitlab-ci.yml invalid — GitLab CI: Found errors in your .gitlab-ci.yml: jobs:build config contains unknown keys: scripts (CI/CD).gitlab-ci.yml invalidCannot connect to the Docker daemon (GitLab) — GitLab CI: Cannot connect to the Docker daemon at tcp://docker:2375. Is the docker daemon running? (CI/CD)Cannot connect to the…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 (CI/CD)failed to pull image …Job depends on artifacts that have expired — GitLab CI: This job could not start because it could not retrieve the needed artifacts (dependencies: build). (CI/CD)Job depends on artifa…Process completed with exit code 1 — GitHub Actions: Error: Process completed with exit code 1. (CI/CD)Process completed wit…Process completed with exit code 127 — GitHub Actions: Error: Process completed with exit code 127 — command not found (CI/CD)Process completed wit…Uploading artifacts: too large archive — GitLab CI: ERROR: Uploading artifacts as "archive" to coordinator... too large archive id=123 responseStatus=413 Request Entity Too Large (CI/CD)Uploading artifacts: …ERROR: Jo…

Explore the map of this error Full error map →

🧠 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.