albertogeniola / meross-homeassistant

Custom component that leverages the Meross IoT library to integrate with Homeassistant
MIT License
710 stars 82 forks source link

Error from API with apiStatus 1402 #186

Closed daseeds closed 3 years ago

daseeds commented 3 years ago

Describe the bug Suddenly all the meross device stopped being available in HA. After checking the logs I discovered there was a return error from the Meross API. It seems the API answers with {'apiStatus': 1402, 'sysStatus': 0, 'data': None, 'info': 'Mysql excution timeout', 'timeStamp': '2020-12-21 18:54:54'}

Your environment HomeAssistant version: 2020.12.7 Hardware environment: RPi 4, 2 Meross 210 smart plugs, + other stuff on zwave + IKEA smart plug and IKEA gateway zigbee

Logs taken when the issue happened

2020-12-21 19:54:54 ERROR (MainThread) [meross_iot.http_api] Could not parse error code 1402.
2020-12-21 19:54:54 ERROR (MainThread) [custom_components.meross_cloud] Error occurred.
-------------------------------------
Component version: 0.4.1.0rc7
Device info: 
<Unavailable>
Error Message: "An exception occurred while setting up the meross manager. Setup will be retried..."
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/meross_iot/http_api.py", line 195, in _async_authenticated_post
    error = ErrorCodes(code)
  File "/usr/local/lib/python3.8/enum.py", line 315, in __call__
    return cls.__new__(cls, value)
  File "/usr/local/lib/python3.8/enum.py", line 617, in __new__
    raise ve_exc
