Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitLab CI - Project Build In Neverending Pending-State

I'm in some trouble with GitLab CI. I followed offical guide on: https://github.com/gitlabhq/gitlab-ci/blob/master/doc/installation.md

Everything was ok, no errors nowhere. I followed Runner-Setup, too. Anything alright.

But...

When I add a runner to a project and then try to build nothing happens. It could be that I have not fully understood something or some of my configs are wrong. I'm absolutely new to GitLab CI, but I like it and I want to learn new stuff.

I would be very very glad if someone could help me in some way.

Thanks!

enter image description here

enter image description here

enter image description here

BIG UPDATE: Just figured out that:

~/gitlab-runners/gitlab-ci-runner$ bin/runner

Starting a runner process manually solves the problem but if I look at the gitlab-ci-runner in /etc/init.d -> it is running !?!

~/gitlab-runners/gitlab-ci-runner$ sudo /etc/init.d/gitlab-ci-runner start
Number of registered runners in PID file=1
Number of running runners=0
Error! GitLab CI runner(s) (gitlab-ci-runner) appear to be running already! Try stopping them first. Exiting.
~/gitlab-runners/gitlab-ci-runner$ sudo /etc/init.d/gitlab-ci-runner stop
Number of registered runners in PID file=1
Number of running runners=0
WARNING: Numbers of registered runners don't match number of running runners. Will try to stop them all
Registered runners=1
Running runners=0
Trying to stop registered runners...kill: No such process
OK
Trying to kill ghost runners...OK

What's wrong here? I'm out of my power or not seeing the problem?!

like image 477
x4k3p Avatar asked Oct 18 '13 21:10

x4k3p


1 Answers

Problem solved!

You need to edit some values in /etc/init.d/gitlab-ci-runner script!

APP_ROOT="**PATH_TO**/gitlab-runners/gitlab-ci-runner"
APP_USER="**USER_WITH_DIRRIGHTS!**"
PID_PATH="$APP_ROOT/tmp/pids"
PROCESS_NAME="ruby ./bin/runner"
RUNNERS_PID="$PID_PATH/runners.pid"
RUNNERS_NUM=1 # number of runners to spawn 
START_RUNNER="nohup bundle exec ./bin/runner"

Now it works!

like image 171
x4k3p Avatar answered Nov 13 '22 13:11

x4k3p