Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitlab CI 9.5 service is not running

I am searching a solution since 2 weeks on the web and I really need some help.

I am facing 3 problems:

Linux Gitlab-runner is not running

I have been trying to install gilab-runner with all the ways (GitLab's official repository, manualy, docker).

Everytime, when I am launching the command "gitlab-runner status" the answer is always "The server is not running." I have tried a million times to uninstall the service and re-install it but I do not want to work. I have register runners of all kind and with/without the sudo user. Without any success. This is my setup server:

Config

Ubuntu 16.04.1

Docker container gitlab 9.4.3

Port:

  • webservice :8088
  • https : 4433
  • ssh : 2222

gitlab-runner 9.5.0

How to reproduce

  • Register a shell runner http://192.168.1.10:8088/

  • Launch the command "sudo service gitlab-runner status"

    Loaded: loaded (/etc/systemd/system/gitlab-runner.service; enabled; vendor preset: enabled) Active: activating (auto-restart) (Result: exit-code) since ven. 2017-08-25 15:17:45 CEST; 45s ago Process: 13201 ExecStart=/usr/bin/gitlab-ci-multi-runner run --working-directory /home/gitlab-runner --config /etc/gitlab-runner/config.toml --service gitlab-runner --syslog --user gitlab-runner (code=exited, status=1/FAILURE) Main PID: 13201 (code=exited, status=1/FAILURE)

    systemd1: gitlab-runner.service: Unit entered failed state. systemd1: gitlab-runner.service: Failed with result 'exit-code'.

Windows gitlab-runner Error 500

Because of my problem to install gitlab-runner in Linux, I have tried to install it on another computer on Windows 10. It worked and finally the commande gitlab-runner status answered me "Service is running" (but this is just a temporary solution, I really need to make it work on linux). Anyway, I have added a CI script to a test program and launch the job but it was turning in loop over and over. When I launch the command "gitlab-runner --debug run":

...
passfile: true
extension: cmd
job=183 project=19 runner=679ccd01
Using Shell executor...                             job=183 project=19 runner=679ccd01
Waiting for signals...                              job=183 project=19 runner=679ccd01
WARNING: Job failed: exit status 128                job=183 project=19 runner=679ccd01
WARNING: Submitting job to coordinator... failed    job=183 runner=679ccd01 status=500 Internal Server Error
WARNING: Submitting job to coordinator... failed    job=183 runner=679ccd01 status=500 Internal Server Error
...

Gitlab.com and run command

So I have decided to add my project on gitlab.com, to test it.

[email protected]:sandbox_test/test_ci.git

Once again the job was turning in infinite loop until I launch on my Windows computer the command "gitlab-runner run".

Dialing: tcp gitlab.com:443 ...
Feeding runners to channel                          builds=0
Checking for jobs... received                       job=30315630 repo_url=https://gitlab.com/sandbox_test/test_ci.git runner=d98c0af1
Failed to requeue the runner:                       builds=1 runner=d98c0af1
Running with gitlab-ci-multi-runner 9.5.0 (413da38)
on Windows_shell_gitlab_com (d98c0af1)  job=30315630 project=3992201 runner=d98c0af1
Shell configuration: environment: []
dockercommand: []
command: cmd
arguments:
- /C
passfile: true
extension: cmd
job=30315630 project=3992201 runner=d98c0af1
Using Shell executor...                             job=30315630 project=3992201 runner=d98c0af1
Waiting for signals...                              job=30315630 project=3992201 runner=d98c0af1
Job succeeded                                       job=30315630 project=3992201 runner=d98c0af1

Why is it necessary to launch the run command to make work my job on gitlab.com? I expect when I run a new job it will figure out by itself without to launch manually the gitlab-runner on the CI computer...

Script .gitlab-ci.yml

Validate on CI Lint

stages:
    - build
    - test
    - deploy
build:
    stage: build
    script:
    - echo "building"
test:
    stage: test
    script:
        - echo "test"

I really need answers very fast, thanks for your help. Best Regards,Clement

UPDATE 1

I have resoved a part of my problems :

Linux Gitlab-runner is not running

  • Launch the command "gitlab-runner run --working-directory /home/gitlab-runner --config /etc/gitlab-runner/config.toml --service gitlab-runner --syslog --user gitlab-runner"
    • First Error : chdir /home/gitlab-runner: no such file or directory
      • Solution: sudo mkdir /home/gitlab-runner
    • Second Error : open /etc/gitlab-runner/config.toml: permission denied
      • Solution : sudo chmod 755 /etc/gitlab-runner/config.toml
like image 616
686InSomNia686 Avatar asked Nov 08 '22 17:11

686InSomNia686


1 Answers

I have resoved a part of my problems : Linux Gitlab-runner is not running

Launch the command "gitlab-runner run --working-directory /home/gitlab-runner --config /etc/gitlab-runner/config.toml --service gitlab-runner --syslog --user gitlab-runner"
    First Error : chdir /home/gitlab-runner: no such file or directory
        Solution: sudo mkdir /home/gitlab-runner
    Second Error : open /etc/gitlab-runner/config.toml: permission denied
        Solution : sudo chmod 755 /etc/gitlab-runner/config.toml
like image 139
686InSomNia686 Avatar answered Nov 13 '22 22:11

686InSomNia686