0
votes

I am trying out Gitlab and have installed it from the omnibus installer. I then downloaded and installed gitlab-runner to try out the CI features. I created a new runner, set the access token to that of the project I'm trying to run CI on, set the executer to shell and added a .gitlab-ci.yml to the project.

When I pushed the job got picked up by the runner and imediately failed with the following output

Cloning repository...
Initialized empty Git repository in /sites/gitlab/git-data/repositories/xxxx/builds/9f19e8df/0/xxxx/ci/.git/
error: The requested URL returned error: 500 Internal Server Error while accessing http://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@xxxx/xxxx/ci.git/info/refs

fatal: HTTP request failed

ERROR: Job failed: exit status 1

I tried creating a shared runner and it did the same thing. I then ran the runner in debug mode and it gave the following output

Running with gitlab-runner 10.6.0 (a3543a27)        job=10 project=11 runner=9f19e8df
on SharedRunner 9f19e8df                          job=10 project=11 runner=9f19e8df
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=10 project=11 runner=9f19e8df
Using Shell executor...                             job=10 project=11 runner=9f19e8df
Waiting for signals...                              job=10 project=11 runner=9f19e8df
WARNING: Job failed: exit status 1                  job=10 project=11 runner=9f19e8df

The error log outputs

"GET /xxxx/ci.git/info/refs?service=git-upload-pack HTTP/1.1" 500 2902 "-" "git/1.7.1"
"GET /xxxx/ci.git/info/refs HTTP/1.1" 401 26 "-" "git/1.7.1"
"GET /xxxx/ci.git/info/refs HTTP/1.1" 500 2902 "-" "git/1.7.1"

I feel like I'm missing something fundamental but looking through the documentation and articles on using the gitlab-runner I'm not sure what.

It's running on RHEL 7 and the only changes to the configuration I made was to disable nginx as I'm serving it on apache and to move the data storage directories.

Any help would be greatly appreciated

Thanks

Colin

1

1 Answers

0
votes

Ok so finding the command sudo gitlab-ctl tail provided the details needed to track down the answer

JWT::DecodeError (Nil JSON web token): lib/gitlab/workhorse.rb:120:in `verify_api_request!' app/controllers/projects/git_http_client_controller.rb:154:in `verify_workhorse_api!' lib/gitlab/questure_profiler/middleware.rb:15:in `call' lib/gitlab/middleware/go.rb:16:in `call'

I googled the error and came across this issue Error 500 Gitlab

So an important detail I missed from my question is that I was using Apache as my front end. If you look at the bottom comment on the issue it shows you how to update the virtual host config to resolve the issue. Unfortunately for me my version of Apache is 2.2 and you need 2.4 for the fix to work.

What I did instead was change Apache's default port and then changed Gitlabs config to use the bundled nginx server. Everything now works perfectly without any hassle :)