Why does File Upload fail on Mac with "413 Request Entity Too Large" but only in Katalon?

I have a script which worked fine months ago. It is a very simple script to:

  1. log into a web service (that part works fine)
  2. click a file browse button (to display the file upload dialog),
  3. wait for me to select a file and click Open.
  4. begin uploading the file (with green progress thermometer) at which point the system fails with the following text showing inside the progress thermometer (which has turned red):
    <html> <head><title>413 Request Entity Too Large</title></head> <body> <center><h1>413 Request Entity Too Large</h1></center> <hr><center>nginx/1.18.0 (Ubuntu)</center> </body> </html> <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page -->

More specifically: The web system begins uploading the file, showing a progress thermometer with green increasing value, but at about the 30% point the thermometer goes red with the above text inside the thermometer.

The two things that changed from before are:
A) I upgraded Katalon Studio from roughly v8.6.5 to v8.6.8 (most recent as of today 2023/09/25)
B) The login process is using a different IP address (web service moved to a new machine) but the login goes fine and the script code after that is unchanged.

More information: The process works if I do it manually. Here is what a successful, manually invoked, run looks like:

Any ideas why Katalon-scripts only cause this failure?


Thanks very much for these responses.

I have been debugging this all day and have more details to narrow down the issue.

  1. If I start a Chrome browser manually and do the test, there is no problem. The upload succeeds.
  2. If I let Katalon Studio run a script to do the exact same set of steps, the “select upload” step fails during upload.
  3. If I use the browser opened by KS and manually try to repeat the same steps (in either the same tab or a new tab), it fails!

So, it seems to me that something about the way the browser is being invoked by KS is causing the problem.

So I got the invocation string as follows, but I don’t see a “message length” parameter.

Manually invoked, the command is (as revealed by chrome://version) :

/Applications/Google Chrome.app/Contents/MacOS/Google Chrome --flag-switches-begin --flag-switches-end --origin-trial-disabled-features=WebGPU --disable-nacl

As invoked by Katalon Studio:

/Applications/Google Chrome.app/Contents/MacOS/Google Chrome --allow-pre-commit-input --disable-background-networking --disable-client-side-phishing-detection --disable-default-apps --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --enable-automation --enable-logging --load-extension=/Applications/Katalon Studio.app/Contents/Eclipse/configuration/resources/extensions/Chrome/Smart Wait --log-level=0 --no-first-run --no-service-autorun --password-store=basic --remote-debugging-port=0 --test-type=webdriver --use-mock-keychain --user-data-dir=/var/folders/rv/2yt8jycd73xb_d28qkrf0hs80000gn/T/.org.chromium.Chromium.p7eVxG --flag-switches-begin --flag-switches-end --disable-nacl data:,

Any ideas as to what part of the above is causing the 413 Request Entity Too Large during file upload?


1 Like

I have no idea.

How to workaround “413 Request Entity Too large”? — Google told me the following link:

Hi @Mark-BC, Maybe roll-back to Release v8.6.5 · katalon-studio/katalon-studio · GitHub and try again. Not the solution but would get you back to testing. Then gradually upgrade to newer versions to see if the failure is due to a Katalon update?

Do you want to check how large in bytes the “Request Entity” was in v8.6.5 and v8.6.6? Does the size changes?

Using BrowserMob Proxy, you can see all the HTTP messages exchanged between browser and HTTP Server.

The BrowserMob Proxy will give you better insight.

I searched for that error a number of different ways, but those all assume a server-level problem. In my case, there is no error when the upload is manually invoked, just when it is invoked by Katalon. So it cannot be a server-level issue. It must be something about how Katalon invokes Chrome. I have updated my original post with extra testing results.

I like this idea but am unclear how to rollback a Katalon Studio install on a Mac. I will investigate. I’ve updated the original question to show that it is definitely how KS is invoking Chrome that is the issue.

The server does not know if the browser was operated manually or was operated by automation tool.

The server responed 200 in a case, and 413 in another case.

Then, I think, you should check what sort of HTTP requests were trasffered from the browser to the server. There must be some difference. Once you got to know the difference, it may give you an insight how Katalon Studio is buggy.

Thanks… this is an interesting suggestion, but will take more time than I have at the moment. As usual, I have to get the testing done ASAP because prior delays have put the project up against an immovable deadline.

Your case looks quite new to this forum. I have never seen a case like this. Investigation would require certain time and efforts involved.

Thanks for your replies. I agree your path will lead to finding the bug in KS, and that will be useful to improve KS, when I have time. I was hoping someone would say “Turn on/off parameter X in KS to change the invocation string”. For this round, I’ll just have to invoke my tests manually. Thanks again.

Hi @Mark-BC, Regarding rolling-back…
You should be able to install Katalon into a second folder and run from there.
E.g., Katalon_v8.6.5.