-
Notifications
You must be signed in to change notification settings - Fork 33
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
F@st3890:aiohttp.client_exceptions.ServerDisconnectedError while get DeviceInfo #252
Comments
Tried to simplify the test and do
the payload: |
I had similar issue with Telekom FAST3896_MAGYAR (sw18.83.17.20e). Packet capture shows that aiohttp tries to reuse the TCP connection to send more than one HTTP request but the router don't like that and responds with RST:
To avoid connection reuse I added
The result is a race between the FIN of the 1st TCP session and the SYN of the 2nd one. The router still does not like it:
To avoid the race I added a small delay like skyjet18 suggested:
Finally it worked:
|
@bakonyiferenc would you be willing to do a PR to fix this? :-) |
That was just a quick and dirty PoC. I'll submit a proper PR next week. |
Fixes (iMicknl#252) - Implemented improved error handling and retry mechanism to handle transient network failures such as connection resets. - Added exponential backoff strategy for retry attempts - Ensured graceful handling of connection-related errors like ClientConnectorError, ClientOSError, and ServerDisconnectedError
Fixes (iMicknl#252) - Implemented improved error handling and retry mechanism to handle transient network failures such as connection resets. - Added exponential backoff strategy for retry attempts - Ensured graceful handling of connection-related errors like ClientConnectorError, ClientOSError, and ServerDisconnectedError
Fixes (#252) - Implemented improved error handling and retry mechanism to handle transient network failures such as connection resets. - Added exponential backoff strategy for retry attempts - Ensured graceful handling of connection-related errors like `ClientConnectorError`, `ClientOSError`, and `ServerDisconnectedError`
Fixed by #292 |
Versions
Describe the bug
I am experiencing some issues with 'Sagemcom' integration on Home Assistance. And decided to check how the
sagemcom_api
on my local machine. I got the python script from the example and can see the issue is the same.The python script fails with error (in most of cases) :
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected
It happens when the script runs
Device/DeviceInfo
command. Right before it successfully completesLogin
. I have compared payloads for the post request with the one my browser makes when I run$.xmo.getValuesTree("Device/DeviceInfo")
and found a difference withoptions
value only. So, I changed a bit thesagemcom_api
to populate the value and now it is totally the same but in case of browser I always get a response but the script returned some values ONLY once after 100 attempts.. usually --Server Disconnected error
this is payload of POST requestapi_host=http://192.168.55.44/cgi/json-req payload={'request': {'id': 1, 'session-id': '1984664181', 'priority': False, 'actions': [{'id': 0, 'method': 'getValue', 'xpath': 'Device/DeviceInfo', 'options': {'capability-flags': {'interface': 'true'}}}], 'cnonce': 0, 'auth-key': '51c050b5adf965d7c94234589723409587230489431fd51754a2e0f3de0b165c88adfb221ffb93292ff1340819034819328413284012384e0e'}}
What else I can check / verify / etc ?
BTW, I have the F@st3890V3 router but I use SHA512 hashing, the MD5 does not work at all in my case, i can see the corresponding error msg in router log..
BTW2, version is still '1.0.1'
[bug]
The text was updated successfully, but these errors were encountered: