blockchain-etl / ethereum-etl

Python scripts for ETL (extract, transform and load) jobs for Ethereum blocks, transactions, ERC20 / ERC721 tokens, transfers, receipts, logs, contracts, internal transactions. Data is available in Google BigQuery https://goo.gl/oY5BCQ
https://t.me/BlockchainETL
MIT License
2.95k stars 845 forks source link

BatchWorkExecutor [ERROR] An exception occurred while executing work_handler. #235

Open HaveYouTall opened 3 years ago

HaveYouTall commented 3 years ago

When I used the command

$ ethereumetl export_blocks_and_transactions --start-block 5000000 --end-block 10000000 \
--provider-uri file:///************/ethereum/eth-mainnet-data/fast-dataset/geth.ipc \
--blocks-output blocks.csv --transactions-output transactions.csv

It shows me the following output

Symbolic Execution not available: No module named 'mythril.ether'
2021-01-18 03:50:28,389 - ProgressLogger [INFO] - Started work. Items to process: 5000001.
2021-01-18 03:51:28,427 - BatchWorkExecutor [ERROR] - An exception occurred while executing work_handler.
Traceback (most recent call last):
  File "/home/hyt/.local/lib/python3.7/site-packages/ethereumetl/providers/ipc.py", line 58, in make_batch_request
    raw_response += sock.recv(4096)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/hyt/.local/lib/python3.7/site-packages/ethereumetl/executors/batch_work_executor.py", line 63, in _fail_safe_execute
    work_handler(batch)
  File "/home/hyt/.local/lib/python3.7/site-packages/ethereumetl/jobs/export_blocks_job.py", line 75, in _export_batch
    response = self.batch_web3_provider.make_batch_request(json.dumps(blocks_rpc))
  File "/home/hyt/.local/lib/python3.7/site-packages/ethereumetl/providers/ipc.py", line 60, in make_batch_request
    timeout.sleep(0)
  File "/home/hyt/.local/lib/python3.7/site-packages/web3/utils/threads.py", line 68, in sleep
    self.check()
  File "/home/hyt/.local/lib/python3.7/site-packages/web3/utils/threads.py", line 61, in check
    raise self
web3.utils.threads.Timeout: 60 seconds
2021-01-18 03:51:28,429 - BatchWorkExecutor [ERROR] - An exception occurred while executing work_handler.
Traceback (most recent call last):
  File "/home/hyt/.local/lib/python3.7/site-packages/ethereumetl/providers/ipc.py", line 58, in make_batch_request
    raw_response += sock.recv(4096)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/hyt/.local/lib/python3.7/site-packages/ethereumetl/executors/batch_work_executor.py", line 63, in _fail_safe_execute
    work_handler(batch)
  File "/home/hyt/.local/lib/python3.7/site-packages/ethereumetl/jobs/export_blocks_job.py", line 75, in _export_batch
    response = self.batch_web3_provider.make_batch_request(json.dumps(blocks_rpc))
  File "/home/hyt/.local/lib/python3.7/site-packages/ethereumetl/providers/ipc.py", line 60, in make_batch_request
    timeout.sleep(0)
  File "/home/hyt/.local/lib/python3.7/site-packages/web3/utils/threads.py", line 68, in sleep
    self.check()
  File "/home/hyt/.local/lib/python3.7/site-packages/web3/utils/threads.py", line 61, in check
    raise self
web3.utils.threads.Timeout: 60 seconds
2021-01-18 03:51:28,435 - BatchWorkExecutor [INFO] - Reducing batch size to 50.
2021-01-18 03:51:28,439 - BatchWorkExecutor [INFO] - Reducing batch size to 50.
2021-01-18 03:51:28,441 - BatchWorkExecutor [INFO] - The batch of size 100 will be retried one item at a time.
2021-01-18 03:51:28,442 - BatchWorkExecutor [INFO] - The batch of size 100 will be retried one item at a time.
2021-01-18 03:51:28,479 - BatchWorkExecutor [ERROR] - An exception occurred while executing work_handler.
Traceback (most recent call last):
  File "/home/hyt/.local/lib/python3.7/site-packages/ethereumetl/providers/ipc.py", line 58, in make_batch_request
    raw_response += sock.recv(4096)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/hyt/.local/lib/python3.7/site-packages/ethereumetl/executors/batch_work_executor.py", line 63, in _fail_safe_execute
    work_handler(batch)
  File "/home/hyt/.local/lib/python3.7/site-packages/ethereumetl/jobs/export_blocks_job.py", line 75, in _export_batch
    response = self.batch_web3_provider.make_batch_request(json.dumps(blocks_rpc))
  File "/home/hyt/.local/lib/python3.7/site-packages/ethereumetl/providers/ipc.py", line 60, in make_batch_request
    timeout.sleep(0)
  File "/home/hyt/.local/lib/python3.7/site-packages/web3/utils/threads.py", line 68, in sleep
    self.check()
  File "/home/hyt/.local/lib/python3.7/site-packages/web3/utils/threads.py", line 61, in check
    raise self
