Switches occasionally do not react / are not updated

I am running 2.5.0 together with a custom myopenHAB cloud.
Switches occasionally do not react in the alexa skill on my android phone. Alexa via voice command also sometimes tells me that it looks like there would be a problem with my network.
So far I did not find the root cause. I think the network cannot be the problem.
The problem only occurs using the skill ( voice and panel with switches in the skill ). Using paper UI is ok.
What I observed by logging the connections on the smartphone is that the skill tries to connect to us-east1, us-west2 hosts in the amazon cloud in case of problems while the skill is hosted in eu-west1.
The configured language is german and distribution region is germany.

Is there any other location that needs to be configured to use the correct lambda server endpoints ?

You deployed your Lambda function in the correct region. Have you checked your Lambda function logs for errors? Also, add the environmental variable LOG_LEVEL=info to that function to get additional log information.

Lambda function is deployed to eu-west-1. The ARN on the lambda function page in the console also contains eu-west-1. The same ARN that is shown on the lambda function page is used as default endpoint as well as endpoint for europe.

I set environment varialbe LOG_LEVEL to info.
Extract from the log:

10:52:05 REPORT RequestId: b4ed0ceb-87ba-4c89-9890-dac1dc3cb1b5 Duration: 468.89 ms Billed Duration: 500 ms Memory Size: 128 MB Max Memory Used: 103 MB
10:52:15 START RequestId: 7c7ddaa9-58cf-4a1d-8a67-6a331235d482 Version: $LATEST
10:52:15 2020-01-11T10:52:15.619Z 7c7ddaa9-58cf-4a1d-8a67-6a331235d482 INFO INFO: Input: {"directive":{"header":{"namespace":"Alexa","name":"ReportState","payloadVersion":"3","messageId":"82d4c763-139a-4e74-ac00-dd0f60c401dd","correlationToken":"AAAAAAAAAQCr+evDB0I23OvBeG4UqOxKDAIAAAAAAACvMqeg3Q2llGl8StoSpTWSv3zgz7B1IMGiKYC2UAt54+8L6T3aXHFyd8x5AlvYeULZGbLPtOWN8aVJoflSfRbblQAcfutK7TklcZnyASEzJ1W3YwxQwP/OxAx
10:52:15 2020-01-11T10:52:15.621Z 7c7ddaa9-58cf-4a1d-8a67-6a331235d482 INFO WARN: RequestError: socket hang up {"directive":{"namespace":"Alexa","name":"ReportState","endpointId":"Rule_TV_einschalten","payload":{},"propertyMap":{"PowerController":{"powerState":{"parameters":{"category":"SWITCH"},"item":{"name":"Rule_TV_einschalten","type":"Switch"},"schema":{"name":"powerState"}}}},"token":"vFG2qrz2dkJYLm0
10:52:15 2020-01-11T10:52:15.621Z 7c7ddaa9-58cf-4a1d-8a67-6a331235d482 INFO INFO: Response: {"event":{"header":{"namespace":"Alexa","name":"ErrorResponse","payloadVersion":"3","messageId":"9da96676-edec-4bdc-80de-492d908491f4","correlationToken":"AAAAAAAAAQCr+evDB0I23OvBeG4UqOxKDAIAAAAAAACvMqeg3Q2llGl8StoSpTWSv3zgz7B1IMGiKYC2UAt54+8L6T3aXHFyd8x5AlvYeULZGbLPtOWN8aVJoflSfRbblQAcfutK7TklcZnyASEzJ1W3YwxQwP/OxA
10:52:15 END RequestId: 7c7ddaa9-58cf-4a1d-8a67-6a331235d482

It says: WARN: RequestError: socket hang up

Do you have any advice what I need to check next ?

A socket hang up could be a configuration issue with your reverse proxy server where idle sockets aren’t staying up long enough. The skill requires a minimum of 45 seconds idling between two requests before it should timed out.

Also, make sure to use the latest skill version available on the master branch repository. We made some changes back in September related to idle socket handling.

Perfect. Thank you.

On Dec 16th I updated to latest version of the skill. Since that time I had the problem.
Changing the keepalive_timeout configuration parameter of the nginx server solved the problem.

1 Like

I think i have a simulair problem, first i tought it was my connection to the custom openhab cloud from my local instance, buth now i have that resolved…

I can succesfully control my items in alexa, buth the state is not staying and sometimes i get the notice device unreachable. Can’t seem to figure out what i did wrong…

I have the latest version and my reverse proxy is configured right…

How many items do you have setup on your server? You could be hitting the other outstanding issue potentially related to the reverse proxy cache buffering. Maybe you could disable that functionality based on my comment listed in the issue below.

Got it almost right the largest server has 140 items, buth they al do the same.
Now it is always working this on both the EU lambda server and the US one.

Buth still it forgets it status so you see light is on buth it dissapears after 5-10seconds…

EDIT: Also sometimes i get device not reachable: and this error in acceslog - - [19/Jan/2020:17:12:08 +0100] “POST /rest/items/Relay_03_04 HTTP/1.1” 499 0 “-” “-”

I too have this issue, running the latest skill. Mind you, it was happening randomly on a very old skill too. It comes and goes but is around more often than not.

I had alexa working with private openhab for over 1 year without issues and recently its started to break.

My openhab cloud is definitely not disconnecting, so this is some kind of alexa related issue.

I use nginx, but again, nothing changed there so I cant see why this would be an issue

I have 65 items, not a huge amount

Any suggestions? Cloudwatch doesnt show the error in much detail. I’ve turned off proxy_buffering in nginx so ill see how that goes.