Closed
Description
I am running archive node and when I try to use python requests library (or curl
from shell) I get IncompleteRead
for some transactions
relevant python code:
headers = {'accept': 'application/json', 'content-type': 'application/json'}
payload = {"jsonrpc": "2.0", "method": "debug_traceTransaction",
"params": [tx.hex()], "id": 83}
result = requests.post('http://127.0.0.1:10010', headers=headers, json=payload)
json_output = result.json()
and the result:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/urllib3/response.py", line 443, in _error_catcher
yield
File "/usr/local/lib/python3.9/site-packages/urllib3/response.py", line 818, in read_chunked
chunk = self._handle_chunk(amt)
File "/usr/local/lib/python3.9/site-packages/urllib3/response.py", line 771, in _handle_chunk
returned_chunk = self._fp._safe_read(self.chunk_left)
File "/usr/lib64/python3.9/http/client.py", line 628, in _safe_read
raise IncompleteRead(b''.join(s), amt)
http.client.IncompleteRead: IncompleteRead(6 bytes read, 2042 more expected)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 816, in generate
yield from self.raw.stream(chunk_size, decode_content=True)
File "/usr/local/lib/python3.9/site-packages/urllib3/response.py", line 623, in stream
for line in self.read_chunked(amt, decode_content=decode_content):
File "/usr/local/lib/python3.9/site-packages/urllib3/response.py", line 844, in read_chunked
self._original_response.close()
File "/usr/lib64/python3.9/contextlib.py", line 137, in __exit__
self.gen.throw(typ, value, traceback)
File "/usr/local/lib/python3.9/site-packages/urllib3/response.py", line 460, in _error_catcher
raise ProtocolError("Connection broken: %r" % e, e)
urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(6 bytes read, 2042 more expected)', IncompleteRead(6 bytes read, 2042 more expected))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/eth_tx_status/main.py", line 66, in <module>
result = requests.post('http://127.0.0.1:10010', headers=headers, json=payload)
File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 115, in post
return request("post", url, data=data, json=json, **kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 745, in send
r.content
File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 899, in content
self._content = b"".join(self.iter_content(CONTENT_CHUNK_SIZE)) or b""
File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 818, in generate
raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(6 bytes read, 2042 more expected)', IncompleteRead(6 bytes read, 2042 more expected))
using curl:
curl -H "Content-Type: application/json"--data '{"jsonrpc":"2.0","method":"debug_traceTransaction","params":["0xaa91b9638522c8a7686fc97ef4e5bec00b74b860a7e426825a49460ed025edab"],"id":83}' --url 127.0.0.1:10010
and the result:
<ommiting part of the response>
...
:"0000000000000000000000000000000000000000000000000000000000090009","9cbd36e402b21614adfadf3a9bb80b88c8ea865f2a07128c87e2fbf4c217d49f":"0000000000000000000000000000000000000000000000000000000000090008","9cbd36ecurl: (18) transfer closed with outstanding read data remaining