Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloud error: cannot found access token info #1060

Closed
PetarLotrean opened this issue Dec 17, 2022 · 30 comments
Closed

Cloud error: cannot found access token info #1060

PetarLotrean opened this issue Dec 17, 2022 · 30 comments
Labels
bug Something isn't working

Comments

@PetarLotrean
Copy link

All of my entities suddenly stopped working today after a long time of not touching anything. I can log in to ewelink normally, tried re-adding the integration.

From debug page:

2022-12-17 15:49:32 [D] CLOUD None => None
2022-12-17 15:49:32 [W] Can't load devices|  File "/config/custom_components/sonoff/__init__.py", line 199, in internal_normal_setup|    devices = await registry.cloud.get_devices(homes)|Exception: cannot found access token info|
2022-12-17 15:49:33 [D] 7 devices loaded from Cache
...
...
2022-12-17 15:49:33 [D] AUTO mode start
2022-12-17 15:49:33 [D] 100178fa3c <= Local0 | {'switch': 'off', 'startup': 'off', 'pulseConfig': {'pulse': 'off', 'switch': 'off', 'pulseWidth': 500}, 'sledOnline': 'on', 'tempUnit': 0, 'timeZone': 2, 'sensorType': 'AM2301', 'currentTemperature': '7.7', 'currentHumidity': '67.5', 'autoControlEnabled': 0, 'fwVersion': '1.0.2', 'rssi': -71} | 778384
2022-12-17 15:49:33 [E] Cloud WS exception|  File "/config/custom_components/sonoff/core/ewelink/cloud.py", line 318, in connect|    raise Exception(resp)|Exception: {'error': 406, 'apikey': 'XXXXX', 'sequence': '1671288573520', 'actionName': 'userOnline'}|
2022-12-17 15:49:33 [D] CLOUD None => False
2022-12-17 15:49:33 [D] Cloud connection retrying in 15 seconds
2022-12-17 15:49:33 [D] Add 22 entities
2022-12-17 15:49:33 [D] Add 22 entities

cannot found access token info - is this tied to dev token maybe? Then everyone would have the same issue?

@danieletognetti01
Copy link

i have the same problem, today all the device connected to cloud went offline

@Sereen666
Copy link

Same problem here as of today, reloading the addon does refresh the temperature sensors i have, switches do still work but motion sensors do detect motion in ewelink app but not in HA

@cezzz674
Copy link

Same problem

@PetarLotrean PetarLotrean changed the title All Sonoff devices/entities on HA unavailable, while working in eWeLink All Sonoff devices/entities on HA unavailable, while still working in eWeLink Dec 18, 2022
@Sereen666
Copy link

Ive upgraded home assistant and home assitant core to the latest version and all seems to work again.

@brightstargazer
Copy link

Same problem here. I discovered that reloading the integration / rebooting HA solves the problem for a short time, but then they drop again. Everything seems fine in ewelink. Seems to be mostly affecting my zigbee stuff, not so much wifi switches.

@PetarLotrean
Copy link
Author

Ive upgraded home assistant and home assitant core to the latest version and all seems to work again.

This solved it for me, works for 12h now. Thanks @Sereen666!

@danieletognetti01
Copy link

Ive upgraded home assistant and home assitant core to the latest version and all seems to work again.

which version? because i've upgraded but it works only few minutes..

@PetarLotrean
Copy link
Author

PetarLotrean commented Dec 19, 2022

Hey @danieletognetti01 , I upgraded to the latest version, and my previous version wasn't that old. It was maybe 2022.11.3, now it is 2022.12.7. Also, I upgraded the OS version as well, from 9.3 to 9.4.

image

@danieletognetti01
Copy link

Schermata del 2022-12-19 11-16-31
unluckily is the same

@PetarLotrean
Copy link
Author

PetarLotrean commented Dec 19, 2022

Hmm, then I'll leave the issue open, maybe someone else has an idea or finds a fix.

@Sereen666
Copy link

@danieletognetti01 did you setup your country in HA settings after the upgrade?

@danieletognetti01
Copy link

@danieletognetti01 did you setup your country in HA settings after the upgrade?

yes

@Zylazy
Copy link

Zylazy commented Dec 20, 2022

I have the same issue.
I have replaced the firmware with tasmota on all my devices where it was possible, but but i have still a couple of switches and a lot of sensors. Unfortunatelly they are very unreliable. I have an automation which runs a check every one minute. If it fails then it tries to reload the devices if it fails as well then it reloads the integration. Every second check fails. I think I will get rid of all my sonoff devices which are not compatible with tasmota

