home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
74.13k stars 31.11k forks source link

Intent Scripts not firing after updating to 2021.5 / 2021.5.x #50278

Closed garyt72 closed 3 years ago

garyt72 commented 3 years ago

The problem

Intent scripts are no longer responding to Amazon Alexa apps after updating to 2021.5.0 or 2021.5.1. Functionality returns to normal after downgrading to 2021.4.6.

What is version of Home Assistant Core has the issue?

core-2021.5.0 / core-2021.5.1

What was the last working version of Home Assistant Core?

core-2021.4.6

What type of installation are you running?

Home Assistant Core

Integration causing the issue

cloud / alexa

Link to integration documentation on our website

https://www.home-assistant.io/integrations/alexa/

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No log entries even after changing log level to debug for 'homeassistant.components.intent_script'

Additional information

I'm using custom alexa applications with Home Assistant cloud instance URL (https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.ui.nabu.casa) as the endpoint. Downgrading to 2021.4.6 resolves the issue with no other changes to Alexa application or intent_script configuration.

edit: the Alexa integration for Home Assistant cloud is unaffected and works as expected in 2021.5

It seems as though the intent script calls are being ignored/blocked or the intent script component is not responding.

garyt72 commented 3 years ago

After further troubleshooting, this appears to possibly be an issue with Home Assistant Cloud. I've added debugging output to the Lambda function my Alexa apps use, and after updating to 2021.5 thru 2021.5.3 there is no response back from the web service to the Cloud remote connection instance URL. If I downgrade back to 2021.4.6 things start responding again.

garyt72 commented 3 years ago

After visiting #cloud channel on Discord, attaching debug output from both 2021.4.6 and 2021.5.3.

Logs contain output for:

service: logger.set_level
data:
  hass_nabucasa: debug
  snitun: debug
  homeassistant.components.cloud: debug
  homeassistant.components.cloud.iot: debug

2021.4.6.log 2021.5.3.log

gadgetchnnel commented 3 years ago

There's another issue regarding this https://github.com/home-assistant/core/issues/50569#issuecomment-845987026

I posted there that it appears to be a result of PR https://github.com/home-assistant/core/pull/49136

This changed the Cloud integration so, instead of having the Alexa integration as a dependency, it sets it up if needed but does this with an empty config meaning that, if Cloud is setup before Alexa any YAML-based Alexa components (including Intent Scripts) don't get setup.

garyt72 commented 3 years ago

Thanks @gadgetchnnel.

I did some additional testing this morning and can confirm that after updating to 2021.5.5 then manually editing the three files listed below to remove the code from #49136 that the Alexa component is responding correctly to the Lamda function and the intent scripts are being executed as expected.

garyt72 commented 3 years ago

This appears to have been resolved by #51313