Request failed With Status code 413

Question:
How to resolve the Request failed With Status code 413 error

Product:
Wix Editor,

What are you trying to achieve:
To avoid reaching the limit of 14 seconds of requests in the back-end, I built a method that returns the result of the query to the client.

If it is smaller and there are more records, it enters a while loop until the total number of records is complete.


image

What have you already tried:
Currently I have already created logic to go to the back-end and fetch the necessary data, if there is a timeout error it will try again. I also built a function called searchData on the client, which is responsible for calling the query in the back and bringing all the data until the overall data total is finalized.

The “Search” function is responsible for performing a query on the backend and returning the data.

And the fetchData function only processes the object for return to the front.

Additional information:
The error occurs after reaching skip 6500, totaling 13 requests to the back-end. After reaching this number, I got the Request failed With Status code 413 error.

Could you help me with this? How to solve ?
Improvement? Alternative?

That status code means your request is too large, it is not about the amount of requests to the backend.

I am not sure exactly which part of your response is causing this, but hopefully that information will help you debug more successfully.

If you do not find a path forward you may need to reach out to customer care for options if you are running into a compute limit and cannot break up the size in some way

1 Like

Thank you very much Amandam, your suggestion was extremely important in finding the cause of the error.

The error was because I was returning a very large volume of data to the server, which resulted in the request being blocked.

To solve it, I brought the function that handled the array of objects to the client, and everything started working normally again.

Thank you in advance for the tip. Hugs!

1 Like

So glad that worked out! A tip to help future debugging, out HTTP status codes are not specific to Wix they are the same as the regular standard so when. you face a code like 413, 423, etc you can search to see what the term means. How you need to handle on Wix can vary depending on the situation, but it’s a good place to start!

1 Like