Jenkins Github integration with SMEE client: Jenkins doesn't like Webhook Override Hook URL

343 Views Asked by At

We're running Jenkins behind a firewall to public github.com using a SMEE client to provide the necessary proxy. However in our Jenkins [version 2.361.4-jdk11] configuration page, the Github plugin flatly refuses to save the Override Webhook URL https://smee.io/blah (where blah is our SMEE channel), instead, when Apply is pressed, it says (in orange):

"It doesn't look like https://smee.io/blah is talking to Jenkins. Are you running your own app?"

We can see that, the moment Apply is pressed on the Jenkins configuration page, the SMEE server receives an event, with payload of the form:

"1668551517454":{
}

...and, at the same time, the journald log output from the SMEE client (which is running on the same machine as Jenkins, each in their own Docker containers) shows that it has successfully posted back to the correct [the default] port:

POST http://10.10.1.29:8080/github-webhook/ - 200

...10.10.1.29 being the address of the machine where the SMEE client and Jenkins are running. So connectivity from Jenkins to SMEE server, SMEE server to SMEE client and SMEE client to Jenkins all seem to be working.

What can be upsetting the Github plugin and/or Jenkins? Is there some more detailed logging we can get from Jenkins, or the plugin, to determine what is upsetting it (the Jenkins journald log output says nothing more interesting than INFO h.p.b.g. GlobalTimeOutConfiguration#configure: global timeout has been cleared at about this time)?

In case it matters the SMEE client was run with:

docker run --name smee-client --restart=on-failure --detach --log-driver=journald deltaprojects/smee-client -u https://smee.io/blah -t http://10.10.1.29:8080/github-webhook/

...and the Jenkins Docker installation was built/run according to the Jenkins instructions.

2

There are 2 best solutions below

0
Rob On

And the answer is... the GUI of the Jenkins Github plugin is broken, it never saves what you type into the Override Hook URL box. It has been broken since September 2020. If you have a Jenkins Jira account you can see the pain.

The workaround is to manually edit the Jenkins github-plugin-configuration.xml configuration file to add a field of this form:

<hookUrl>https://smee.io/thestringfromsmee</hookUrl> 

...[this example for my case, using SMEE] inside <github-plugin-configuration>, at the same level as <configs> and <hookSecretConfigs>, then restart Jenkins.

Ho hum.

0
Madghostek On

The Override Webhook URL option is broken (as explained by the other answer), but this is not what the option is supposed to do, it changes Jenkins listening path, by default it is localhost:8080/github-webhook/ and there is no need to change it. The smee.io/blah goes into GitHub webhook configuration. This is how it works:

Github->smee.io/blah->smee.io server->smee.io client on your machine->localhost:8080/github-webhook/

By the way, the smee.io project is discontinued and has issues (for me it straight up doesnt work and throws an error for any message it receives), alternatives should be used, for example gosmee