@Zylazy
Copy link

Zylazy commented Dec 20, 2022

Btw the devices are not unavailable, but their statedoes not change in HA, if I toggle a switch it stay in the same state, how ever the switch itself turns on and off, and in ewelink the state is correct. Just like if I toggle the switch in ewelink then it works but does not update 8n HA, only after a reload command

@Tux92
Copy link

Tux92 commented Dec 21, 2022

Btw the devices are not unavailable, but their statedoes not change in HA, if I toggle a switch it stay in the same state, how ever the switch itself turns on and off, and in ewelink the state is correct. Just like if I toggle the switch in ewelink then it works but does not update 8n HA, only after a reload command

I have the same problem!

@fuzzybear62
Copy link

Same problem 2022.12.7 release

@dvhub
Copy link

dvhub commented Dec 24, 2022

Same problem for me.

@70nyIT
Copy link

70nyIT commented Jan 3, 2023

Same here.
After approx 24 hours of connecting devices, the system was able to trigger status changes (lights were turned on correctly by automation) but was not able to update the status of the devices (as if it doesn't have read capabilities).

After rebooting the HA, it works correctly.

I have not made debugging, but to me looks like the eWeLink token expired and was not refreshed. Will keep tracking this issue and post useful information here, if I have more.

@DrMikeyS
Copy link

DrMikeyS commented Jan 7, 2023

Same here. After approx 24 hours of connecting devices, the system was able to trigger status changes (lights were turned on correctly by automation) but was not able to update the status of the devices (as if it doesn't have read capabilities).

After rebooting the HA, it works correctly.

I have not made debugging, but to me looks like the eWeLink token expired and was not refreshed. Will keep tracking this issue and post useful information here, if I have more.

I am pretty sure this is the issue. I am using current version of HA and battery devices dropped off overnight. Reloading integration did nothing, neither did restart. However, adding integration again (ie Reauthenticate) fixed it

@70nyIT
Copy link

70nyIT commented Jan 7, 2023

If I can add more for what I found out in the previous days, I've noticed that if there's an error during the token refresh, it is not able to re-try the authentication.
The "error" can be an internet outage (also a simply local router reboot), or eWeLink servers down (it happens pretty often for my experience).

Is it possible that this issue is connected to a poor re-try logic on failed authentication? I guess that to answer this we need the support of a developer

@PetarLotrean
Copy link
Author

I am the person who opened the issue, and my issue self-resolved after some readding/reloading/restarting both in HA and in eWeLink. I suspect that you are right, something is messy with the integration when an outage happens, confirmed by several people reporting the same issue at the same time.

@70nyIT
Copy link

70nyIT commented Jan 8, 2023

Yesterday happened the issue again, and I was able to evaluate the logs a couple of hours after. This is the error I found

Logger: [custom_components.sonoff.core.ewelink.cloud](http://custom_components.sonoff.core.ewelink.cloud/)
Source: custom_components/sonoff/core/ewelink/cloud.py:286
Integration: Sonoff (documentation, issues)
First occurred: 7:17:39 PM (2 occurrences)
Last logged: 7:17:45 PM

UNKNOWN cloud msg: {'action': 'notify', 'apikey': '********-****-****-****-************', 'userAgent': 'app', 'sequence': '1673115459100', 'proxyMsgTime': 1673115459100, 'cmd': 'castNotify', 'params': {'type': 'edit', 'id': '63545839****************', 'things': ['a480******', '1000d*****', '1001677***', '1001675***', '1001674***'], 'charts': [], 'cameras': [], 'partnerApikey': 'ckserver-i-0008************b-0****16'}}
UNKNOWN cloud msg: {'action': 'notify', 'apikey': '********-****-****-****-************', 'userAgent': 'app', 'sequence': '1673115465983', 'proxyMsgTime': 1673115465983, 'cmd': 'castNotify', 'params': {'type': 'edit', 'id': '63545839****************', 'things': ['a480******', '1000d*****', '1001675***', '1001674***'], 'charts': [], 'cameras': [], 'partnerApikey': 'ckserver-i-0008************b-0****08'}}

I have placed the * instead of actual chars for privacy reasons.

I can understand when this outage occurs, as the system stops getting new data from the temperature sensor I have.

I tried to refresh the custom component, and everything seemed fixed (I was able to see the correct temperature value), but then it does not read temperature anymore. Only a system reboot fixes the issues, until the next outage occurs (apparently not after a fixed amount of time).

Hope all these information can help fix the bug, as this make the system completely unreliable. I'm using this to manage heating, and not reading anymore the temperature with the heating turned on, means having the house very hot (and wasting lots of $$$).

@70nyIT
Copy link

70nyIT commented Jan 9, 2023

Yesterday I had another outage, but with a different log. So looks like the issues that cause this error are more than one.

Here's the log

Logger: [custom_components.sonoff.core.ewelink.cloud](http://custom_components.sonoff.core.ewelink.cloud/)
Source: custom_components/sonoff/climate.py:169
Integration: Sonoff (documentation, issues)
First occurred: 9:47:27 PM (1 occurrences)
Last logged: 9:47:27 PM

Cloud processing error
Traceback (most recent call last):
  File "/config/custom_components/sonoff/core/ewelink/cloud.py", line 286, in run_forever
    await self._process_ws_msg(resp)
  File "/config/custom_components/sonoff/core/ewelink/cloud.py", line 346, in _process_ws_msg
    self.dispatcher_send(SIGNAL_UPDATE, data)
  File "/config/custom_components/sonoff/core/ewelink/base.py", line 59, in dispatcher_send
    handler(*args, **kwargs)
  File "/config/custom_components/sonoff/core/ewelink/__init__.py", line 188, in cloud_update
    self.dispatcher_send(did, params)
  File "/config/custom_components/sonoff/core/ewelink/base.py", line 59, in dispatcher_send
    handler(*args, **kwargs)
  File "/config/custom_components/sonoff/core/entity.py", line 108, in internal_update
    self.set_state(params)
  File "/config/custom_components/sonoff/climate.py", line 169, in set_state
    cache["temperature"] + cache.get("tempCorrection", 0)
TypeError: can only concatenate str (not "int") to str

As always, to fix the issue, I had to reboot the system.

@Zylazy
Copy link

Zylazy commented Jan 13, 2023

Today since 8AM CET there was no need to reload the integration!
I have a job which checks the sonoff devices and reloads it if necesarry. Usually every second check fails. But now there was no reload in the last 3 hours.
There was no upgrade, and no HA restart neither.
It is promissing! I hope it stay like this.

@Tux92
Copy link

Tux92 commented Jan 13, 2023

Today since 8AM CET there was no need to reload the integration! I have a job which checks the sonoff devices and reloads it if necesarry. Usually every second check fails. But now there was no reload in the last 3 hours. There was no upgrade, and no HA restart neither. It is promissing! I hope it stay like this.

Hi, cloud you please explain how do you do this job?

@70nyIT
Copy link

70nyIT commented Jan 13, 2023

This issue is very odd. For me, now, the switches are mostly working fine. Once every one or two days, instead, it stops updating the temperature from the Zigbee sensor (but I can see the correct value in the eWeLink App).
I have a job that checks if the temperature hasn't changed for more than 1 hour, this means the issue is there. For me, though, I have to restart the HA Server (that's a big pain), the simple reload of the component doesn't work.

@Ghimpe-ro
Copy link

Ghimpe-ro commented Jan 14, 2023

The same issue is bugging me for about two months now. Very annoying. I have two homes the main one with LAN and HA and the second only some ZigBee sensors. Every few hours the integration goes down and the remote home is offline in HA, whilst sometime the main home works.
The remedy is to redownload the integration in HACS and reload it from integrations. Now it happened again and I see it asks for reboot after download.
Very annoying.
Please tell if I can help in anyway to solve this.
I even created an automation to notify me when it happens.

@Zylazy
Copy link

Zylazy commented Jan 19, 2023

Today since 8AM CET there was no need to reload the integration! I have a job which checks the sonoff devices and reloads it if necesarry. Usually every second check fails. But now there was no reload in the last 3 hours. There was no upgrade, and no HA restart neither. It is promissing! I hope it stay like this.

The problem is not solved atall. It worked perfect just for two days, but since last Sunday the situation is the same as befure. Every second check fails, so need to reload the integration every second minutes.

@Ghimpe-ro
Copy link

This issue started occuring twice/three times a day and won't go away untill I redownload and restart the HA.
Can we please address this, I am so close to give up on this integration...

@AlexxIT AlexxIT changed the title All Sonoff devices/entities on HA unavailable, while still working in eWeLink Cloud error: cannot found access token info Feb 4, 2023
@AlexxIT AlexxIT added the bug Something isn't working label Feb 4, 2023
@AlexxIT
Copy link
Owner

AlexxIT commented Feb 4, 2023

It was temporary cloud bug

@AlexxIT AlexxIT closed this as completed Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests