jenkinsci / gitlab-plugin

A Jenkins plugin for interfacing with GitLab
https://plugins.jenkins.io/gitlab-plugin/
GNU General Public License v2.0
1.43k stars 613 forks source link

Gitlab Webhook 404's #1086

Open Aarex1 opened 3 years ago

Aarex1 commented 3 years ago

Issue

gitlab webhook 404's when called from gitlab or if you test the URL directly off of the jenkins server.

Context

Gitlab plugin version: 1.5.13 Gitlab version: 13.4.3 Jenkins version: 2.249.3 Job Type: Pipeline

Logs & Traces

Jenkins logs do not provide much information

Nov 19, 2020 9:32:51 AM INFO com.dabsquared.gitlabjenkins.webhook.GitLabWebHook getDynamic WebHook called with url: /jenkins/project/(removed)

Problem description

If I try to look at the generated webhook right on the jenkins url, it 404's

URI: /jenkins/project/(REMOVED)

404 Not Found Stapler

If I test a push event webhook from a gitlab project, I receive a message saying webhook executed successfully but returned 404

These are webhooks and gitlab projects that have previously worked and recently started to fail. I am not entirely sure when they started to fail.

Our Jenkins implementation is behind a F5 load balancer, I tested by bypassing the load balancer and the issue still persisted.

CammoKing commented 3 years ago

@Aarex1 and others that may be experiencing this problem:

I had run into this exact issue and was having troubles diagnosing, if you enable a log recorder in Jenkins following the instructions in the readme, I.E:

To enable debug logging in the plugin: Go to Jenkins -> Manage Jenkins -> System Log Add new log recorder Enter 'Gitlab plugin' or whatever you want for the name On the next page, enter 'com.dabsquared.gitlabjenkins' for Logger, set log level to FINEST, and save Then click on your Gitlab plugin log, click 'Clear this log' if necessary, and then use GitLab to trigger some actions Refresh the log page and you should see output

You will probably find some additional debug information in the logger and in my case it turns out I hadn't properly sent ALL the headers to the Jenkins project endpoint as I was forwarding the Gitlab request through a proxy of sorts. My implementation may be different than yours but you may find some additional details and info that will point you in the right direction.

erlangparasu commented 1 year ago

i got this error too