Data payload too big error

I started seeing new errors, that I’ve never seen before.

anvil.server.RuntimeUnavailableError: Data payload too big - please use Media objects to transfer large amounts of data.

Could this be connected to some sort of limits? What are the limits on these data payloads?

I was getting these errors when using:

app_tables.table_name.search()

Solution: I mitigated these errors somewhat by using q.fetch_only()

Problem: I was storing large amount of data as Simple Objects in the database rows, and every time I queried the database it fetched these large Simple Objects (JSON). So it seems that the fix is to limit what is fetched from the db.

Read the docs here:

Hope this helps if anyone encounters similar errors.

P.S. I have accelerated tables enabled so it might be connected to the issue.

It would be nice to know what are the limits of Data payload, so that we could estimate if the size is too large.
@meredydd

1 Like

This was the answer in 2018, but I am unsure if it was increased since then:

So it seems like it is possible to store larger than 4MB objects in the database, constructed entirely from within server modules, however you will not be able to send them anywhere outside of the server module without converting them to a media object or doing some kind of processing to get smaller results.

(You can probably convert them to a json bytes string, attach it to a media object, and then send that, reconstructing it on the other side of the call)

1 Like

Thank you @ianb

Your answer (and links) completely answer my question.

I will leave some links here if anyone else also encounter this problem.

Limits:

Solution