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

[Error] Request Entity Too Large #225

Open
nicezic opened this issue Aug 2, 2021 · 11 comments
Open

[Error] Request Entity Too Large #225

nicezic opened this issue Aug 2, 2021 · 11 comments
Labels
bug Something isn't working

Comments

@nicezic
Copy link

nicezic commented Aug 2, 2021

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
Copy link
Author

nicezic commented Aug 2, 2021

I see it in create_absorb_transaction in singleton.py.

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

@jack60612
Copy link
Contributor

Looking into this

@mariano54
Copy link
Contributor

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

@mariano54
Copy link
Contributor

How many payments are you making at once?

@mariano54 mariano54 added the bug Something isn't working label Sep 21, 2021
@nicezic
Copy link
Author

nicezic commented Sep 23, 2021

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
Copy link
Author

nicezic commented Sep 23, 2021

@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
Copy link
Author

nicezic commented Sep 23, 2021

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):

@mariano54
Copy link
Contributor

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

@nicezic
Copy link
Author

nicezic commented Oct 1, 2021

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.

@jack60612
Copy link
Contributor

Was this issue solved?

@jack60612
Copy link
Contributor

Or is it now a feature request?

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

3 participants