2017-09-20 45 views
0

我跑gitlab 9.5.5在码头工人的容器,当我通过http我收到以下错误使新的存储库的第一推:Gitlab API是无法访问的

* 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但是没有什么用处日启用gitlab调试日志只有数据库请求。主分支不受保护。

我发现了一些信息,这可能会发生由于网址不匹配,我使用以下命令:

gitlab-shell.yml

gitlab_url: "http://gitlab:8080" 

内内gitlab.yml:

production: &base 
    gitlab: 
    host: localhost 

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

它看起来像这样的错误来自gitlab壳,但我没有看到在其日志中。

回答