Background
Recently I have changed my desktop to a mini PC and update the Ubuntu system from v18 to v20, which cause the gitlab runner failed to run.
The annoying part is that it only outputs "Job failed! exit status 1" which provides no clue for my debugging.
Troubleshooting and Solutions
Retrieve more debugging information using "journalctl -u gitlab-runner", which did provides some clues with the following
But it still is not enough for my debugging, I then find out with the help of the reference links, stated that the ".bash_logout" script of the user "gitlab-runner" is the cause of the issue. Every time when the runner use user gitlab-runner and exit (logout) the account, under the logout script, clear_console script
References
- https://gitlab.com/gitlab-org/gitlab-runner/-/issues/3849#note_134536963
- https://www.cnblogs.com/zhang-guansheng/p/13429527.html
- https://forum.gitlab.com/t/self-hosted-gitlab-ci-runner-shell-executer-fails-immediately-with-error-job-failed-exit-status-1/33252
- https://docs.gitlab.com/runner/faq/#run-in---debug-mode
- https://unix.stackexchange.com/questions/225401/how-to-see-full-log-from-systemctl-status-service