Gitlab CI Shell Runner返回500错误

Gitlab CI Shell Runner返回500错误,gitlab,gitlab-ci,gitlab-ci-runner,Gitlab,Gitlab Ci,Gitlab Ci Runner,我正在试用Gitlab,并已从omnibus安装程序安装了它。然后我下载并安装了gitlab runner,以试用CI功能。我创建了一个新的运行程序,将访问令牌设置为我试图在其上运行CI的项目的访问令牌,将executer设置为shell,并将.gitlab-CI.yml添加到项目中 当我按下按钮时,作业被跑步者捡起,我立即失败,输出如下 Cloning repository... Initialized empty Git repository in /sites/gitlab/git-dat

我正在试用Gitlab,并已从omnibus安装程序安装了它。然后我下载并安装了gitlab runner,以试用CI功能。我创建了一个新的运行程序,将访问令牌设置为我试图在其上运行CI的项目的访问令牌,将executer设置为shell,并将.gitlab-CI.yml添加到项目中

当我按下按钮时,作业被跑步者捡起,我立即失败,输出如下

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
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
我尝试创建一个共享的跑步者,它也做了同样的事情。然后,我在调试模式下运行运行程序,它给出了以下输出

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
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
错误日志输出

"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"
我觉得我遗漏了一些基本的东西,但通过查看有关使用gitlab runner的文档和文章,我不确定是什么

它在RHEL 7上运行,我对配置所做的唯一更改是在apache上为它提供服务时禁用nginx,并移动数据存储目录

任何帮助都将不胜感激

谢谢


科林

好,因此找到命令sudo gitlab ctl tail提供了追踪答案所需的详细信息

JWT::DecodeError(无JSON web令牌):
lib/gitlab/workhorse.rb:120:in'verify\u api\u request!'
app/controllers/projects/git\u http\u client\u controller.rb:154:in'verify\u workhorse\u api!'
lib/gitlab/questure_profiler/middleware.rb:15:in'call'
lib/gitlab/middleware/go.rb:16:in'call'

我在谷歌上搜索了错误,发现了这个问题

所以我的问题中遗漏了一个重要的细节,那就是我使用Apache作为前端。如果您查看关于该问题的底部注释,它将向您展示如何更新虚拟主机配置以解决该问题。不幸的是,我的Apache版本是2.2,您需要2.4才能进行修复

我所做的是更改Apache的默认端口,然后更改Gitlabs配置以使用捆绑的nginx服务器。现在一切都完美无瑕:)