web3.utils.threads.Timeout: 60 seconds
2021-01-18 03:51:28,481 - BatchWorkExecutor [INFO] - The batch of size 100 will be retried one item at a time.
2021-01-18 03:51:28,487 - BatchWorkExecutor [ERROR] - An exception occurred while executing work_handler.

The above output is just one part of the original stuff.

I'm not sure if the error information BatchWorkExecutor [ERROR] - An exception occurred while executing work_handler. really matters. Because when the command finished (though finished with an error message), I got a blocks.csv file and a transactions.csv file exactly and both of the files seem well with the size of 645M and 29G respectively. And even weird that it showed me an error message OSError: [Errno 28] No space left on device in the end, but I'm sure that I got at least 389G free space on my device.

Can anyone help me out! It really confused me! Thanks!

lds229 commented 3 years ago

Same issue here @medvedev1088. In my case, an additional batch can't be processed. I'm stuck with the first 100 000 blocks

vivowa commented 3 years ago

Second that. Any solutions founds?

medvedev1088 commented 3 years ago

The error Timeout: 60 seconds is being automatically retried with a reduced batch size. Does the command finish successfully in the end or with an error code? Of the former than the error messages can be ignored. If the latter we'll need to add a parameter to the command for specifying the timeout.

Alternatively you can try increasing CPU/memory on your Ethereum node.

cs201503 commented 3 years ago

The error Timeout: 60 seconds is being automatically retried with a reduced batch size. Does the command finish successfully in the end or with an error code? Of the former than the error messages can be ignored. If the latter we'll need to add a parameter to the command for specifying the timeout.

Alternatively you can try increasing CPU/memory on your Ethereum node.

@medvedev1088 I have the same error, I tried to reduce the blocks I needed to transfer to csv, the command tried several times automatically, but the same error always appears:

Symbolic Execution not available: No module named 'mythril' pyetherchain not available: No module named 'pyetherchain' 2021-07-26 08:07:35,603 - ProgressLogger [INFO] - Started work. Items to process: 638921. 2021-07-26 08:07:35,606 - BatchWorkExecutor [ERROR] - An exception occurred while executing work_handler. Traceback (most recent call last): File "/home/user/.local/lib/python3.8/site-packages/ethereumetl/executors/batch_work_executor.py", line 63, in _fail_safe_execute work_handler(batch) File "/home/user/.local/lib/python3.8/site-packages/ethereumetl/jobs/export_blocks_job.py", line 75, in _export_batch response = self.batch_web3_provider.make_batch_request(json.dumps(blocks_rpc)) File "/home/user/.local/lib/python3.8/site-packages/ethereumetl/providers/ipc.py", line 46, in make_batch_request with self._lock, self._socket as sock: File "/home/user/.local/lib/python3.8/site-packages/web3/providers/ipc.py", line 46, in enter self.sock = self._open() File "/home/user/.local/lib/python3.8/site-packages/web3/providers/ipc.py", line 59, in _open return get_ipc_socket(self.ipc_path) File "/home/user/.local/lib/python3.8/site-packages/web3/providers/ipc.py", line 30, in get_ipc_socket sock.connect(ipc_path) ConnectionRefusedError: [Errno 111] Connection refused

The command I typed was: "python3 -m ethereumetl export_blocks_and_transactions --start-block 5110000 --end-block 5114862 --provider-uri file://$HOME/.ethereum/geth/chaindata --blocks-output blocks.csv --transactions-output transactions.csv " What should I do to fix it? Thank you!

Franklinliu commented 2 years ago

Do anyone get the solution for that? I still get the issue.

PhaedoLab commented 2 years ago

I reduced the batch-size to 20 and no error occur