Skip to content
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

Streaming crashes upon IncompleteRead #1

Open
eduardoltorres opened this issue Sep 28, 2020 · 1 comment
Open

Streaming crashes upon IncompleteRead #1

eduardoltorres opened this issue Sep 28, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@eduardoltorres
Copy link
Owner

Description

Application displays the error below with no apparent periodicity (approximately once per day):

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.8/http/client.py", line 551, in _get_chunk_left
    chunk_left = self._read_next_chunk_size()
  File "/usr/lib/python3.8/http/client.py", line 518, in _read_next_chunk_size
    return int(line, 16)
ValueError: invalid literal for int() with base 16: b''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/http/client.py", line 583, in _readinto_chunked
    chunk_left = self._get_chunk_left()
  File "/usr/lib/python3.8/http/client.py", line 553, in _get_chunk_left
    raise IncompleteRead(b'')
http.client.IncompleteRead: IncompleteRead(0 bytes read)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/eduardoltorres/.virtualenvs/the-debug-ducky-al9U58uy/lib/python3.8/site-packages/urllib3/response.py", line 436, in _error_catcher
    yield
  File "/home/eduardoltorres/.virtualenvs/the-debug-ducky-al9U58uy/lib/python3.8/site-packages/urllib3/response.py", line 518, in read
    data = self._fp.read(amt) if not fp_closed else b""
  File "/usr/lib/python3.8/http/client.py", line 454, in read
    n = self.readinto(b)
  File "/usr/lib/python3.8/http/client.py", line 488, in readinto
    return self._readinto_chunked(b)
  File "/usr/lib/python3.8/http/client.py", line 599, in _readinto_chunked
    raise IncompleteRead(bytes(b[0:total_bytes]))
http.client.IncompleteRead: IncompleteRead(226 bytes read)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/eduardoltorres/.virtualenvs/the-debug-ducky-al9U58uy/lib/python3.8/site-packages/tweepy/streaming.py", line 320, in _run
    six.reraise(*exc_info)
  File "/home/eduardoltorres/.virtualenvs/the-debug-ducky-al9U58uy/lib/python3.8/site-packages/six.py", line 703, in reraise
    raise value
  File "/home/eduardoltorres/.virtualenvs/the-debug-ducky-al9U58uy/lib/python3.8/site-packages/tweepy/streaming.py", line 289, in _run
    self._read_loop(resp)
  File "/home/eduardoltorres/.virtualenvs/the-debug-ducky-al9U58uy/lib/python3.8/site-packages/tweepy/streaming.py", line 339, in _read_loop
    line = buf.read_line()
  File "/home/eduardoltorres/.virtualenvs/the-debug-ducky-al9U58uy/lib/python3.8/site-packages/tweepy/streaming.py", line 200, in read_line
    self._buffer += self._stream.read(self._chunk_size)
  File "/home/eduardoltorres/.virtualenvs/the-debug-ducky-al9U58uy/lib/python3.8/site-packages/urllib3/response.py", line 540, in read
    raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
  File "/usr/lib/python3.8/contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "/home/eduardoltorres/.virtualenvs/the-debug-ducky-al9U58uy/lib/python3.8/site-packages/urllib3/response.py", line 454, in _error_catcher
    raise ProtocolError("Connection broken: %r" % e, e)
urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(226 bytes read)', IncompleteRead(226 bytes read))

Next steps

Start by looking at the relevant discussions from the following Tweepy issues:

@eduardoltorres eduardoltorres self-assigned this Oct 11, 2020
@eduardoltorres eduardoltorres added the bug Something isn't working label Oct 11, 2020
@eduardoltorres
Copy link
Owner Author

Stall warnings from #2 don't change behaviour in logging. Next attempt should be: queue and threading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant