Webhooks returning 404s (after upgrade)

Hi

I recently had to restore my Home Assistant setup from version “very old” (0.8-something?) to the newest version since I had forgotten to back up my config and the SD card died… After the restore it seems like everything is working again. Except from my automation webhooks. No matter what I do, I seem to only be getting 404s when trying to hit them. And yes, I do HTTP POSTs :slight_smile:

To debug, I removed everything from my automations.yaml file, and created a simple test one:

- id: '1598992586389'
  alias: Test
  description: ''
  trigger:
  - platform: webhook
    webhook_id: test
  condition: []
  action:
  - data:
      message: test message
      title: test subject
    service: persistent_notification.create
  mode: single

But

curl -d "" http://homeassistant.local:8123/api/webhook/test

Just returns

404: Not Found

There are no suspicious errors in the log file… Well, I’m getting some complaints about Unable to create UPnP/IGD, aborting, but I’m assuming that is unrelated.

The API in general is alive. If I hit http://homeassistant.local:8123/api/ (with a token) I get:

{'message': 'API running.'}

Allan

I wasn’t trying to fix this, but enabling two things yesterday did fix it somehow. I enabled the DuckDNS and Lets Encrypt Add On and added the mobile_app integration to my configuration.yaml. One of those suddenly made my web hooks work again. I suspect it was the mobile_app as that depends on web hooks? So maybe for some reason web hooks wasn’t turned on for my install?

@beaufour

I just ran into this problem too. I added mobile_app: and it started working as you said.

This didn’t seem right to me so did a rest command to get the config info and in the components array I saw “webhook”. I removed mobile_app: and put webhook: in my configuration.yaml and it work!

I dont see webhook in the integrations page nor in the webhook automation section. Might have to try to edit it.

2 Likes

It is still the case! I’m on the most recent 2021.4.6 and I was struggling for few hours to make webhooks working untill I’ve found this thread.

I have added webhooks: to my configuration.yaml and it worked!

1 Like