首页 文章

Gitlab CI Shell Runner返回500错误

提问于
浏览
0

我正在尝试Gitlab并从omnibus安装程序安装它 . 然后我下载并安装了gitlab-runner来试用CI功能 . 我创建了一个新的运行器,将访问令牌设置为我正在尝试运行CI的项目的访问令牌,将 Actuator 设置为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

错误日志输出

"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上运行,我对配置的唯一更改是禁用nginx,因为我在apache上提供服务并移动数据存储目录 .

任何帮助将不胜感激

谢谢

科林

1 回答

  • 0

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

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

    我用谷歌搜索错误并遇到了这个问题Error 500 Gitlab

    所以我从我的问题中遗漏的一个重要细节是我使用Apache作为我的前端 . 如果您查看问题的最后评论,它会向您显示如何更新虚拟主机配置以解决问题 . 不幸的是,我的Apache版本是2.2,你需要2.4才能使修复工作 .

    我所做的是更改Apache的默认端口,然后更改Gitlabs配置以使用捆绑的nginx服务器 . 现在一切都很完美,没有任何麻烦:)

相关问题