pool-reference icon indicating copy to clipboard operation
pool-reference copied to clipboard

[Error] Request Entity Too Large

Open nicezic opened this issue 4 years ago • 11 comments

I got an error below in testnet, 1.2.3.

ERROR:root:Unexpected error in collect_pool_rewards_loop: 413, message='Request Entity Too Large', url=URL('https://localhost:8555/push_tx') Traceback (most recent call last):
  File "/home/chia/testnet/pool-reference/pool/pool.py", line 332, in collect_pool_rewards_loop
    push_tx_response: Dict = await self.node_rpc_client.push_tx(spend_bundle)
  File "/home/chia/testnet/pool-reference/venv/lib/python3.8/site-packages/chia/rpc/full_node_rpc_client.py", line 162, in push_tx
    return await self.fetch("push_tx", {"spend_bundle": spend_bundle.to_json_dict()})
  File "/home/chia/testnet/pool-reference/venv/lib/python3.8/site-packages/chia/rpc/rpc_client.py", line 42, in fetch
    response.raise_for_status()
  File "/home/chia/testnet/pool-reference/venv/lib/python3.8/site-packages/aiohttp/client_reqrep.py", line 1000, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 413, message='Request Entity Too Large', url=URL('https://localhost:8555/push_tx')

I think this is because my pool server has offline long time for about 4 days.

Does the HTTP server need to fix this problem? I think it is related to the upload size.

nicezic avatar Aug 02 '21 06:08 nicezic

I see it in create_absorb_transaction in singleton.py.

# TODO(pool): handle the case where the cost exceeds the size of the block

nicezic avatar Aug 02 '21 13:08 nicezic

Looking into this

jack60612 avatar Aug 25 '21 19:08 jack60612

Have you guys figured out the root cause or a fix?

mariano54 avatar Sep 15 '21 16:09 mariano54

How many payments are you making at once?

mariano54 avatar Sep 17 '21 22:09 mariano54

How many payments are you making at once?

It's on the testnet7. Farming is about... 12TB. problem is when the pool server closed for a few days, and started. After started, it can not get any rewards from mainnet.

nicezic avatar Sep 23 '21 03:09 nicezic

@mariano54

There are too many records get_coin_records_by_puzzle_hashes. I think that is the root cause.

in pool.py

                coin_records: List[CoinRecord] = await self.node_rpc_client.get_coin_records_by_puzzle_hashes(
                    scan_phs,
                    include_spent_coins=False,
                    start_height=self.scan_start_height,
                )

nicezic avatar Sep 23 '21 07:09 nicezic

maybe chunking coin_records list is a workaround, but I am not sure about other async loops relations.

def list_chunk(lst, n):
    return [lst[i:i+n] for i in range(0, len(lst), n)]
                coin_records_chunked = list_chunk(coin_records, 100)
                coin_records_chunked_count = len(coin_records_chunked)
                for idx, a_coin_records in enumerate(coin_records_chunked):

nicezic avatar Sep 23 '21 08:09 nicezic

Yes, get_coin_records_by_puzzle_hashes takes in start_height and end_height, you can use that.

mariano54 avatar Sep 29 '21 21:09 mariano54

Yes, get_coin_records_by_puzzle_hashes takes in start_height and end_height, you can use that.

I hope you guys can use this approach.

nicezic avatar Oct 01 '21 04:10 nicezic

Was this issue solved?

jack60612 avatar Jul 03 '22 17:07 jack60612

Or is it now a feature request?

jack60612 avatar Jul 03 '22 17:07 jack60612