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 WS exception (error 406) #1011

Closed
hanskiepl opened this issue Oct 22, 2022 · 20 comments
Closed

Cloud WS exception (error 406) #1011

hanskiepl opened this issue Oct 22, 2022 · 20 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@hanskiepl
Copy link

hanskiepl commented Oct 22, 2022

i have got latest version of your pllugin
Generally it works but i dont know why it ocasionally stops working on every single day.
eWelink app works fine when homeasistatnt stops reading data.

Logger: custom_components.sonoff.core.ewelink.cloud
Source: custom_components/sonoff/core/ewelink/cloud.py:318
Integration: Sonoff (documentation, issues)
First occurred: 14:28:49 (5 occurrences)
Last logged: 14:50:07

Cloud WS exception
Traceback (most recent call last):
  File "/config/custom_components/sonoff/core/ewelink/cloud.py", line 318, in connect
    raise Exception(resp)
Exception: {'error': 406, 'apikey': 'xxxxxxxxxxxxxxxxxx', 'sequence': '166600000029875', 'actionName': 'userOnline'}

Issues link looks like below 


2022-10-24 00:40:13 [D] 100168ba28 <= Cloud3 | {'power': '46.21', 'voltage': '228.75', 'current': '0.26'} | None
2022-10-24 00:41:03 [E] Cloud WS exception|  File "/config/custom_components/sonoff/core/ewelink/cloud.py", line 318, in connect|    raise Exception(resp)|Exception: {'error': 406, 'apikey': '3c104dcf-90690000000-3180fb1f80ef', 'sequence': '1666564863386', 'actionName': 'userOnline'}|
2022-10-24 00:41:03 [D] CLOUD True => False
2022-10-24 00:41:03 [D] Cloud connection retrying in 15 seconds
2022-10-24 00:41:19 [E] Cloud WS exception|  File "/config/custom_components/sonoff/core/ewelink/cloud.py", line 318, in connect|    raise Exception(resp)|Exception: {'error': 406, 'apikey': '3c104dcf-9069-⁰00000007-3180fb1f80ef', 'sequence': '1666564878993', 'actionName': 'userOnline'}|
2022-10-24 00:41:19 [D] CLOUD False => False
2022-10-24 00:41:19 [D] Cloud connection retrying in 60 seconds
2022-10-24 00:42:19 [E] Cloud WS exception|  File "/config/custom_components/sonoff/core/ewelink/cloud.py", line 318, in connect|    raise Exception(resp)|Exception: {'error': 406, 'apikey': '3c104dcf-9069-0000000-3180fb1f80ef', 'sequence': '1666564939347', 'actionName': 'userOnline'}|
2022-10-24 00:42:19 [D] CLOUD False => False
2022-10-24 00:42:19 [D] Cloud connection retrying in 300 seconds
2022-10-24 00:47:19 [E] Cloud WS exception|  File "/config/custom_components/sonoff/core/ewelink/cloud.py", line 318, in connect|    raise Exception(resp)|Exception: {'error': 406, 'apikey': '3c104dcf-9069-0000000-3180fb1f80ef', 'sequence': '1666565239961', 'actionName': 'userOnline'}|
2022-10-24 00:47:20 [D] CLOUD False => False
2022-10-24 00:47:20 [D] Cloud connection retrying in 900 seconds
2022-10-24 01:02:20 [E] Cloud WS exception|  File "/config/custom_components/sonoff/core/ewelink/cloud.py", line 318, in connect|    raise Exception(resp)|Exception: {'error': 406, 'apikey': '3c104dcf-9069-00000000-3180fb1f80ef', 'sequence': '1666566140417', 'actionName': 'userOnline'}|
2022-10-24 01:02:20 [D] CLOUD False => False
2022-10-24 01:02:20 [D] Cloud connection retrying in 3600 seconds
2022-10-24 02:02:20 [E] Cloud WS exception|  File "/config/custom_components/sonoff/core/ewelink/cloud.py", line 318, in connect|    raise Exception(resp)|Exception: {'error': 406, 'apikey': '3c104dcf-9069-00⁰000000-3180fb1f80ef', 'sequence': '1666569740881', 'actionName': 'userOnline'}|
2022-10-24 02:02:20 [D] CLOUD False => False
2022-10-24 02:02:20 [D] Cloud connection retrying in 3600 seconds
2022-10-24 03:02:21 [E] Cloud WS exception|  File "/config/custom_components/sonoff/core/ewelink/cloud.py", line 318, in connect|    raise Exception(resp)|Exception: {'error': 406, 'apikey': '3c104dcf-9069-0000000-3180fb1f80ef', 'sequence': '1666573341784', 'actionName': 'userOnline'}|
2022-10-24 03:02:21 [D] CLOUD False => False
2022-10-24 03:02:21 [D] Cloud connection retrying in 3600 seconds
@yurtaevalex
Copy link

