dubocr / homebridge-tahoma

Homebridge plugin for TaHoma, Connexoon, Cozytouch, Energeasy Connect.
Apache License 2.0
137 stars 42 forks source link

[Event Listener] Error 400 - No Registered Event Listener after session timeout #334

Closed thehilsnz closed 2 years ago

thehilsnz commented 3 years ago

Hi,

The plug-in was working fine, but now it's throwing a "Error 400 - No registered event listener [UNSPECIFIED ERROR]".

You can see from the screenshot that it worked fine one minute, then failed the next. It seems to work the first time after a restart, then fails. I tried to follow along with the an earlier issue but as most of it was in French it was a little tricky - I got the impression this would be solved in an upcoming release, but I'm not sure if that is that case, or that release is still pending. I initially had a polling period of 600, then I tried 300 as per the other thread, but have now reverted to 30, and the issue arises across all of them.

I've also pasted my (redacted) config in case that helps.

    {
        "name": "Connexoon",
        "service": "connexoon_rts",
        "user": "[redacted]",
        "password": "[redacted]",
        "pollingPeriod": 30,
        "_bridge": {
            "username": "[redacted]",
            "port": [redacted]
        },
        "platform": "Tahoma"
    },

Thanks in advance for your help. Hilary

image
github-actions[bot] commented 3 years ago

Thank you for using Homebridge TaHoma plugin.

Please follow these step to obtain better support :

  1. Execute available commands (on,off,T°,mode,etc...) from official app (TaHoma/Cozytouch/etc.)
  2. Report your config by browsing https://dev.duboc.pro/tahoma
  3. Search issues with title corresponding to your device widget name (see picture below). If no opened issue, rename your issue with this widget name.
  4. Provide your bridge last 4 digits (number visible as SETUP-XXXX-XXXX-XXXX at step 2.) Widget

Thank you.

Rammelkast commented 3 years ago

Noticed the same issue as well lately. image

ludoblockdevice commented 2 years ago

same here since few weeks.

denbrian commented 2 years ago

same

phimage commented 2 years ago

because I reproduce with some request log activated (and some edit to not showing private data)

polling error - Error 400 No registered event listener (UNSPECIFIED_ERROR)
[9/1/2022, 2:31:30 PM] [TaHoma]  POST /events/register
[9/1/2022, 2:31:30 PM] [TaHoma]  POST /events/<listener id>/fetch
[9/1/2022, 2:32:30 PM] [TaHoma]  POST /events/<listener id>/fetch
[9/1/2022, 2:32:30 PM] [TaHoma]  Disable event polling
[9/1/2022, 2:32:30 PM] [TaHoma]  POST https://xxx-1.overkiz.com/enduser-mobile-web/enduserAPI/login
[9/1/2022, 2:32:30 PM] [TaHoma]  Change event polling period to 60 sec
[9/1/2022, 2:32:30 PM] [TaHoma]  POST /events/<listener id>/fetch
[9/1/2022, 2:32:30 PM] [TaHoma] Polling error - Error 400 No registered event listener (UNSPECIFIED_ERROR)
[9/1/2022, 2:33:30 PM] [TaHoma]  POST /events/register
[9/1/2022, 2:33:30 PM] [TaHoma]  POST /events/<listener id>/fetch
[9/1/2022, 2:34:30 PM] [TaHoma]  POST /events/<listener id>/fetch
[9/1/2022, 2:34:30 PM] [TaHoma]  Disable event polling
[9/1/2022, 2:34:30 PM] [TaHoma]  POST https://xxx-1.overkiz.com/enduser-mobile-web/enduserAPI/login
[9/1/2022, 2:34:30 PM] [TaHoma]  Change event polling period to 60 sec
[9/1/2022, 2:34:30 PM] [TaHoma]  POST /events/<listener id>/fetch

so fetchEvents function call registerListener that provide the listener id and then do the /events/<listener id>/fetch

and it could failed here, so the catch exports.logger.error('Polling error -', error); log the error

400 is bad request, maybe some server do not accept event polling or we are not logged anymore (sometimes bad dev return 400 instead of correct error number)

dubocr commented 2 years ago

Hi,

This seem to come from the server session timeout that seem to be shorter than a minute. But as @thehilsnz says, even at 30 sec the issue persists. (the unmasked value of listener id can confirm that, if the value before and after login is the same) Release 2.2.27 improve fetcher registration in case after the session timeout (error 401) to avoid the bad listener id (error 400) by registering a new listener.

But this won't solve the fact that listeners are useless because session has expired each time the listener fetch for events.

I'm interested in any log after plugin update.

@phimage it's not necessary to hide listener id as it is only valid inside your session. No-one else can use it and it is (unfortunately in this case) invalidated at any new session (after each login). If you want, you can hide part of it to let us know which one is used in each requests.

github-actions[bot] commented 2 years ago

There hasn't been any activity on this issue recently. Please make sure to update to the latest Homebridge TaHoma version to see if that solves the issue. This issue will be closed in case of inactivity.