# Missing "topic" web hook events in cloud hosted instance

**URL:** https://meta.discourse.org/t/missing-topic-web-hook-events-in-cloud-hosted-instance/115483
**Category:** Bug
**Created:** [April 19, 2019, 4:28pm UTC](https://meta.discourse.org/t/missing-topic-web-hook-events-in-cloud-hosted-instance/115483 "2019-04-19T16:28:48Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![jviotti](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jviotti/32/138866_2.png) [@jviotti](https://meta.discourse.org/u/jviotti)
#### Post date: [April 19, 2019, 4:28pm UTC](https://meta.discourse.org/t/missing-topic-web-hook-events-in-cloud-hosted-instance/115483/1 "2019-04-19T16:28:48Z")

</div>

Hey there, we at [Balena](https://balena.io) have hosted instance at [https://forums.balena.io](https://forums.balena.io). While working on a custom integration, I’ve seen that Discourse may sometimes not emit certain web hooks.

We are listening to `post_event` and `topic_event` events, and from what I can see, I’ve only seen this issue on topic events.

If I go to the web hooks dashboard, I may see that some events failed with an status code 0, but its not clear what the error was:

 ![50](https://global.discourse-cdn.com/meta/original/3X/e/5/e5c85a11c0c81fedeedbdfcce932c1e5663d389f.png)

I was able to reproduce the 0 status codes by making my web server time out the HTTP request, but in other cases I would see status 0 right away after doing an action in Discourse, without waiting for a timeout.

Redelivering the web hook events tends to work, even though I sometimes get a mysterious 500 error without any explanations, and re-delivering is not possible.

The most worrying bit is that I’ve seen some events not getting delivered, and not even appearing on Discourse’s web hooks dashboard at all.

Is this a known issue? Would there be any reason for this to only happen on topic events?

We have a server receiving web hook events from other services as well, such as GitHub, and we never experienced anything similar, so its unlikely that our server is failing to serve the HTTP request.

---

<div class="post-metadata">

### Author: ![jviotti](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jviotti/32/138866_2.png) [@jviotti](https://meta.discourse.org/u/jviotti)
#### Post date: [April 19, 2019, 10:25pm UTC](https://meta.discourse.org/t/missing-topic-web-hook-events-in-cloud-hosted-instance/115483/2 "2019-04-19T22:25:21Z")

</div>

This is the 500 error messages without any further explanation that I get when re-trying some of the status code 0 events:

 ![58](https://global.discourse-cdn.com/meta/original/3X/8/2/8275d6c6941716afb98949b4fc962ed9a8d778dc.png)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [April 19, 2019, 11:12pm UTC](https://meta.discourse.org/t/missing-topic-web-hook-events-in-cloud-hosted-instance/115483/3 "2019-04-19T23:12:26Z")

</div>

Hmm any ideas on this @vinothkannans?

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [April 21, 2019, 6:34pm UTC](https://meta.discourse.org/t/missing-topic-web-hook-events-in-cloud-hosted-instance/115483/4 "2019-04-21T18:34:48Z")

</div>

Recently @Tarek_Khalil did some improvements in web hook emitter job. I will recommend you to upgrade and test with the latest version of Discourse.

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [April 21, 2019, 6:50pm UTC](https://meta.discourse.org/t/missing-topic-web-hook-events-in-cloud-hosted-instance/115483/6 "2019-04-21T18:50:37Z")

</div>

Since you’re hosted with us I will deploy your instance to the latest version and I will test the issue sooner.

---

<div class="post-metadata">

### Author: ![jviotti](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jviotti/32/138866_2.png) [@jviotti](https://meta.discourse.org/u/jviotti)
#### Post date: [April 22, 2019, 8:55am UTC](https://meta.discourse.org/t/missing-topic-web-hook-events-in-cloud-hosted-instance/115483/7 "2019-04-22T08:55:20Z")

</div>

Thanks @vinothkannans!

I’ll run some tests in the next couple of days and will let you know if I see any difference!

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [April 22, 2019, 7:27pm UTC](https://meta.discourse.org/t/missing-topic-web-hook-events-in-cloud-hosted-instance/115483/8 "2019-04-22T19:27:06Z")

</div>

> [@jviotti](#):
>
> I may see that some events failed with an status code 0, but its not clear what the error was:

Now you can view the error detail at `Response` field.

> [@jviotti](#):
>
> I sometimes get a mysterious 500 error without any explanations, and re-delivering is not possible.

I’m able to reproduce it. I will fix the issue in Discourse core.

> [@jviotti](#):
>
> I’ve seen some events not getting delivered

I hope it’s not a case anymore with all new improvements. Anyway may I know which events they are? (like `topic_destroyed` or `topic_closed`?).

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [April 23, 2019, 4:56am UTC](https://meta.discourse.org/t/missing-topic-web-hook-events-in-cloud-hosted-instance/115483/9 "2019-04-23T04:56:48Z")

</div>

> [@jviotti](#):
>
> I may see that some events failed with an status code 0, but its not clear what the error was

Note that this was happening when the webhook was unable to reach the endpoint and was being rescued. We have now [changed](https://github.com/discourse/discourse/commit/594674703c20c1ef7380af3c2a3aad18f3570667) the connection failed error code to `-1` so as to clearly indicate that the webhook event failed, and added the rescue error details in response body.

---

<div class="post-metadata">

### Author: ![jviotti](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jviotti/32/138866_2.png) [@jviotti](https://meta.discourse.org/u/jviotti)
#### Post date: [April 24, 2019, 9:25am UTC](https://meta.discourse.org/t/missing-topic-web-hook-events-in-cloud-hosted-instance/115483/11 "2019-04-24T09:25:29Z")

</div>

@vinothkannans

> I hope it’s not a case anymore with all new improvements. Anyway may I know which events they are? (like `topic_destroyed` or `topic_closed` ?).

From what I can remember, all the cases happened with `topic_opened`.
