GitLab CI "Job failed (system failure): prepare environment" in CI
The runner failed before your script ran, during environment preparation. "system failure" means the fault is on the runner side: a broken login shell profile, an executor that cannot start, or Docker not being reachable.
What this error means
The job fails almost immediately with "ERROR: Job failed (system failure): prepare environment: ...". No script output is produced.
ERROR: Job failed (system failure): prepare environment: exit status 1. Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more informationCommon causes
A failing shell profile on a shell executor
For the shell executor, a .bash_logout or profile that exits non-zero breaks environment preparation.
The executor cannot start the container
With the Docker executor, an unreachable daemon or a bad image stops preparation before the script.
How to fix it
Fix the runner login shell profile
- On a shell-executor runner, inspect the gitlab-runner user's shell profile scripts.
- Remove commands that exit non-zero (for example a
logoutin.bash_logout). - Re-run the job.
# as the runner user, check profile scripts
cat ~/.bash_logout ~/.bashrcVerify the executor can start
For the Docker executor, confirm the daemon is reachable and the image exists.
sudo gitlab-runner verify
docker infoHow to prevent it
- Keep the runner user's shell profiles minimal and exit-zero.
- Health-check the executor (Docker daemon, image availability).
- Monitor runner system-failure rates separately from script failures.