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.

Connection broken: IncompleteRead

See original GitHub issue

This happened and wasn’t handled properly. Expected behaviour - reconnection

Traceback (most recent call last):¡ãç°¡å
  File "./feeder.py", line 78, in <module>
    stream.filter(**filterargs)
  File "build/bdist.linux-x86_64/egg/tweepy/streaming.py", line 430, in filter
  File "build/bdist.linux-x86_64/egg/tweepy/streaming.py", line 346, in _start
  File "build/bdist.linux-x86_64/egg/tweepy/streaming.py", line 286, in _run
requests.packages.urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(0 bytes read, 512 more expected)', IncompleteRead(0 bytes read, 512 more expected))

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:2
  • Comments:23 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
Vinodhkumar-MT16062commented, Mar 23, 2018

On simple method to handle/suppress the exception is to override the on_exception() function in tweepy streaming listener class.

Class MyListener(StreamListener):
       def on_status(self, status):
                <ur_code>
 
      def on_data(self,data):
               <ur_code>

        def on_exception(self, exception):
               print(exception)
               return

1reaction
Vinodhkumar-MT16062commented, Mar 23, 2018

i don’t think adding in on_data works… just overriding on_exception() as i have done for example is simple and works perfectly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python requests throws Connection Broken - Stack Overflow
Python requests throws Connection Broken: ChunkedEncodingError with http.client.IncompleteRead when trying to download a file.
Read more >
CSV file: Getting 'Connection broken: IncompleteRead' Error
The error means that the connection was broken while Python was reading data. It could be a timing issue (your code takes too...
Read more >
Filtered stream request breaks in 5 min intervals - Twitter API v2
While connection on nodejs breaks silently, Python throws the following error: ... ProtocolError: ('Connection broken: IncompleteRead(0 bytes read)', ...
Read more >
Connection broken: IncompleteRead(0 bytes read)
requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(0 bytes read)'. 编程语言. Traceback (most recent call last): File "/Library/ ...
Read more >
Twitter Streaming API - urllib3.exceptions.ProtocolError
ProtocolError: (' Connection broken : IncompleteRead ... [Incompleteread-error-when-retrieving-twitter-data-using-python]: ...
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