Back

413 Large Payload in functions error

  • 0
  • Functions
  • Web
  • Cloud
Soumitra Chakraborty
26 Oct, 2023, 04:09

yes cloud functions, how to fix

TL;DR
User is experiencing a 413 Large Payload error while using functions in their React-based app. They are unsure of the limit and how to handle processing a list of 10k users. Suggestions are to minimize the function's runtime and reduce the amount of data being sent. They also ask about the size of the JSON payload and if it would be better to process it chunk by chunk. Another mention is sending SMS with appwrite functions. Solution: To fix the error, it is recommended to break down the data and process it chunk by chunk instead of sending a large JSON body.
Drake
26 Oct, 2023, 04:09

don't send that much data

Soumitra Chakraborty
26 Oct, 2023, 04:10

Suppose I have a database to work with and I need to process thois econtacts via functions. Any idea?

Soumitra Chakraborty
26 Oct, 2023, 04:10

*contacts

Drake
26 Oct, 2023, 04:11

if you need to send something that large, it should be a file and not trying to upload a gigantic JSON body.

however, a better approach would be to break it down and process it chunk by chunk

Soumitra Chakraborty
26 Oct, 2023, 04:12

ok I ma getting this error while sending 3k objects

Soumitra Chakraborty
26 Oct, 2023, 04:12

Thanks I will try that

Drake
26 Oct, 2023, 04:12

how big is the actual JSON payload?

Soumitra Chakraborty
26 Oct, 2023, 04:15

vary based on filter in custom databse

Soumitra Chakraborty
26 Oct, 2023, 04:15

can be from 3k -20k

Drake
26 Oct, 2023, 04:16

Are you saying that many objects or that many bytes?

Soumitra Chakraborty
26 Oct, 2023, 04:16

We will be sending some sms with appwrite functions

Soumitra Chakraborty
26 Oct, 2023, 04:16

objects

Soumitra Chakraborty
26 Oct, 2023, 04:16

one customer 1 obj

Drake
26 Oct, 2023, 04:17

I'm asking for bytes

Soumitra Chakraborty
26 Oct, 2023, 04:17

That has to be checked

Soumitra Chakraborty
26 Oct, 2023, 04:17

whats the limit?

Drake
26 Oct, 2023, 04:17

honestly i don't even know what's returning that 413

Drake
26 Oct, 2023, 04:18

regardless, you really should be sending less data and doing less work

Drake
26 Oct, 2023, 04:19

it's best to have functions finish as quick as possible

Drake
26 Oct, 2023, 04:19

the longer you have functions running, the more likely something wrong can happen

Soumitra Chakraborty
26 Oct, 2023, 04:29

ok suppose I have a list of 10k users can I fetch those directly in functions and in loop process?

Soumitra Chakraborty
26 Oct, 2023, 04:30

My app is react based app and I want to handle the processing of users through functions

Soumitra Chakraborty
26 Oct, 2023, 04:30

I am using functions like rest api

Drake
26 Oct, 2023, 04:49

sure...but i would try to minimize how long the function runs per execution

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more