ValueError: 1402 is not a valid ErrorCodes
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/config/custom_components/meross_cloud/__init__.py", line 109, in async_setup_entry
    client, http_devices, creds_renewed = await get_or_renew_creds(email=email, password=password, stored_creds=creds)
  File "/config/custom_components/meross_cloud/__init__.py", line 67, in get_or_renew_creds
    http_devices = await http_client.async_list_devices()
  File "/usr/local/lib/python3.8/site-packages/meross_iot/http_api.py", line 260, in async_list_devices
    result = await self._async_authenticated_post(_DEV_LIST, {}, cloud_creds=self._cloud_creds)
  File "/usr/local/lib/python3.8/site-packages/meross_iot/http_api.py", line 197, in _async_authenticated_post
    raise AuthenticatedPostException(f"Unknown/Unhandled response code received from API. "
meross_iot.model.http.exception.AuthenticatedPostException: Unknown/Unhandled response code received from API. Response was: {'apiStatus': 1402, 'sysStatus': 0, 'data': None, 'info': 'Mysql excution timeout', 'timeStamp': '2020-12-21 18:54:54'}
2020-12-21 19:54:54 WARNING (MainThread) [homeassistant.config_entries] Config entry for meross_cloud not ready yet. Retrying in 80 seconds
warst commented 3 years ago

I thought it was me, I've just restored a 32bit backup of home assistant onto a new install of 64bit, everything works besides Meross. Then I tried to log into the app. Error 1402 still. Tried to reset my password - Error 1402. Alexa integration? Not working. I think their systems are down....

ChrisPiel70 commented 3 years ago

Just wanted to open a Issue, but @daseeds was faster.

Ich kann confirm this as I have the same Problem since this afternoon.

HomeAssistant version: 2020.12.1 Component version: 0.4.1.0rc7 HA Meross 1.05

jules51x commented 3 years ago

Same issue here. All working fine on 2020.12.0 / Meross 1.0.5 until I rebooted HA about an hour ago. Tried reinstalling the HACS integration followed by an attempted reinstall on the main integration, but I get unknown error after entering the my email address and password.

hcpatou commented 3 years ago

Same issue on my side, since 2 hours (french time).

vomdth commented 3 years ago

Error is from Meross site. It also appears in the official Meross App...

A4368D15-E8BD-4EF2-9406-A8E69AE4FB63

CheekyMonkeyPo commented 3 years ago

Same here in the UK, but the app continues to work without error. All fine until rebooted, now the same issues identified above.

MrLeonida commented 3 years ago

Same here, Italy from 18 pm. App (android) is working fine.

dtalens commented 3 years ago

Same issue from 22:50 utc + 1 (Spain). Android app works fine

blaiser72 commented 3 years ago

The same: Error code 1402, the only 2 sockets dedicated to Christmas lights ... from the Meross android app is ok ...(Italy) 23:30

warst commented 3 years ago

Same here in the UK, but the app continues to work without error. All fine until rebooted, now the same issues identified above.

Don’t make the mistake I did and log out, you won’t get back in again!

pops106 commented 3 years ago

I just upgraded to hassio OS 5.9 and thought that was the issue.

In the meross app yes I can open the app but if you try to look at the last week or month you get an error as well so I think it is there end.

EDIT: just after posting app starts working properly but really slow, hassio still not working.

DanyGijon commented 3 years ago

Same here. Stopped working upon HA restart:

2020-12-22 00:03:00 ERROR (MainThread) [meross_iot.http_api] Could not parse error code 1402. 2020-12-22 00:03:00 ERROR (MainThread) [custom_components.meross_cloud] Error occurred.

Component version: 0.4.1.0rc7 Device info:

Error Message: "An exception occurred while setting up the meross manager. Setup will be retried..." ValueError: 1402 is not a valid ErrorCodes During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/user/homeassistant/lib/python3.8/site-packages/meross_iot/http_api.py", line 195, in _async_authenticated_post error = ErrorCodes(code) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/enum.py", line 304, in __call__ return cls.__new__(cls, value) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/enum.py", line 595, in __new__ raise exc File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/enum.py", line 579, in __new__ result = cls._missing_(value) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/enum.py", line 608, in _missing_ raise ValueError("%r is not a valid %s" % (value, cls.__name__)) ValueError: 1402 is not a valid ErrorCodes During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/user/.homeassistant/custom_components/meross_cloud/__init__.py", line 109, in async_setup_entry client, http_devices, creds_renewed = await get_or_renew_creds(email=email, password=password, stored_creds=creds) File "/Users/user/.homeassistant/custom_components/meross_cloud/__init__.py", line 67, in get_or_renew_creds http_devices = await http_client.async_list_devices() File "/Users/user/homeassistant/lib/python3.8/site-packages/meross_iot/http_api.py", line 260, in async_list_devices result = await self._async_authenticated_post(_DEV_LIST, {}, cloud_creds=self._cloud_creds) File "/Users/user/homeassistant/lib/python3.8/site-packages/meross_iot/http_api.py", line 197, in _async_authenticated_post raise AuthenticatedPostException(f"Unknown/Unhandled response code received from API. " meross_iot.model.http.exception.AuthenticatedPostException: Unknown/Unhandled response code received from API. Response was: {'apiStatus': 1402, 'sysStatus': 0, 'data': None, 'info': 'Mysql excution timeout', 'timeStamp': '2020-12-21 23:03:00'} Already tried to reinstall the component but didn't help
pops106 commented 3 years ago

It is all back working now for me

dtalens commented 3 years ago

It has returned to work at 2:28 utc + 1

hcpatou commented 3 years ago

Without any change in my config everything seems to be working again this morning.

blaiser72 commented 3 years ago

confirm, returned to work at 07:30 Italy

jules51x commented 3 years ago

Confirmed this end. All now back to normal this morning (UK)

ChrisPiel70 commented 3 years ago

also confirm, Devices back online since 02:00, Germany.

Time to buy Alberto Koffee for his #144 "LAN Only Control" Project.

warst commented 3 years ago

I can also confirm it is all working as expected now. I emailed Meross at the start to see if they had any issues as their service status page said all systems were operational.... I’ll update this if I get a sensible response.

warst commented 3 years ago

I can also confirm it is all working as expected now. I emailed Meross at the start to see if they had any issues as their service status page said all systems were operational.... I’ll update this if I get a sensible response.

Here we go -

Dear customer,

The meross EU server was scheduled to be upgraded from 13:00 pm CET on Monday 21th to 5:00 am CET on December 22th, during which the services might be affected. Now the service has been resumed, please try again on your end.

Sorry for the inconvenience.

Happy holidays!

Best regards, Your Meross Team

daseeds commented 3 years ago

Well it was just a maintenance... closed !