-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Issue with firmwares 5.50 and older #55
Comments
Failing using httpx: Session is created Line 40 in 529e434
Retrieving users Line 203 in 529e434
yield a raised transport error from Line 213 in 529e434
Full TCP dump capturing a failing session. These two are slightly modified to not use gather in order to be easier to compare with the synchronous flow of requests. 5.51 is failing and 5.75 is succeeding. main.py ignores the first transport error when retrieving users because it needs admin level and main is mainly for verifying function calls.
|
Succeeding using requests Session is created Line 23 in e3bfe72
Retrieving users Line 184 in e3bfe72
Line 15 in e3bfe72
TCP dump of a successful session using requests |
I was looking at moving from using get to post when retrieving users and noticed that this also failed, in this case both on 5.51 and 5.75. Going to even newer seems to work though. |
@Kane610 I'd recommend starting from a minimal test script and then ramping up to the actual code in the codebase. For example, what does a simple GET request to the device look like, does it succeed? If so, build a client like in the actual codebase, retry, and slowly make your way from there... Until you find at what point exactly things start looking off. Then share what this "minimal reproducible example" looks like, stripping away anything that doesn't make the bug go away. If you haven't already you can review our Requests Compatibility guide in case that could give you som hints: https://www.python-httpx.org/compatibility/ |
@florimondmanca absolutely i will try to reproduce it using a simple script. Indeed I followed the requests pages you'd written. And as stated above it works on newer devices so there is probably som quirk the older firmwares do that requests handle but httpx doesn't. |
@florimondmanca I've created the smallest thing to reproduce this issue, it fails as expected on some older devices and works fine on newer.
|
I'm getting the same error with:
This the the newest firmware for this device. |
Hello @Kane610 I checked the PR to requests lib:
without fix:
with fix:
|
Awesome! Thanks for the update @cdeler |
I've verified the fix to work on both a 5.51 device and a 5.75 and additionally that newer firmwares keep on working 🎉 |
This has been solved upstream so there is no need to keep this issue open anymore. |
Originally reported in HASS repo home-assistant/core#42415
There is an issue with the transition to httpx and firmwares of 5.50 and older. It works perfectly fine on newer firmwares.
Tested on a 5.75 which have Apache webserver rather than Boa and there are more differences when looking at network traces. Looking at a web request with unauthorised response setting up digest there is much more data related to the same session than on a device with boa, with boa every session ends after web server response, so looking in wire shark gives a much narrower scope per following.
Requests seemed to handle all this perfectly fine down to 5.20 or even earlier. So I think httpx is sensitive to what responses is sent from the Boa webserver.
The change from requests to httpx: https://github.com/Kane610/axis/pull/52/files
The change to async httpx: https://github.com/Kane610/axis/pull/53/files
The text was updated successfully, but these errors were encountered: