Webook集成给出500错误,并且日志为Net :: OpenTimeout(执行到期)

时间:2018-12-31 10:28:15

标签: gitlab

我的GitLab托管在DO上,多年来运行良好。我一直在不时地更新它,目前它是最新版本。

几天前,我已经更新了托管其他服务器的服务器,并且更新集成停止工作之后。我怀疑这是最重要的原因,因为仅重新安装了服务器,但到目前为止我无法使其正常工作。

我已执行的步骤

  1. 我已经在最重要的地方重新创建了钩子,并在gitlab上重新启用了钩子-不走运

  2. 我尝试了斜杠命令,这些命令正在工作。我可以使用/repo issue show 123从最重要的方面获取问题的详细信息,然后在聊天中获取-因此它可以正常工作

  3. 我去了https://docs.mattermost.com/developer/webhooks-incoming.html进行测试,可以确认我的网络挂钩正在正常工作。

    curl -i -X POST --data-urlencode 'payload={"text": "Hello, this is some text\nThis is more text. :tada:"}' http://domain.xyz:8065/hooks/zr7raaqojtgm7j4ormyzzoyz9h

  4. 在这一点上,似乎最重要的一面工作正常。所以我进入gitlab实例并查看了它的日志。我不确定他们在这里

/var/log/gitlab/gitlab-rails/production.log

Started PUT "/aala/secret-project/services/mattermost/test" for XXX.XXX.XXX.XXX at 2018-12-31 14:48:25 +0500
Processing by Projects::ServicesController#test as JSON
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "service"=>{"active"=>"1", "push_events"=>"1", "push_channel"=>"project-secret-project", "issues_events"=>"1", "issue_channel"=>"project-secret-project", "confidential_issues_events"=>"1", "confidential_issue_channel"=>"project-secret-project", "merge_requests_events"=>"1", "merge_request_channel"=>"project-secret-project", "note_events"=>"1", "note_channel"=>"project-secret-project", "confidential_note_events"=>"1", "confidential_note_channel"=>"project-secret-project", "tag_push_events"=>"1", "tag_push_channel"=>"project-secret-project", "pipeline_events"=>"0", "pipeline_channel"=>"", "wiki_page_events"=>"1", "wiki_page_channel"=>"", "webhook"=>"[FILTERED]", "username"=>"GitLab", "notify_only_broken_pipelines"=>"0", "notify_only_default_branch"=>"0"}, "namespace_id"=>"aala", "project_id"=>"secret-project", "id"=>"mattermost"}
Completed 500 Internal Server Error in 60092ms (ActiveRecord: 6.0ms)

Net::OpenTimeout (execution expired):

app/models/project_services/chat_notification_service.rb:100:in `notify'
app/models/project_services/chat_notification_service.rb:76:in `execute'
app/models/service.rb:162:in `test'
app/controllers/projects/services_controller.rb:41:in `service_test_response'
app/controllers/projects/services_controller.rb:30:in `test'
lib/gitlab/i18n.rb:55:in `with_locale'
lib/gitlab/i18n.rb:61:in `with_user_locale'
app/controllers/application_controller.rb:420:in `set_locale'
lib/gitlab/middleware/multipart.rb:103:in `call'
lib/gitlab/request_profiler/middleware.rb:16:in `call'
lib/gitlab/middleware/go.rb:19:in `call'
lib/gitlab/etag_caching/middleware.rb:13:in `call'
lib/gitlab/middleware/correlation_id.rb:16:in `block in call'
lib/gitlab/correlation_id.rb:15:in `use_id'
lib/gitlab/middleware/correlation_id.rb:15:in `call'
lib/gitlab/middleware/read_only/controller.rb:40:in `call'
lib/gitlab/middleware/read_only.rb:18:in `call'
lib/gitlab/middleware/basic_health_check.rb:25:in `call'
lib/gitlab/request_context.rb:20:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:29:in `call'
lib/gitlab/middleware/release_env.rb:13:in `call'

gitlab-ctl尾巴

