smarthomej / addons

SmartHome/J addons for openHAB
Eclipse Public License 2.0
59 stars 23 forks source link

Server Reported Invalid Token. This should never happen #367

Closed BigGeorgeTx closed 2 years ago

BigGeorgeTx commented 2 years ago

Running openHAB 3.3.0M5 on a Pi4B with openhabian and version 3.2.12 of the Smarthome/J Tuya binding, I am seeing this in the logs:

2022-05-18 08:38:24.735 [WARN ] [ding.tuya.internal.cloud.TuyaOpenAPI] - Server reported invalid token. This should never happen. Trying to re-login. 2022-05-18 08:38:24.738 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR) 2022-05-18 08:39:24.867 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from OFFLINE (COMMUNICATION_ERROR) to ONLINE 2022-05-18 08:43:24.651 [WARN ] [ding.tuya.internal.cloud.TuyaOpenAPI] - Server reported invalid token. This should never happen. Trying to re-login. 2022-05-18 08:43:24.657 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR) 2022-05-18 08:44:24.779 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from OFFLINE (COMMUNICATION_ERROR) to ONLINE 2022-05-18 08:48:24.879 [WARN ] [ding.tuya.internal.cloud.TuyaOpenAPI] - Server reported invalid token. This should never happen. Trying to re-login. 2022-05-18 08:48:24.884 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR) 2022-05-18 08:49:25.010 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from OFFLINE (COMMUNICATION_ERROR) to ONLINE 2022-05-18 08:53:24.855 [WARN ] [ding.tuya.internal.cloud.TuyaOpenAPI] - Server reported invalid token. This should never happen. Trying to re-login. 2022-05-18 08:53:24.858 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR) 2022-05-18 08:54:24.983 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from OFFLINE (COMMUNICATION_ERROR) to ONLINE 2022-05-18 08:58:24.694 [WARN ] [ding.tuya.internal.cloud.TuyaOpenAPI] - Server reported invalid token. This should never happen. Trying to re-login. 2022-05-18 08:58:24.697 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR) 2022-05-18 08:59:24.834 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from OFFLINE (COMMUNICATION_ERROR) to ONLINE 2022-05-18 09:03:24.631 [WARN ] [ding.tuya.internal.cloud.TuyaOpenAPI] - Server reported invalid token. This should never happen. Trying to re-login. 2022-05-18 09:03:24.634 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR) 2022-05-18 09:04:24.768 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from OFFLINE (COMMUNICATION_ERROR) to ONLINE 2022-05-18 09:08:24.735 [WARN ] [ding.tuya.internal.cloud.TuyaOpenAPI] - Server reported invalid token. This should never happen. Trying to re-login. 2022-05-18 09:08:24.740 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR) 2022-05-18 09:09:24.864 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from OFFLINE (COMMUNICATION_ERROR) to ONLINE 2022-05-18 09:13:24.708 [WARN ] [ding.tuya.internal.cloud.TuyaOpenAPI] - Server reported invalid token. This should never happen. Trying to re-login. 2022-05-18 09:13:24.710 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR) 2022-05-18 09:14:24.840 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from OFFLINE (COMMUNICATION_ERROR) to ONLINE 2022-05-18 09:18:24.646 [WARN ] [ding.tuya.internal.cloud.TuyaOpenAPI] - Server reported invalid token. This should never happen. Trying to re-login. 2022-05-18 09:18:24.649 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR) 2022-05-18 09:19:24.783 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from OFFLINE (COMMUNICATION_ERROR) to ONLINE 2022-05-18 09:23:24.794 [WARN ] [ding.tuya.internal.cloud.TuyaOpenAPI] - Server reported invalid token. This should never happen. Trying to re-login. 2022-05-18 09:23:24.798 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR) 2022-05-18 09:24:24.929 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from OFFLINE (COMMUNICATION_ERROR) to ONLINE 2022-05-18 09:28:24.653 [WARN ] [ding.tuya.internal.cloud.TuyaOpenAPI] - Server reported invalid token. This should never happen. Trying to re-login. 2022-05-18 09:28:24.655 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR) 2022-05-18 09:29:24.786 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from OFFLINE (COMMUNICATION_ERROR) to ONLINE 2022-05-18 09:33:24.797 [WARN ] [ding.tuya.internal.cloud.TuyaOpenAPI] - Server reported invalid token. This should never happen. Trying to re-login. 2022-05-18 09:33:24.799 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR) 2022-05-18 09:34:24.931 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from OFFLINE (COMMUNICATION_ERROR) to ONLINE 2022-05-18 09:38:24.674 [WARN ] [ding.tuya.internal.cloud.TuyaOpenAPI] - Server reported invalid token. This should never happen. Trying to re-login. 2022-05-18 09:38:24.677 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR) 2022-05-18 09:39:24.833 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from OFFLINE (COMMUNICATION_ERROR) to ONLINE 2022-05-18 09:43:24.806 [WARN ] [ding.tuya.internal.cloud.TuyaOpenAPI] - Server reported invalid token. This should never happen. Trying to re-login. 2022-05-18 09:43:24.810 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR) 2022-05-18 09:44:24.941 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from OFFLINE (COMMUNICATION_ERROR) to ONLINE 2022-05-18 09:48:24.719 [WARN ] [ding.tuya.internal.cloud.TuyaOpenAPI] - Server reported invalid token. This should never happen. Trying to re-login. 2022-05-18 09:48:24.721 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR) 2022-05-18 09:49:24.872 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from OFFLINE (COMMUNICATION_ERROR) to ONLINE 2022-05-18 09:53:24.737 [WARN ] [ding.tuya.internal.cloud.TuyaOpenAPI] - Server reported invalid token. This should never happen. Trying to re-login. 2022-05-18 09:53:24.741 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR) 2022-05-18 09:54:24.871 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from OFFLINE (COMMUNICATION_ERROR) to ONLINE 2022-05-18 09:58:24.685 [WARN ] [ding.tuya.internal.cloud.TuyaOpenAPI] - Server reported invalid token. This should never happen. Trying to re-login. 2022-05-18 09:58:24.688 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR) 2022-05-18 09:59:24.823 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from OFFLINE (COMMUNICATION_ERROR) to ONLINE 2022-05-18 10:03:24.659 [WARN ] [ding.tuya.internal.cloud.TuyaOpenAPI] - Server reported invalid token. This should never happen. Trying to re-login. 2022-05-18 10:03:24.662 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR) 2022-05-18 10:04:24.795 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:project:TuyaCloudProject' changed from OFFLINE (COMMUNICATION_ERROR) to ONLINE

