Webhooks showing error 404, Build trigger in Jenkins not working when Jenkins is closed

4.6k Views Asked by At

am new to Jenkins and is searching for one answer. Iam trying to configure Jenkins with Gitlab and is facing issues when I add Webhooks or Jenkins CI Integration in Gitlab. Gitlab is not able to connect to Jenkins. Also when I close Jenkins, the build is not running at the scheduled intervals by build trigger.

I tried adding the Jenkins CI Url and secret token obtained from Jenkins, but when I test the hook, it shows this error 404

Any help is appreciated.

2

There are 2 best solutions below

0
On

I don't see this option Also on Jenkins project configuration on Build Triggers/Build when a change is pushed to GitLab. by pressing the advanced button you will find Secret Token Generate a token and insert it on the GitLab Webhook settings.

That should work for you

0
On

First of all have a look o Jenkins logs in order to check if it receives the Hook. You should see something like this

INFO: WebHook called with url: /ci/project/content-fetch

In case you are accessing your Jenkins/Git with HTTP, add your webhook as provided by Jenkins on project settings

http://domain/ci/project/<project-name>

and uncheck

Enable SSL verification

In case you have HTTPS Use your Jenkins project URL but this time add https instead of http``

https://domain/ci/project/<project-name>

And check

Enable SSL verification

Also on Jenkins project configuration on Build Triggers/Build when a change is pushed to GitLab. by pressing the advanced button you will find Secret Token Generate a token and insert it on the GitLab Webhook settings.

That should work for you.