==> /var/log/gitlab/gitlab-rails/production.log <==
Started PUT "/aala/secret-project/services/mattermost/test" for XXX.XXX.XXX.XXX at 2018-12-31 14:57:24 +0500
Processing by Projects::ServicesController#test as JSON
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "service"=>{"active"=>"1", "push_events"=>"1", "push_channel"=>"project-secret-project", "issues_events"=>"1", "issue_channel"=>"project-secret-project", "confidential_issues_events"=>"1", "confidential_issue_channel"=>"project-secret-project", "merge_requests_events"=>"1", "merge_request_channel"=>"project-secret-project", "note_events"=>"1", "note_channel"=>"project-secret-project", "confidential_note_events"=>"1", "confidential_note_channel"=>"project-secret-project", "tag_push_events"=>"1", "tag_push_channel"=>"project-secret-project", "pipeline_events"=>"0", "pipeline_channel"=>"", "wiki_page_events"=>"1", "wiki_page_channel"=>"", "webhook"=>"[FILTERED]", "username"=>"GitLab", "notify_only_broken_pipelines"=>"0", "notify_only_default_branch"=>"0"}, "namespace_id"=>"aala", "project_id"=>"secret-project", "id"=>"mattermost"}

==> /var/log/gitlab/gitaly/current <==
2018-12-31_09:57:24.83334 time="2018-12-31T09:57:24Z" level=info msg="finished streaming call with code OK" correlation_id=qk5lIF8sOc5 grpc.code=OK grpc.meta.auth_version=v2 grpc.meta.client_name=gitlab-web grpc.method=FindCommits grpc.request.deadline="2018-12-31T09:57:54Z" grpc.request.fullMethod=/gitaly.CommitService/FindCommits grpc.request.glRepository=project-75 grpc.request.repoPath=aala/secret-project.git grpc.request.repoStorage=default grpc.request.topLevelGroup=aala grpc.service=gitaly.CommitService grpc.start_time="2018-12-31T09:57:24Z" grpc.time_ms=5.594 peer.address=@ span.kind=server system=grpc
2018-12-31_09:57:24.84570 time="2018-12-31T09:57:24Z" level=info msg="finished streaming call with code OK" correlation_id=qk5lIF8sOc5 grpc.code=OK grpc.meta.auth_version=v2 grpc.meta.client_name=gitlab-web grpc.method=CommitDelta grpc.request.deadline="2018-12-31T09:57:34Z" grpc.request.fullMethod=/gitaly.DiffService/CommitDelta grpc.request.glRepository=project-75 grpc.request.repoPath=aala/secret-project.git grpc.request.repoStorage=default grpc.request.topLevelGroup=aala grpc.service=gitaly.DiffService grpc.start_time="2018-12-31T09:57:24Z" grpc.time_ms=3.69 peer.address=@ span.kind=server system=grpc
2018-12-31_09:57:24.84939 time="2018-12-31T09:57:24Z" level=info msg="finished streaming call with code OK" correlation_id=qk5lIF8sOc5 grpc.code=OK grpc.meta.auth_version=v2 grpc.meta.client_name=gitlab-web grpc.method=CommitDelta grpc.request.deadline="2018-12-31T09:57:34Z" grpc.request.fullMethod=/gitaly.DiffService/CommitDelta grpc.request.glRepository=project-75 grpc.request.repoPath=aala/secret-project.git grpc.request.repoStorage=default grpc.request.topLevelGroup=aala grpc.service=gitaly.DiffService grpc.start_time="2018-12-31T09:57:24Z" grpc.time_ms=2.291 peer.address=@ span.kind=server system=grpc
2018-12-31_09:57:24.85256 time="2018-12-31T09:57:24Z" level=info msg="finished streaming call with code OK" correlation_id=qk5lIF8sOc5 grpc.code=OK grpc.meta.auth_version=v2 grpc.meta.client_name=gitlab-web grpc.method=CommitDelta grpc.request.deadline="2018-12-31T09:57:34Z" grpc.request.fullMethod=/gitaly.DiffService/CommitDelta grpc.request.glRepository=project-75 grpc.request.repoPath=aala/secret-project.git grpc.request.repoStorage=default grpc.request.topLevelGroup=aala grpc.service=gitaly.DiffService grpc.start_time="2018-12-31T09:57:24Z" grpc.time_ms=1.865 peer.address=@ span.kind=server system=grpc

