DEV Community

Pradeep Kumar
Pradeep Kumar

Posted on • Edited on

4 3

[Solved] GitLab Runner : ERROR: Job failed: prepare environment: Process exited with status 1. Check...

If you are getting following error in your when running gitlab ci/cd job via gitlab-runner:

ERROR: Job failed: prepare environment: Process exited with status 1. 
Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading 
for more information
Enter fullscreen mode Exit fullscreen mode

Solution

Run following command:

find / -name .bash_logout
Enter fullscreen mode Exit fullscreen mode

and delete following files if exist

sudo rm -r /home/gitlab-runner/.bash_logout
sudo rm -r /home/<username>/.bash_logout
Enter fullscreen mode Exit fullscreen mode

Try to re-run the jobs it should be working.

Read More at: Common Gitlab Runner errors and solutions

Top comments (4)

Collapse
 
taoliax profile image
whatever,with your plasure

It works for me!
Could you tell me why this would work?

Collapse
 
rumanhuq profile image
Ruman

Thanks a bunch!

Collapse
 
neo1989 profile image
Neo

You saved me. Thanks so much.

Collapse
 
themodernpk profile image
Pradeep Kumar

@neo1989 you're most welcome :), feel free to bookmark dev.to/themodernpk/gitlab-runner-e...

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay