requests.exceptions.ChunkedEncodingError:
dennistsc opened this issue · 4 comments
hi CRutlowski, this is what i do the following"
step 1: put the kijiji url in (python3 main.py --setup) then save and close
step 2: using ubuntu type "python3 main.py"
but after 3mins.... show error
http.client.IncompleteRead: IncompleteRead(0 bytes read)
urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
could you help me thanks you
Hi,
I'm getting the same error on a very regular basis!
It looks like it's working sometimes but sometimes not...
Here is a complete stack trace:
File "/home/tristan/.local/lib/python3.5/site-packages/urllib3/response.py", line 697, in _update_chunk_length
self.chunk_left = 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 "/home/tristan/.local/lib/python3.5/site-packages/urllib3/response.py", line 437, in _error_catcher
yield
File "/home/tristan/.local/lib/python3.5/site-packages/urllib3/response.py", line 764, in read_chunked
self._update_chunk_length()
File "/home/tristan/.local/lib/python3.5/site-packages/urllib3/response.py", line 701, in _update_chunk_length
raise httplib.IncompleteRead(line)
http.client.IncompleteRead: IncompleteRead(0 bytes read)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/tristan/.local/lib/python3.5/site-packages/requests/models.py", line 751, in generate
for chunk in self.raw.stream(chunk_size, decode_content=True):
File "/home/tristan/.local/lib/python3.5/site-packages/urllib3/response.py", line 572, in stream
for line in self.read_chunked(amt, decode_content=decode_content):
File "/home/tristan/.local/lib/python3.5/site-packages/urllib3/response.py", line 793, in read_chunked
self._original_response.close()
File "/usr/lib/python3.5/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/home/tristan/.local/lib/python3.5/site-packages/urllib3/response.py", line 455, in _error_catcher
raise ProtocolError("Connection broken: %r" % e, e)
urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/kijiji", line 11, in <module>
load_entry_point('kijiji-scraper==3.0.1', 'console_scripts', 'kijiji')()
File "/usr/local/lib/python3.5/dist-packages/kijiji_scraper-3.0.1-py3.5.egg/kijiji_scraper/launcher.py", line 92, in main
ads, email_title = kijiji_scraper.scrape_kijiji_for_ads(url)
File "/usr/local/lib/python3.5/dist-packages/kijiji_scraper-3.0.1-py3.5.egg/kijiji_scraper/kijiji_scraper.py", line 52, in scrape_kijiji_for_ads
page = requests.get(url)
File "/home/tristan/.local/lib/python3.5/site-packages/requests/api.py", line 76, in get
return request('get', url, params=params, **kwargs)
File "/home/tristan/.local/lib/python3.5/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/home/tristan/.local/lib/python3.5/site-packages/requests/sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "/home/tristan/.local/lib/python3.5/site-packages/requests/sessions.py", line 683, in send
r.content
File "/home/tristan/.local/lib/python3.5/site-packages/requests/models.py", line 829, in content
self._content = b''.join(self.iter_content(CONTENT_CHUNK_SIZE)) or b''
File "/home/tristan/.local/lib/python3.5/site-packages/requests/models.py", line 754, in generate
raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
Let's not that I'm using python 3.5, what version are you using @dennistsc ?
i'm using 3.8.5
i believe is packages problem
Hi,
I'm getting the same error on a very regular basis!
It looks like it's working sometimes but sometimes not...
Here is a complete stack trace:
File "/home/tristan/.local/lib/python3.5/site-packages/urllib3/response.py", line 697, in _update_chunk_length self.chunk_left = 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 "/home/tristan/.local/lib/python3.5/site-packages/urllib3/response.py", line 437, in _error_catcher yield File "/home/tristan/.local/lib/python3.5/site-packages/urllib3/response.py", line 764, in read_chunked self._update_chunk_length() File "/home/tristan/.local/lib/python3.5/site-packages/urllib3/response.py", line 701, in _update_chunk_length raise httplib.IncompleteRead(line) http.client.IncompleteRead: IncompleteRead(0 bytes read) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/tristan/.local/lib/python3.5/site-packages/requests/models.py", line 751, in generate for chunk in self.raw.stream(chunk_size, decode_content=True): File "/home/tristan/.local/lib/python3.5/site-packages/urllib3/response.py", line 572, in stream for line in self.read_chunked(amt, decode_content=decode_content): File "/home/tristan/.local/lib/python3.5/site-packages/urllib3/response.py", line 793, in read_chunked self._original_response.close() File "/usr/lib/python3.5/contextlib.py", line 77, in __exit__ self.gen.throw(type, value, traceback) File "/home/tristan/.local/lib/python3.5/site-packages/urllib3/response.py", line 455, in _error_catcher raise ProtocolError("Connection broken: %r" % e, e) urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read)) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/bin/kijiji", line 11, in <module> load_entry_point('kijiji-scraper==3.0.1', 'console_scripts', 'kijiji')() File "/usr/local/lib/python3.5/dist-packages/kijiji_scraper-3.0.1-py3.5.egg/kijiji_scraper/launcher.py", line 92, in main ads, email_title = kijiji_scraper.scrape_kijiji_for_ads(url) File "/usr/local/lib/python3.5/dist-packages/kijiji_scraper-3.0.1-py3.5.egg/kijiji_scraper/kijiji_scraper.py", line 52, in scrape_kijiji_for_ads page = requests.get(url) File "/home/tristan/.local/lib/python3.5/site-packages/requests/api.py", line 76, in get return request('get', url, params=params, **kwargs) File "/home/tristan/.local/lib/python3.5/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "/home/tristan/.local/lib/python3.5/site-packages/requests/sessions.py", line 530, in request resp = self.send(prep, **send_kwargs) File "/home/tristan/.local/lib/python3.5/site-packages/requests/sessions.py", line 683, in send r.content File "/home/tristan/.local/lib/python3.5/site-packages/requests/models.py", line 829, in content self._content = b''.join(self.iter_content(CONTENT_CHUNK_SIZE)) or b'' File "/home/tristan/.local/lib/python3.5/site-packages/requests/models.py", line 754, in generate raise ChunkedEncodingError(e) requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
Let's not that I'm using python 3.5, what version are you using @dennistsc ?
Reading this ticket: psf/requests#4771
It looks like this error typically comes from the server.
I'm not experiencing this issue anymore.
Looks like Kijiji got their hack together and solved it.
Edit: I spoke too fast, I'm still receiving error emails...