-
Notifications
You must be signed in to change notification settings - Fork 37
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
Intermittent ValueError on first GET response with ESP32-S2 #55
Comments
The I don't know if there's better handling for an empty
For now, I added code to retry a couple of times, then |
@anecdata Seems like we should check for empty chunk header and fail the connection. (Raising an exception or similar that closes the underlying socket.) |
Similar scenario (no headers or content returned, despite 200 status code on the server side) using today's artifacts from #4049 commits (6.2.0-beta.1-29-gaf92db28b on 2021-02-01) on multiple FeatherS2 with ESP32S2 gives:
which is non-fatal and recoverable, so I'm closing this issue. |
This has been observed for some months over successive versions of circuitpython and Requests (first noted in a comment in #34 ), current example with:
The first GET in
code.py
will sometimes result in this exception:Subsequent tries at GET always yield:
and reload is the only thing that seems to fix it.
I think it happens when the response is empty or times out or some similar situation. The response
status_code
,reason
,headers
, andtext
are all empty at the time the exception is raised. The server side sees 200 status code and non-zero content length sent to client.I see this on chunked responses, but I'm not sure if that's relevant, it's just mostly all I ever do.
This has no effect on correcting the issue:
Once Requests reloads normally and works on the first GET, it will continue to run fine for a time, then the
OSError: [Errno 9] EBADF
may crop up again later, requiring a reload.The text was updated successfully, but these errors were encountered: