Gitlab API不可访问

我在Docker容器中运行gitlab 9.5.5,当我通过http进行第一次推送时,我得到以下错误:

* upload completely sent off: 387 out of 387 bytes < HTTP/1.1 200 OK < Server: nginx < Date: Wed, 20 Sep 2017 13:17:43 GMT < Content-Type: application/x-git-receive-pack-result < Content-Length: 118 < Connection: keep-alive < Cache-Control: no-cache < X-XSS-Protection: 1; mode=block < X-Frame-Options: SAMEORIGIN < X-Content-Type-Options: nosniff < * Connection #1 to host localhost left intact remote: GitLab: API is not accessible To http://localhost/root/project01.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'http://localhost/root/project01.git' 

集装箱:

 IMAGE PORTS NAMES images/gitlab-nginx 0.0.0.0:80->80/tcp test_nginx_1 images/gitlab:9.5 test_sidekiq_1 images/gitlab:9.5 0.0.0.0:22->22/tcp test_sshd_1 images/gitlab:9.5 8181/tcp test_workhorse_1 images/gitlab:9.5 8080/tcp test_gitlab_1 images/gitlab:9.5 9999/tcp test_gitaly_1 images/postgres:9.6 5432/tcp test_postgres_1 images/redis 6379/tcp test_redis_1 

容器日志:

 gitaly_1 | {"args":["/usr/bin/git","receive-pack","--stateless-rpc","--advertise-refs","/mnt/data/repositories/root/project01.git"],"grpc.method":"InfoRefsReceivePack","grpc.request.repoPath":"root/project01.git","grpc.request.repoStorage":"default","grpc.request.topLevelGroup":"root","grpc.service":"gitaly.SmartHTTP","level":"info","msg":"spawn","path":"/usr/bin/git","peer.address":{"IP":"172.18.0.6","Port":34318,"Zone":""},"span.kind":"server","system":"grpc","time":"2017-09-20T13:22:54Z"} gitaly_1 | {"args":["/usr/bin/git","receive-pack","--stateless-rpc","--advertise-refs","/mnt/data/repositories/root/project01.git"],"command.exitCode":0,"command.inblock":0,"command.maxrss":5872,"command.oublock":0,"command.real_time_ms":3.1934519999999997,"command.system_time_ms":0,"command.user_time_ms":0,"grpc.method":"InfoRefsReceivePack","grpc.request.repoPath":"root/project01.git","grpc.request.repoStorage":"default","grpc.request.topLevelGroup":"root","grpc.service":"gitaly.SmartHTTP","level":"info","msg":"spawn complete","path":"/usr/bin/git","peer.address":{"IP":"172.18.0.6","Port":34318,"Zone":""},"span.kind":"server","system":"grpc","time":"2017-09-20T13:22:54Z"} gitaly_1 | {"grpc.code":"OK","grpc.method":"InfoRefsReceivePack","grpc.request.repoPath":"root/project01.git","grpc.request.repoStorage":"default","grpc.request.topLevelGroup":"root","grpc.service":"gitaly.SmartHTTP","grpc.time_ms":3,"level":"info","msg":"finished streaming call","peer.address":{"IP":"172.18.0.6","Port":34318,"Zone":""},"span.kind":"server","system":"grpc","time":"2017-09-20T13:22:54Z"} workhorse_1 | localhost 172.18.0.9:43596 - - "GET /root/project01.git/info/refs?service=git-receive-pack HTTP/1.1" 200 180 "" "git/2.11.0 (Apple Git-81)" 0.152725 nginx_1 | 172.18.0.1 - root "GET /root/project01.git/info/refs?service=git-receive-pack HTTP/1.1" 200 180 "-" "git/2.11.0 (Apple Git-81)" gitlab_1 | INFO -- : Started POST "/root/project01.git/git-receive-pack" for 172.18.0.6 at 2017-09-20 13:22:54 +0000 gitlab_1 | INFO -- : Processing by Projects::GitHttpController#git_receive_pack as application/x-git-receive-pack-result gitlab_1 | INFO -- : Parameters: {"namespace_id"=>"root", "project_id"=>"project01.git"} gitlab_1 | INFO -- : Completed 200 OK in 170ms (Views: 1.4ms | ActiveRecord: 11.3ms) gitlab_1 | INFO -- : Started POST "/api/v4/internal/allowed" for 172.18.0.6 at 2017-09-20 13:22:55 +0000 workhorse_1 | localhost 172.18.0.9:43606 - - [2017-09-20 13:22:54.793530983 +0000 UTC] "POST /root/project01.git/git-receive-pack HTTP/1.1" 200 113 "" "git/2.11.0 (Apple Git-81)" 0.502495 nginx_1 | 172.18.0.1 - root [20/Sep/2017:13:22:55 +0000] "POST /root/project01.git/git-receive-pack HTTP/1.1" 200 113 "-" "git/2.11.0 (Apple Git-81)" 

我通过production.rb启用了gitlabdebugging日志,但没有任何用处,只有db请求。 主分支不受保护。

我发现一些信息,这可能会发生由于url不匹配,我使用以下内容:

在gitlab-shell.yml中

 gitlab_url: "http://gitlab:8080" 

在gitlab.yml中:

 production: &base gitlab: host: localhost 

我试图改变最后一个ti gitlab或0.0.0.0,没有帮助。

它看起来像这个错误来自gitlab-shell,但我没有看到它的日志。

变成主力容器触发器gitlabshell,我没有想到基于当前的gitlab架构scheme 。 添加gitlabshell秘密到主力容器后,我解决了这个问题。