I had issues with my Free connection today.
Gladys is accessible locally so no problem, however each time I tried to reconnect with Gladys Plus (on my phone or PC) I had this message:
It may have nothing to do with it, but when I encountered a similar problem, it was because I had left (by mistake) a Gladys test image running on my NAS.
So I had 2 instances of Gladys trying to connect at the same time.
I did indeed make changes related to Gladys Plus in 4.56, so it’s possible there’s an issue.
I’m investigating!
On the server side, I notice that some clients reconnect to Gladys a lot and that creates server load problems, so there seems to be a real issue (or someone is DoS-ing the server, but I doubt it — it coincides with the release of 4.56)
Ok there’s a real problem with reconnection, I restarted the Gladys Plus architecture, and it disconnected my personal instance which can no longer reconnect! I think I’ll just roll back the Gladys Plus changes I had made while I try to find the source of the bug!
In Gladys Assistant 4.56, I introduced a new authentication logic on the WebSockets, allowing a faster connection: ideal for instant access to the dashboard on mobile.
The problem? If the instance loses the connection, it tries to reconnect with the same access_token used during the first connection. Except that this access_token has expired in the meantime and is not renewed. I’m using a new logic present in the socket.io library and I didn’t understand its behavior on disconnection.
Result: the Gladys Plus backend rejects the connection (expired JWT), and the instance enters an infinite reconnection loop.
It’s a good lesson, and a few avenues for improvement:
Renew the access_token in case of connection loss to resume with a valid token.
Add a delay before reconnecting, to avoid overloading the server in case of an infinite loop.
Strengthen unit tests to better cover connection loss scenarios and prevent this bug from recurring.
Sorry for the inconvenience!
I’ll keep you informed as soon as version 4.56.1 is available
I was away from home and had the same issue on my end… I thought my home automation server with Gladys had crashed. And I just got back and found that everything was working fine locally.
I already have quite a bit of monitoring, that’s what tipped me off that there was a widespread issue
Gradually, the more instances were upgraded to Gladys Assistant 4.56, the more often an instance would temporarily lose its connection, and those instances would enter an aggressive infinite reconnection loop.
I was receiving more and more emails, and I realized there was a problem!
Hello @pierre-gilles,
Sorry for not replying but I wasn’t available this weekend. I got disconnected several times this weekend from Gladys Plus.
I just updated to 4.56.1 and the reconnection to Gladys Plus happened automatically.
Thanks a lot for the update
Hello,
I also had two instances of Gladys Plus not reconnecting. On Saturday, following an update to my router, and on Sunday for no apparent reason.
Thanks @pierre-gilles for addressing it quickly and over a weekend. At this time the current version is still 4.56.0.
For reasons other than the resolved issue, what are the options to access Gladys Plus again when you’re not on site to restart the mini PC?