Received cloud request for App <xxx> that does not exist

Started receiving these warnings after disabling and re-enabling Hubitat's Amazon Echo Skill app and the Alexa Hubitat skill:

I've read through all of the dozen or so other threads that discussed this problem and understand that the Amazon cloud is trying and failing to reconnect to the Hubitat Amazon Echo Skill app using an app index value that is obsolete and has been superseded by a new index value generated during the reinstallation of the app.

So, based on this specific recommendation and sequence of steps from @thebearmay I then

  1. Deleted the Alexa Hubitat skill
  2. Deleted the Hubitat Amazon Echo Skill app
  3. Reinstalled the Amazon Echo Skill app and set all the device exports
  4. Re-enabled the Hubitat skill

All during the reinstallation process I was watching the Hubitat log for clues about if/when these warning were emitted; it turns out that all these warnings are emitted after the authorization step proper, with the "Hubitat has been successfully linked" message, but during the subsequent "Alexa is looking for devices to connect" phase.

(At the beginning of this phase, before it starts "looking for devices", the skill itself displays all the devices in my system that have already been enabled in the Amazon Echo Skill app as enabled in the skill itself - with a checkmark - but apparently offering to edit this list.)

As the "Received cloud request..." warnings pile up in the Hubitat log during the skill's device discovery process, I see that the warnings refer to the app index # that was used by the Amazon Echo Skill app the last time it was installed. Not only that... some of these warnings also use an app index # that was from even earlier installations (as included in the log screenshot above - see the reference to App 34 between App 522 warnings ) .

This implies to me that there is some caching of the app index value - in AWS? in the Hub? in the Hubitat cloud? - that is persisting when it should not be. (I am assuming that the Alexa mobile app itself would never see these Hubitat app indices.)

It is unfortunate that there doesn't appear to be a bullet-proof way to eliminate this phenomenon, since the steps recommended so far aren't consistently effective. Any new suggestions?

Looks to me like you have an external app (to the hub) still trying to query the hub. If, as you say, 522 is the former app number of the Echo Skill you need to look for something that can utilize Alexa to manipulate devices, i.e. HA, ST, etc. So maybe start with your Alexa instance and determine what 3rd party apps you have integrated there.

Is a little strange though as Alexa should have recognized that its interface to the hub had changed and invalidated the devices from its end. Given that thought, if you de-authorize all devices in your Echo Skill App, and then remove them from Alexa (shouldn't be there at that point), do the queries stop?

First thing I would try is go to the Alexa mobile app, disable the Hubitat skill in there.

All the warnings should then stop.

Re-enable the Hubitat skill and it should have you log in etc... It will reconnect to the already installed app on the Hub, so it should pick up the correct app ID this time.

Yes, that was Step 1 above, and no warnings were emitted after the skill was disabled.

That was Step 3+4, which then triggered the slow of warnings. I infer that the Alexa Hubitat skill does indeed pick up the correct app at the updated app index after re-enabling, because all my devices work. But that doesn't prevent the warnings about Amazon's cloud still trying to reach the Amazon Echo Skill app using an obsolete app index.

The details in the warning messages are interesting, because they reference specific devices. I should note that the screenshot above was not the complete list of warnings - there was one for EVERY device exposed to Alexa by the Amazon Echo Skill app. So the newly-enabled Hubitat skill running in the AWS cloud still appears to have some persistent state referencing those device numbers - or could it be the previous (supposedly disabled) instance of the skill is not fully shut down and, running alongside the new enabled instance, is still trying to "phone home" through the Hubitat cloud?

No other 3rd party app skills are enabled - definitely none that would know about these devices. (For instance, there was a time that I had Alexa's Smartthings skill enabled to talk to my Samsung TV, but that is long gone, and it certainly was never connected to any of the Zwave and Zigbee devices that are managed by Hubitat.)

The devices exposed to Alexa by the Amazon Echo Skill app appear to be very "sticky" - they will still show up in the Alexa app's list of devices as "available" and as being managed via Hubitat even after the Hubitat skill has been disabled - though manipulating these zombie devices in the Alexa app inevitably leads to a timeout or another error that the device is inaccessible.

I don't know that these inaccessible zombies will ever die off on their own, but they can be manually removed 1 by 1 with several clicks each :roll_eyes: in the Alexa app UI. For my dozens of devices I haven't taken on that onerous manual task but I would bet that this will flush any residual device state from the Amazon cloud. ( I know that device state is not retained by the Alexa mobile app because uninstalling the the mobile app and re-installing it did not have any effect on the zombie devices.)

So do you still have zombie devices in Alexa left over from when you disabled and reconfigured the skill, or did it just latch on the existing devices?

Any old disconnected devices still sitting in Alexa might be trying to sync up using the previous app ID on Hubitat, causing the errors.

All my existing devices were to be re-connected into the Alexa skill after it was disabled and re-enabled again, so there were no previously Alexa-connected orphans managed by Hubitat that weren't intended to be connected to Alexa again. (Sorry, the terminology here gets a bit fraught.) Maybe I will try Steps 1 and 2 above and at Step 3 I will reinstall the Amazon Echo Skill app with no devices selected for export and see if, at Step 4, all those non-exported devices have "gone zombie" and generate a warning complaining that they're not reaching the old app.

Another thing you could try it to leave the Hubitat app deleted, and then enable the Alexa skill. I think when you enable the skill if the app is not already in Hubitat it will get added and then give you a list of devices to pick from. Also I think you have to share at least one device in order for the skill to link up and get enabled.

Oh that's an interesting twist - that enabling the Hubitat skill would cause the app to be installed on the hub! Might try that. At the moment the warnings are pretty much muted, just one device is complaining at irregular intervals every few hours.

For future, in general, I would not recommend deleting the app on the Hubitat side unless you have no other options left to fix something. Not sure why you deleted it in the first place exactly, may not have been needed. Usually if you just disable the skill and re-enable it things will work themselves out.

I would avoid deleting it anymore for the time being while trying to get this fixed, it is not likely to do any good. It seems like something on the Amazon/Hubitat cloud side that is not syncing up correctly with the new app ID for some reason.

I had done some random debugging on the problem without clear results and decided to try the "clean slate" approach of uninstalling and reinstalling everything recommended here by @thebearmay.