It doesn't seem to affect the functioning.

J-N-K commented 2 years ago

No, it only affects discovery of new devices. Did you try disabling and re-enabling the project thing? What happened before that? Did you put the system to sleep or were there any longer internet outages?

BigGeorgeTx commented 2 years ago

Cycling the Tuya Cloud account Thing did not resolve it.

This is on my 2nd openHAB installation. I hadn't check it in a while and when I did, the Tuya Cloud Account Thing was Uninitialized and all the device Things were offline. The Tuya Cloud Account Thing didn't show any detail in the UI, so I couldn't cycle it. I restarted openHAB, but that didn't help. I removed the binding and then installed it, and then it worked. I then upgraded openHAB to 3.3.0M5, removed and reinstalled the Smarthome/J bindings I use (Tuya and amazonechocontrol. It was after this that I noticed the above in the log.

J-N-K commented 2 years ago

Sorry for the long delay. Are you using the same login credentials and the same cloud project on different devices at the same time? I'm not sure that this is possible.

BigGeorgeTx commented 2 years ago

I was still seeing this message on one of my installations (but not the other) today. I updated that installation to M7 today and haven't seen the message in the log since I restarted. Before I was seeing it every 10 minutes.

Edit: I spoke too soon. I'm still seeing it in the log: 2022-06-20 19:03:33.176 [WARN ] [ding.tuya.internal.cloud.TuyaOpenAPI] - Server reported invalid token. This should never happen. Trying to re-login.

J-N-K commented 2 years ago

The re-login succeeds, correct?

BigGeorgeTx commented 2 years ago

Yes, it always reconnects.

I'm not seeing it today. I'm now running openHAB 3.3 Release with the 3.2.13 Smarthomej Tuya binding.

J-N-K commented 2 years ago

Seems to be fixed. A probable cause would be an expiring token when the internet connection is down.