2017-02-16 257 views
0

当我尝试使用webhooks的gitlab与Jenkins进行配置时我正面临着gitlab的问题。当我把代码gitlab,观察到的错误在我的日志如下从production.log当代码被推送到gitlab时,无法触发jenkins生成

Started GET "/root/first1.git/info/refs?service=git-receive-pack" for 10.X.x.x. at 2017-02-16 13: 
41:40 -0500 
Processing by Projects::GitHttpController#info_refs as */* 
    Parameters: {"service"=>"git-receive-pack", "namespace_id"=>"root", "project_id"=>"first1.git"} 
Filter chain halted as :authenticate_user rendered or redirected 
Completed 401 Unauthorized in 20ms (Views: 0.5ms | ActiveRecord: 2.0ms) 
Started GET "/root/first1.git/info/refs?service=git-receive-pack" for 10.X.x.x at 2017-02-16 13: 
41:41 -0500 
Processing by Projects::GitHttpController#info_refs as */* 
    Parameters: {"service"=>"git-receive-pack", "namespace_id"=>"root", "project_id"=>"first1.git"} 
Filter chain halted as :authenticate_user rendered or redirected 
Completed 401 Unauthorized in 17ms (Views: 0.4ms | ActiveRecord: 1.9ms) 
Started GET "/root/first1.git/info/refs?service=git-receive-pack" for 10.x.x.x at 2017-02-16 13: 
41:41 -0500 
Processing by Projects::GitHttpController#info_refs as */* 
    Parameters: {"service"=>"git-receive-pack", "namespace_id"=>"root", "project_id"=>"first1.git"} 
Completed 200 OK in 106ms (Views: 0.2ms | ActiveRecord: 4.3ms) 
Started POST "/root/first1.git/git-receive-pack" for 10.x.x.x at 2017-02-16 13:41:42 -0500 
Processing by Projects::GitHttpController#git_receive_pack as application/x-git-receive-pack-result 
    Parameters: {"namespace_id"=>"root", "project_id"=>"first1.git"} 
Completed 200 OK in 106ms (Views: 0.3ms | ActiveRecord: 4.2ms) 
Started POST "/api/v3/internal/allowed" for 127.x.x.x at 2017-02-16 13:41:42 -0500 
Started GET "/api/v3/internal/broadcast_message" for 127.x.x.x at 2017-02-16 13:41:42 -0500 
Started GET "/api/v3/internal/merge_request_urls?project=/var/opt/gitlab/git-data/repositories/root/ 
first1.git&changes=1de706faf4e91b9f9264e114e12bdfdf16ff6d99%208b239d8f63c5db38a8d725baa62d5930371eea 
fb%20refs/heads/master%0A" for 127.x.x.x. at 2017-02-16 13:41:42 -0500 
WebHook Error => Failed to open TCP connection to 192.X.x.x.:8080 (getaddrinfo: Name or service 
not known) 
Updating statistics for project 3 
Scheduling removal of build artifacts 
+0

次要代码格式 - 使日志更具可读性。 – eugen

+0

您是否使用Jenkins管道?你如何试图从GitLab中触发Jenkins的构建? –

+0

您是否安装了此插件:https://wiki.jenkins-ci.org/display/JENKINS/GitLab+Plugin – lax1089

回答

0

从阅读你的日志:

网络挂接错误=>无法打开TCP连接192.Xxx :8080(getaddrinfo:名称或服务未知)

似乎有点奇怪,看起来像名称解析错误与IP地址发生,但通常看起来像你有某种网络问题,可以防止您的GitLab服务器无法访问conf配置IP地址和端口。

也许有防火墙阻止来自GitLab服务器的出站连接,或者webhook URL中的Jenkins服务器的IP地址不正确。

+0

是的,我甚至试图从服务器gitlab和Jenkins做telnet。但最后我重新配置了服务器,然后通过给予http 200响应开始工作。因为我们正在使用厨师来安装它,所以我摧毁了厨房,然后厨房收敛。这帮助我解决了这个错误。 – pandey

0

使用Git plugin - 据我所知,它的工作原理,不太了解Gitlab插件抱歉。

上GitLab你的网络挂接URL应设置为:

http://jenkins.example.com/git/notifyCommit?url=https://gitlab.example.com/project/repository 

替换https://gitlab.example.com/project/repository与你的Git仓库的URL。您可以通过访问gitlab中的repo来获取URL,只需将URL从浏览器URL栏中复制即可。

当您选择的事件发生时,这应该会触发Jenkins上的构建。

相关问题