yurtaevalex commented Nov 1, 2022

ver. v3.3.1

Logger: custom_components.sonoff.core.ewelink.cloud
Source: custom_components/sonoff/core/ewelink/cloud.py:318
Integration: Sonoff ([documentation](https://github.com/AlexxIT/SonoffLAN), [issues](https://github.com/AlexxIT/SonoffLAN/issues))
First occurred: 30 октября 2022 г., 12:42:06 (51 occurrences)
Last logged: 12:06:11

Cloud WS exception
Traceback (most recent call last):
  File "/config/custom_components/sonoff/core/ewelink/cloud.py", line 318, in connect
    raise Exception(resp)
Exception: {'error': 406, 'apikey': 'xxxxx', 'sequence': 'xxxxx', 'actionName': 'userOnline'}

@AlexxIT AlexxIT added the question Further information is requested label Nov 15, 2022
@AlexxIT
Copy link
Owner

AlexxIT commented Nov 15, 2022

Is problem still actual?

@yurtaevalex
Copy link

yurtaevalex commented Nov 15, 2022

Проблема еще актуальна?

Да

@AlexxIT AlexxIT added bug Something isn't working and removed question Further information is requested labels Nov 15, 2022
@AlexxIT AlexxIT added this to the 3.4.0 milestone Nov 15, 2022
@hanskiepl
Copy link
Author

Is problem still actual?

Yes, still the same problem. Sometime once sometime a few times daily :-(

@phantomdez
Copy link

I have this issue as well. I am unable to add new devices to home assistant it seems. Existing devices are working normally. The new device is working in the eWelink app but I cannot see it in Home assistant.

@pauldanieltudor
Copy link

I get the same error but in my case it is after some 2-3 days of working perfectly and if I restart HA it works fine again, the problem ony manifests on devices that are connected via cloud only (not in my home LAN) Any fix on this?

Cloud WS exception| File "/config/custom_components/sonoff/core/ewelink/cloud.py", line 318, in connect| raise Exception(resp)|Exception: {'error': 406, 'apikey':
'actionName': 'userOnline'

@mjburton
Copy link

I have the same issue after upgrading to the latest HA and 3.3.1, yet the debug log suggests it has found the one device I have:

    ],
    "level": "WARNING",
    "source": [
      "custom_components/sonoff/core/ewelink/cloud.py",
      192
    ],
    "timestamp": 1670769011.3212235,
    "exception": "Traceback (most recent call last):\n  File \"/config/custom_components/sonoff/__init__.py\", line 199, in internal_normal_setup\n    devices = await registry.cloud.get_devices(homes)\n  File \"/config/custom_components/sonoff/core/ewelink/cloud.py\", line 192, in get_devices\n    raise Exception(resp[\"msg\"])\nException: cannot found access token info\n",
    "count": 1,
    "first_occurred": 1670769011.3212235
  },
  {
    "name": "custom_components.sonoff.core.ewelink.cloud",
    "message": [
      "Cloud WS exception"
    ],
    "level": "ERROR",
    "source": [
      "custom_components/sonoff/core/ewelink/cloud.py",
      318
    ],
    "timestamp": 1670769387.9991748,
    "exception": "Traceback (most recent call last):\n  File \"/config/custom_components/sonoff/core/ewelink/cloud.py\", line 318, in connect\n    raise Exception(resp)\nException: {'error': 406, 'apikey': 'xxxxxxxxxxx', 'sequence': '1670769011661', 'actionName': 'userOnline'}\n",
    "count": 4,
    "first_occurred": 1670769011.688297
  }

@fuzzybear62
Copy link

fuzzybear62 commented Jan 5, 2023

Same issue, version 3.3.1 HA 2023.1.0

This is the output log:

2023-01-05 16:17:00.639 ERROR (MainThread) [custom_components.sonoff.core.ewelink.cloud] Cloud WS exception
Traceback (most recent call last):
  File "/config/custom_components/sonoff/core/ewelink/cloud.py", line 318, in connect
    raise Exception(resp)
Exception: {'error': 406, 'apikey': 'XXXXXXXX', 'sequence': 'XXXXX', 'actionName': 'userOnline'}

@mjburton
Copy link

mjburton commented Jan 5, 2023 via email

@fuzzybear62
Copy link

I'll try thank you

@AlexxIT AlexxIT modified the milestones: 3.4.0, v3.4.1 Feb 5, 2023
@AlexxIT
Copy link
Owner

AlexxIT commented Mar 31, 2023

This is authorization error from cloud. I don't know how to reproduce it. And don't know how to fix it.
Make sure you using latest integration version with latest version for cloud API

@AlexxIT AlexxIT removed this from the todo milestone Mar 31, 2023
@pauldanieltudor
Copy link

It seems a year passed, many updates since then, problem persists: Cloud devices go permanently offline (unavailable) after 2-4 days, sometimes they work fine for 2-3 weeks, just had a record of almost a month, so it is indeed a rare occurance. Reloading the integration does not help, only HA restart fixes the issue but it does fix it every single time. I do get a cloud authentification error in logs but it does not help much:

Cloud WS exception| File "/config/custom_components/sonoff/core/ewelink/cloud.py", line 323, in connect| raise Exception(resp)|Exception: {'error': 406, 'reason': 'Authentication Failed', 'apikey': 'sequence': '1695612246995', 'actionName': 'userOnline'}
CLOUD False => False

Devices in LAN never fail, only those outside of my LAN have this issue, they are actually in a subnet of my LAN but same thing: not in my LAN. Each time I find the offline in HA I check the ewelink app and there they are always working.

Not sure it helps but in older versions (2022-ish) reloading the integration used to work to fix this issue, sadly since oct 2022 (could be off by 6 months) reloading stopped helping and now requires HA restart.

@pauldanieltudor
Copy link

Also quick reload does not fix the issue either, anything (including updates to core or Supervisor) that involves HA restart will bring them right back up.

@farmerkz
Copy link

farmerkz commented Oct 5, 2023

The same problem, I won’t tell you the exact time it appeared, but it seems that after the HAOS update a few days ago.

2023-10-06 00:40:37.825 ERROR (MainThread) [custom_components.sonoff.core.ewelink.cloud] Cloud WS exception
Traceback (most recent call last):
  File "/config/custom_components/sonoff/core/ewelink/cloud.py", line 323, in connect
    raise Exception(resp)
Exception: {'error': 406, 'reason': 'Authentication Failed', 'apikey': 'xxxxxxxxxxxxxxxx', 'sequence': 'dddddddddd', 'actionName': 'userOnline'}

A quick reload does not solve the problem; after rebooting HAOS, the problem disappears for about a day.

@eduardoit
Copy link

eduardoit commented Nov 10, 2023

I live day after day with the same problem. I have all the updates up to date.

This error originated from a custom integration.

Logger: custom_components.sonoff.core.ewelink.cloud
Source: custom_components/sonoff/core/ewelink/cloud.py:323
Integration: Sonoff (documentation, issues)
First occurred: 9 de noviembre de 2023, 23:59:09 (15 occurrences)
Last logged: 10:21:02

Cloud WS exception
Traceback (most recent call last):
  File "/config/custom_components/sonoff/core/ewelink/cloud.py", line 323, in connect
    raise Exception(resp)
Exception: {'error': 406, 'reason': 'Authentication Failed', 'apikey': 'xxxxxxxxxxxxx', 'sequence': 'xxxxxxxxxxxx', 'actionName': 'userOnline'}

I reload the integration and it works again for a couple of hours.

@AlexxIT AlexxIT changed the title Cloud WS exception Cloud WS exception (error 406) Feb 16, 2024
@marinus61
Copy link

Hi AlexxIT, thks works now, appriciate the great work you done for this great integration

@AlexxIT
Copy link
Owner

AlexxIT commented Feb 16, 2024

I didn't do anything about this issue. As I said earlier, it's a cloud error.

@marinus61
Copy link

Anyway happy that your great integration is working again. Thks for your swift "support", maybe you have magical skills :)

@AlexxIT
Copy link
Owner

AlexxIT commented Apr 9, 2024

PS. "Authentication Failed" can be if you logged in with same account from another place.

@AlexxIT AlexxIT self-assigned this Apr 9, 2024
@AlexxIT AlexxIT added this to the v3.7.0 milestone Apr 9, 2024
@AlexxIT
Copy link
Owner

AlexxIT commented Apr 17, 2024

@AlexxIT AlexxIT closed this as completed Apr 17, 2024
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

10 participants