Dear community members,
I want to understand about the Gerrit webhooks plugin [1].
I want to achieve a Jenkins job to run on a patchset-created or a ref-updated event on a particular set of repos.
I have installed the plugin and configured it on my dev instance. As described in the plugin documentation, I have added the following in the gerrit.config
[plugin "webhooks"]
connectionTimeout = 3000
socketTimeout = 2500
maxTries = 10
retryInterval = 2000
threadPoolSize = 3
And in one of my parent repository, I have created a file webhooks.config in refs/meta/config branch with the below content:
[remote "jenkins"]
url = http://<user>:<token>@<JENKINS_URL>/job/webhooks-trial/build?token=webhook
event = patchset-created
event = ref-updated
maxTries = 3
sslVerify = false
I see that my Jenkins job is not triggered on the events.
Here is what I see in the error_log:
[2022-12-14 13:16:22,570] [webhooks-1] DEBUG com.googlesource.gerrit.plugins.webhooks.PostTask : Retrying Processing event: ref-updated for project: PlaygroundAccessControl for remote: http://<user>:<token>@<JENKINS_URL>/job/webhooks-trial/build?token=webhook in 2000ms. Reason: <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 403 No valid crumb was included in the request</title>
</head>
<body><h2>HTTP ERROR 403 No valid crumb was included in the request</h2>
<table>
<tr><th>URI:</th><td>/job/SCM/job/webhooks-trial/build</td></tr>
<tr><th>STATUS:</th><td>403</td></tr>
<tr><th>MESSAGE:</th><td>No valid crumb was included in the request</td></tr>
<tr><th>SERVLET:</th><td>Stapler</td></tr>
</table>
<hr><a href="
http://eclipse.org/jetty">Powered by Jetty:// 9.4.30.v20200611</a><hr/>
</body>
</html>
[CONTEXT PLUGIN="gerrit" PLUGIN="webhooks" SUBMISSION_ID="373876-1671003980481-cf3f4897" ]
from the error it looks like it is not using the user name and token provided in the URL. But I do not see a config value to set a user name/token for triggering the remote URL.
Please guide me on how to get it working.