question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

urllib3.exceptions.ProtocolError, BadStatusLine

See original GitHub issue
urllib3.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:closed
  • Created 5 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
manjilercommented, May 10, 2018

@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 👍

0reactions
fxdgearcommented, May 9, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found