JIRA webhook to azure runbook > re-encoding causes 404 error - How to prevent re-encoding?

Mickaël Orsolino November 14, 2019

Hi,

 

We have the following webhook url :

https://**************/webhooks?token=TiIn7hMNmwma/9Fg3EW1akZQ+0Eeu9OBhZ4+/FVFEvQ%9d

 

When we perform the webhook, we get a 404 error (Client error - 404 when posting to web hook).

In the log we see this:

2019-11-14 18:09:17,181 httpclient-callbacks:thread-111 WARN anonymous [c.a.webhooks.plugin.PublishTaskFactoryImpl$PublishTaskImpl] Client error - 404 when posting to web hook at 'https://**************/webhooks?token=TiIn7hMNmwma/9Fg3EW1akZQ+0Eeu9OBhZ4+/FVFEvQ%9d'
2019-11-14 18:09:17,150 Web-Hook-Publisher-1 DEBUG anonymous Finance mail handler [c.a.webhooks.plugin.PublishTaskFactoryImpl$PublishTaskImpl] Posting to web hook at 'https://**************/webhooks?token=TiIn7hMNmwma%2F9Fg3EW1akZQ%2B0Eeu9OBhZ4%2B%2FVWFEvQ%259d&user_id=abc%40abc.com&user_key=abc%40abc.com', body is:

 

We try to call both url via postman, we get this:

- https://**************/webhooks?token=TiIn7hMNmwma/9Fg3EW1akZQ+0Eeu9OBhZ4+/FVFEvQ%9d - response is 202 accepted

- https://**************/webhooks?token=TiIn7hMNmwma%2F9Fg3EW1akZQ%2B0Eeu9OBhZ4%2B%2FVWFEvQ%259d&user_id=abc%40abc.com&user_key=abc%40abc.com - response is 404 with this one.

 

It's look like JIRA re-encode the URL when we try to do the post function. Can you please confirm it?

 

How do we can prevent the re-encoding in order to call the right webhook?

 

Thanks in advance for your help.

Regards,

Mickael

 

2 answers

1 accepted

0 votes
Answer accepted
Mickaël Orsolino December 12, 2019

I find a solution. We used Azure functions proxy.

We are able to generate an proxy url with the webhook as endpoint.

You have just to configure the proxy url in JIRA instaid to the Azure webhook.

It works now.

Regards,

Mickael Orsolino

0 votes
Mickaël Orsolino November 20, 2019

Nobody get this kind of problem?

 

Regards,

Mickael

Kai Barrett December 10, 2019

I've got the same issue, 

 

I found one suggestion on the URL encoding https://community.atlassian.com/t5/Jira-Software-questions/Why-do-I-get-401-Client-Error-when-using-a-webhook-to-post-to/qaq-p/660459 but it's not resolved my issue.

 

I've got a webhook firing on a state transition to hit an azure automation runbook:

initially i had: httpclient-callbacks:thread-1 WARN anonymous [c.a.webhooks.plugin.PublishTaskFactoryImpl$PublishTaskImpl] Client error - 404 when posting to web hook at 'https://s2events.azure-automation.net/webhooks?token=ZHzEEO%2brv07TdPbZJfS%2fLJakVpnXlwovtCEBcdqGq74%3d'

 

modified to:

httpclient-callbacks:thread-4 WARN anonymous [c.a.webhooks.plugin.PublishTaskFactoryImpl$PublishTaskImpl] Client error - 404 when posting to web hook at 'https://s2events.azure-automation.net/webhooks?token=ZHzEEO+rv07TdPbZJfS/LJakVpnXlwovtCEBcdqGq74='

 

But still no luck. From the server wget get from the server returns a 405 as expected

 

Webhook has been regenerated a few times since :)

Mickaël Orsolino December 12, 2019

I find a solution. We used Azure functions proxy.

We are able to generate an proxy url with the webhook as endpoint.

It works now.

 

Regards,

Mickael Orsolino

Suggest an answer

Log in or Sign up to answer