Alexa custom Skills / Nabu Casa / SSLEOFError

I’m having issues with my Amazon Alexa Custom Skills failing when attempting to execute an intent script via my Nabu Casa .

I get “There was a problem with the requested skill’s response” almost constantly after not having any issues for a few years. I’ve found that sometimes rebooting or disabling/enabling remote access works, but only sometimes.

I did some digging in my AWS lambda function logs and every failure has the same error:

HTTPSConnectionPool(host='xxxxxxxxxx.ui.nabu.casa', port=443): Max retries exceeded with url: /api/alexa (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)')))

Researching that error indicates it may be a proxy error. I’m not seeing any errors in my local HA logs - makes me thing this may be an issue with the Nabu Casa cloud integration?

Does anyone have any suggestions on how to resolve this issue? I’m running the latest version of Home Assistant Operating System: Home Assistant: v2022.7.3 / Operating System: 8.2

2 Likes

I’m having the same issue, error message. Did you manage to solve it? Thanks.

Unfortunately, no - I have not found a solution to the issue but have implemented a cumbersome workaround.

It got so annoying I started creating Alexa routines for the most common items - using a template light and setting the brightness to a different % for each routine. Then I have an automation that processes the “requests”.

This isn’t ideal, but until someone can fix the SSLEOFError issue I don’t see another solution. I couldn’t handle repeating myself 10+ times and praying it would work once.

I was having the same issue and found this thread. With no solution here I hammered on it myself and couldn’t figure it out either. It seems to be some compatibility issue in the SSL validation, but I’m not sure if it’s the python library or Nabu Casa, and I can’t do anything about either.

So, I wrote a node.js alternative which, so far, seems to be working for me. It’s just the basics, and doesn’t have the debugging, etc, that the python one has. I’m posing here in case this helps somewhere else.

Steps to switch to this node.js version:

  1. Edit the Runtime settings block below the code change the Runtime to Node.js (currently, Node.js 18.x)
  2. Replace the lambda function code with the code from the gist below
  3. Rename the lambda code file extension from .py to .js (not sure if strictly necessary)
  4. Click to Deploy the lambda function
  5. Under Configuration → General Configuration, update the Timeout from 3 seconds to 10 seconds (may not be necessary for all, but for some reason some of my requests were taking 4 second and erroring. YMMV)
1 Like

Thank you for posting your solution. Changing things over to your function appears to have resolved the issue for me as well !!

I have been using the Amazon intents script as well and it stopped working and I too have this SSL error in my CloudWatch logs. Very frustrating. Although for me there is no intermittent breakthrough where it actually works; it always fails. But, I tried your node solution above and things are working again. As a python developer I’m still curious what is wrong with that code, but that’s a problem for another day :slight_smile:

Hey, I tried using your code, but I’m getting

  "errorMessage": "Cannot read properties of undefined (reading 'user')",

What could be the reason?

Hrm, somehow it’s not getting a user token. Are you doing something with long lived tokens or something?

I think I was, yes. I solved all issues now, I think the biggest was that I was using nabu casa instead of my own domain+ssl with let’s encrypt and nginx. Thanks!

Great! I use nabu casa so that part should work but anyway, glad you got it working.

I’m using nabu casa the steps in the docs didn’t work for me, using your node.js script got me a step closer, but for some reason the login fails during app linking, Alexa app thinks it’s linked but I get a notification in HA saying login failed, the token value is a 401 unauthorised error string.

Did you have to do anything special to get nabu casa working with custom intents?

Honestly, it was so long ago I don’t remember. I know it wasn’t a smooth process.

Also for what it’s worth, I already had my skill linked before I switched the skill to use my script. So it’s possible something there isn’t quite right for the setup process.

This worked for me, but as of now (Node.js 20.x) I had to rename the lambda function file to index.js and remove the word lambda_ so it just says: exports.handler = …