Closed barthoefs closed 1 year ago
Would be great if you could dump a debug log, but I assume you have the same issue as others discussing here: https://github.com/hultenvp/solis-sensor/issues/183#issuecomment-1330424320
Interestingly, when I extend timeouts to 100sec I now see the same issue.
2022-12-01 19:57:23.463 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Error from URI (/v1/api/inveterList) : 0, message='Attempt to decode JSON with unexpected mimetype: text/html', url=URL('https://www.soliscloud.com:13333/v1/api/inveterList')
2022-12-01 19:57:23.479 WARNING (MainThread) [custom_components.solis.soliscloud_api] No inverters found
2022-12-01 19:57:23.509 WARNING (MainThread) [custom_components.solis.service] Failed to discover, scheduling retry in 300 seconds.
2022-12-01 19:57:23.564 DEBUG (MainThread) [custom_components.solis.service] Scheduling discovery in 300 seconds.
I added some extra logging to log the raw text in order to debug this mime type error. here's what I got:
homeassistant | 2022-12-09 11:12:29.595 INFO (MainThread) [custom_components.solis.soliscloud_api] Output from URI (/v1/api/inveterList) : <html>
homeassistant | <head><title>502 Bad Gateway</title></head>
homeassistant | <body bgcolor="white">
homeassistant | <center><h1>502 Bad Gateway</h1></center>
homeassistant | <hr><center>nginx</center>
homeassistant | </body>
homeassistant | </html>
That's a load-balancer generated error page. I would say that's a problem on the backend with the Solis Cloud API servers.
Yeah seems like Solis Cloud api issue today
I'm seeing the same at my end too. The solistest.py is pulling back data ok, but the integration isn't and reports the same errors as above.
UPDATE: Although having just posted that, it all came back to life!!
I get this issue following a reboot for a bit (maybe 30 - 60 minutes). I wonder if there is more to this. It does eventually come back up.
@jmason, @viking2010 , @rossdargan : I recently had some connectivity troubles myself. Running now with extra logs to get more clarity, but I saw both 408 and 502 errors.
I think you are probably on the money regarding the 408 error being related to the VM time drift. Also that's a good theory about the 502s being related to the backend disliking repeated API calls too close together; that would explain how the same API calls work ok from the test app, but then give a 502 once called via the library.
Thanks for the response. I'd like to somehow get confirmation on the 502 theory. Let's see if I can use the test app to mimic a single session making to frequent calls.
I modified the test app to also use aiohttp and one single session. If I make 10 calls in parallel I get a 429:
{"error": "Too Many Requests", "message": "too much request 2 times in 1000 millseconds", "path": "/v1/api/inveterList", "status": 429, "timestamp": 1671179957966}
So it looks like the 502 is probably not caused by frequent calls. It still could be a load-balancer issue, but then why it only causes issues with the integration and not the test app.....
Still, I'll change the integration not to make more than 1 call per second as the 429 indicates 2 per second is max
I'll close this issue, further issues after release 3.2.0 please report in #232
Is this fixable? What is the default polling for the API?