Failed to load resource: the server responded with a status of 413 (Payload Too Large)

Feature(s) impacted

Smart Action

Observed behavior

We have a smart action to upload a document which is behind a request approval workflow when we go to trigger the action we get an error of “You don’t have the right to trigger this action anymore.” And if I check my console I’m getting an error of the Payload Too Large.

But when I remove it from the request approval workflow and make it so the smart action just triggers the request goes through, which makes me think it’s not related to the file size but some error on the request-approval side.

As on Forest Admin and on our server we have the file size limit to be 20mb and the file that we’re currently uploading is 4mb

Expected behavior

For the smart action to execute successfully and go to the request approval workflow

Failure Logs


Context

  • Project name: Ourboro
  • Team name: Customer Experience
  • Environment name: Production or Development
  • Agent type & version: …
  • Recent changes made on your end if any: …

Hi @Zero :wave:

We are on the subject to tackle the issue.
We will let you know when it will be released.

Best regards,

Shohan

Great thank you, do you think this will be for today? just need to plan with my team and do a work around if that’s not the case

Hi @Zero

As we have no storage of our own on the agents side (and obviously can’t create tables on your database), approval workflow works the following way:

  • When the approval request is submitted, the content of the smart action form is saved in our servers
  • When an authorized user accepts the approval request, the frontend downloads the content of the form from our servers, and replays it to your agent (the approver is the one submitting the smart action).

The issue that you are having is that the initial form submission is larger than the max body size in our server.

I asked the performance team, and wrote a PR to increase that limit to 20mb on our side, but I’m still waiting for my coworkers to review and merge it.

It should be done tomorrow

I just merged the PR.

It should be live in less than 10min

@Zero the fix is live now!
Please let us know if everything is working as expected on your side.
Thanks!

Hi,

I want to see if we can re-open this back up as the same issue is happening again for us we’re uploading a 6.8MB PDF and when we go to approve the action we’re getting the 413 payload too large error.

And if I do it without the approval workflow it goes through normally

Hi @Zero,

Very sorry to hear that.
Did you recently upgraded your agent version? If so, could you try to revert to your previous version?

In the meantime, we will dig into the latest changes made on the platform.
Do you have an idea of the moment when it started to break yesterday?

Thanks a lot for your help.

We’re on sequelize 8.5.14 and it’s been working ok in the past it’s happened before but your team mentioned it was a bug and fixed it. So not sure if it’s come back again

Hi @Zero ,

Are you using hooks for this smart action ?

Yes I am, the hooks hit an external API to fetch a document URL

Hi @Zero ,

I am sorry for the late answer.
The explanation for your 413 is probably normal because of the following processes:

  • When using a form with hooks, all fields are sent x2 times to have the precedent values and the new ones.
  • When using a file, it is sent in format base64, so the size of the image in the payload will be x (4/3).
  • And obviously, the payload will take into account all the fields from the form.

With these, I think that with a 6.8Mb image X (4/3) X 2 + other fields x 2, it could reach a payload of 20Mb and sending you a 413 payload too large.
Unfortunately, we will not increase this size limit.

Once again, our apologies for the late answer.

Best regards,

Shohan

Hi,

So what can I do in this case? If you’re not increasing the payload size

Hi @Zero ,

My apologies for the late answer.

Unfortunately, the approval system with upload of files is not well supported. If you need this size of file, you will have to deactivate the approval system.

Best regards,

Shohan