Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitlab CI runner job failed exit status 1 when changing directory

I am using my personal machine as a runner for an iOS project using Fastlane. This is mainly due to the fact that shared runners aren't setup for iOS as they don't have Xcode installed.

My jobs fail immediately when changing directory.

It's a shell runner, no other custom config at all.

Any suggestions?

enter image description here

This is the output when running gitlab-runner --debug run and starting a job.

Checking for jobs... received                       job=59131527 repo_url=https://gitlab.com/nickfarrant/aqualog-asset-collection.git runner=159b2b59
Failed to requeue the runner:                       builds=1 runner=159b2b59
Running with gitlab-ci-multi-runner 9.0.2 (fa8b86d)
  on Nicks-Bink-iMac (159b2b59)  job=59131527 project=5134442 runner=159b2b59
Shell configuration: environment: []
dockercommand:
- sh
- -c
- "if [ -x /usr/local/bin/bash ]; then\n\texec /usr/local/bin/bash --login\nelif [
  -x /usr/bin/bash ]; then\n\texec /usr/bin/bash --login\nelif [ -x /bin/bash ]; then\n\texec
  /bin/bash --login\nelif [ -x /usr/local/bin/sh ]; then\n\texec /usr/local/bin/sh
  --login\nelif [ -x /usr/bin/sh ]; then\n\texec /usr/bin/sh --login\nelif [ -x /bin/sh
  ]; then\n\texec /bin/sh --login\nelse\n\techo shell not found\n\texit 1\nfi\n\n"
command: bash
arguments:
- --login
passfile: false
extension: ""
  job=59131527 project=5134442 runner=159b2b59
Using Shell executor...                             job=59131527 project=5134442 runner=159b2b59
Waiting for signals...                              job=59131527 project=5134442 runner=159b2b59
WARNING: Job failed: exit status 1                  job=59131527 project=5134442 runner=159b2b59
like image 941
nickjf89 Avatar asked Mar 23 '18 07:03

nickjf89


2 Answers

I added - unset cd before the - cd .. step and it worked.

like image 178
Issa Shabo Avatar answered Nov 17 '22 11:11

Issa Shabo


I hit the same situation, and I solve it.

I guess you used rvm.

Please follow below:

  1. Open terminal

  2. echo 'unset cd'>>~/.bash_profile; source ~/.bash_profile

  3. retry pipeline.

Refer to: https://juejin.im/post/5a65977bf265da3e4e25bfb8

like image 27
Wei Avatar answered Nov 17 '22 10:11

Wei