urllib3.exceptions.ProtocolError, BadStatusLine
See original GitHub issueurllib3.exceptions.ProtocolError: ('Connection aborted.', BadStatusLine('-inventory_product","_type":"product","_id":"2YmKAWMBhLHMbxOgNI9D","_score":null,"sort":[1663]},{"_index":"synthetic-inventory_product","_type":"product","_id":"3omKAWMBhLHMbxOgNI9D","_score":null,"sort":[1665]},{"_index":"synthetic-inventory_product","_type":"product","_id":"34mKAWMBhLHMbxOgNI9D","_score":null,"sort":[1667]},{"_index":"synthetic-inventory_product","_type":"product","_id":"8ImKAWMBhLHMbxOgNI-Q","_score":null,"sort":[1669]},{"_index":"synthetic-inventory_product","_type":"product","_id":"9ImKAWMBhLHMbxOgNI-Q","_score":null,"sort":[1671]},{"_index":"synthetic-inventory_product","_type":"product","_id":"94mKAWMBhLHMbxOgNI-Q","_score":null,"sort":[1673]}]}}HTTP/1.1 200 OK
So clearly there is some issue that Status code is mixing with response. I’m not sure how this happens but we receive those responses when using celery (not sure if this have any to do with that). I’m not sure if this is Elastic issue, or Python issue, or library issue. I don’t know where to start with debugging this, any clues where should I look to find root cause of this?
We are using Elastic 6.0.1 and elasticsearch-dsl==6.1.0
and elasticsearch==6.1.1
.
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
Why bad HTTP status with ProtocolError('Connection ...
Apparently, the code has to catch one more exception, urllib3.exceptions.MaxRetryError , and an HTTP status code as well ( BAD_GATEWAY_ERROR ...
Read more >connection aborted bad statusline
urllib3.exceptions.ProtocolError: ('Connection aborted.', BadStatusLine("''",)). During handling of the above exception, another exception occurred:.
Read more >is_conn_error fails to match BadStatusLine errors in some cases ...
The checks in in_conn_error can fail to match a BadStatusLine error and ... BadStatusLine("''",)) (Pdb) from urllib3.exceptions import ProtocolError as pe ...
Read more >Python:requests.exceptions.ConnectionError: ('Connection aborted ...
Python:requests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine(“””,)) ... I encounter this error when I'm trying to download a lot of pages ...
Read more >1248167 – [RHCI] Connection aborted BadStatusLIne ...
Bug 1248167 - [RHCI] Connection aborted BadStatusLIne during rhci ... {u'exception': None, u'task_type': u'pulp.server.managers.repo.sync.sync', u'task_id': ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@fxdgear I was able to add elasticsearch loggers to flask logger. I figured out my problem, thanks to the note the on docs https://elasticsearch-py.readthedocs.io/en/master/ I was spawning multiple process in background and each of them were using the same instance of Elasticsearch() which caused data to get messed up between different calls. Now I have a separate instance of Elasticsearch() for each process.
Thanks for your time 👍
Tbh I’m not sure. 😦
I’ve not used flask before. My background is Django, and as such the paradigms are quite different.
Maybe there’s a logging util in flask that can expose various loggers. And you can specify the elasticsearch loggers in the flask logger?
This way flask will bubble up other loggers.
I know that’s how it works in Django.
I hope that helps.