==> /var/log/gitlab/gitlab-rails/production.log <==
Completed 500 Internal Server Error in 60108ms (ActiveRecord: 5.8ms)

==> /var/log/gitlab/gitlab-rails/production_json.log <==
{"method":"PUT","path":"/aala/secret-project/services/mattermost/test","format":"json","controller":"Projects::ServicesController","action":"test","status":500,"error":"Net::OpenTimeout: execution expired","duration":60109.58,"view":0.0,"db":5.78,"time":"2018-12-31T09:57:24.755Z","params":[{"key":"utf8","value":"✓"},{"key":"_method","value":"put"},{"key":"authenticity_token","value":"[FILTERED]"},{"key":"service","value":{"active":"1","push_events":"1","push_channel":"project-secret-project","issues_events":"1","issue_channel":"project-secret-project","confidential_issues_events":"1","confidential_issue_channel":"project-secret-project","merge_requests_events":"1","merge_request_channel":"project-secret-project","note_events":"1","note_channel":"project-secret-project","confidential_note_events":"1","confidential_note_channel":"project-secret-project","tag_push_events":"1","tag_push_channel":"project-secret-project","pipeline_events":"0","pipeline_channel":"","wiki_page_events":"1","wiki_page_channel":"","webhook":"[FILTERED]","username":"GitLab","notify_only_broken_pipelines":"0","notify_only_default_branch":"0"}},{"key":"namespace_id","value":"aala"},{"key":"project_id","value":"secret-project"},{"key":"id","value":"mattermost"}],"remote_ip":"XXX.XXX.XXX.XXX","user_id":2,"username":"aamirrajpoot","ua":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36","gitaly_calls":4,"correlation_id":"qk5lIF8sOc5"}

==> /var/log/gitlab/gitlab-rails/production.log <==

Net::OpenTimeout (execution expired):

app/models/project_services/chat_notification_service.rb:100:in `notify'
app/models/project_services/chat_notification_service.rb:76:in `execute'
app/models/service.rb:162:in `test'
app/controllers/projects/services_controller.rb:41:in `service_test_response'
app/controllers/projects/services_controller.rb:30:in `test'
lib/gitlab/i18n.rb:55:in `with_locale'
lib/gitlab/i18n.rb:61:in `with_user_locale'
app/controllers/application_controller.rb:420:in `set_locale'
lib/gitlab/middleware/multipart.rb:103:in `call'
lib/gitlab/request_profiler/middleware.rb:16:in `call'
lib/gitlab/middleware/go.rb:19:in `call'
lib/gitlab/etag_caching/middleware.rb:13:in `call'
lib/gitlab/middleware/correlation_id.rb:16:in `block in call'
lib/gitlab/correlation_id.rb:15:in `use_id'
lib/gitlab/middleware/correlation_id.rb:15:in `call'
lib/gitlab/middleware/read_only/controller.rb:40:in `call'
lib/gitlab/middleware/read_only.rb:18:in `call'
lib/gitlab/middleware/basic_health_check.rb:25:in `call'
lib/gitlab/request_context.rb:20:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:29:in `call'
lib/gitlab/middleware/release_env.rb:13:in `call'

==> /var/log/gitlab/gitlab-workhorse/current <==
2018-12-31_09:58:24.86838 git.domain.xyz XXX.XXX.XXX.XXX:0 - - [2018/12/31:14:58:24 +0500] "PUT /aala/secret-project/services/mattermost/test HTTP/1.1" 500 2926 "http://git.domain.xyz/aala/secret-project/services/mattermost/edit" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36" 60.173

==> /var/log/gitlab/nginx/gitlab_access.log <==
XXX.XXX.XXX.XXX - - [31/Dec/2018:14:58:24 +0500] "PUT /aala/secret-project/services/mattermost/test HTTP/1.1" 500 2926 "http://git.domain.xyz/aala/secret-project/services/mattermost/edit" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"

看起来好像超时了,但是钩子没有响应,但是我的curl命令返回了一个响应

1 个答案:

答案 0 :(得分:0)

原来是新服务器上的防火墙阻止了我的GIT服务器发出的请求。我已经在白名单中添加了GIT服务器的IP地址,并且钩子开始起作用。