# ResourceExhausted error

**URL:** <https://forum.flow.com/t/resourceexhausted-error/2885>\
**Category:** ⚙️ Flow SDKs\
**Created:** [March 4, 2022, 10:40pm UTC](https://forum.flow.com/t/resourceexhausted-error/2885 "2022-03-04T22:40:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cat\_in\_queen\_village](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@Cat\_in\_queen\_village](https://forum.flow.com/u/Cat_in_queen_village)\
**Post date:** [March 4, 2022, 10:40pm UTC](https://forum.flow.com/t/resourceexhausted-error/2885/1 "2022-03-04T22:40:05Z")

</div>

Hello everyone. I was trying to pull all the moment minted events from the access node by looping through all the block height range. However I got this error message:

panic: client: rpc error: code = ResourceExhausted desc = grpc: received message larger than max (4577912 vs. 4194304)

Any idea how to fix it? Thank you!

---

<div class="post-metadata">

**Author:** ![andrea](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/andrea/32/607_2.png) [@andrea](https://forum.flow.com/u/andrea)\
**Post date:** [March 8, 2022, 3:43pm UTC](https://forum.flow.com/t/resourceexhausted-error/2885/2 "2022-03-08T15:43:22Z")

</div>

Hi! If you want to query a large amount of events your best bet is to use an event indexer like:

- Graffle ([https://docs.graffle.io/event-indexers](https://docs.graffle.io/event-indexers)) ,
- Alchemy ([https://docs.alchemy.com/flow/documentation/flow-api#geteventsforblockids](https://docs.alchemy.com/flow/documentation/flow-api#geteventsforblockids)) or

In regards to your specific error, if you are using the CLI’s `flow events get <eventId>` command, keep in mind that the access nodes have a rate limit of ~2k/s. Is your call rate close to that? Due to load balancing, you might get the error a bit sooner
