PayloadTooLargeError: request entity too large
-
Hi,
I am getting the below error when I try to generate a report of large sized data even after setting the "inputRequestLimit" : "200mb" in config file.Error is:
"Error during processing request at http://localhost:5488/api/report, details: Input request
reached limit of 20971520 byte(s), current size: 24137543 byte(s). The limit can be increased using config extensions.expres
s.inputRequestLimit=50mb. request entity too large, stack: PayloadTooLargeError: request entity too large"Please help me to resolve this issue at my end.
-
hi! please show how your configuration file looks like, maybe you are configuring it in wrong way
-
Here is my config file entries:
{
"httpPort": 5488,
"allowLocalFilesAccess": true,
"store": {
"provider": "fs"
},
"blobStorage": {
"provider": "fs"
},
"licenseKey": "",
"templatingEngines": {
"timeout": 20000
},
"chrome": {
"strategy": "dedicated-process",
"timeout": 60000
},
"phantom": {
"strategy": "dedicated-process",
"timeout": 60000
},
"extensions": {
"authentication": {
"cookieSession": {
"secret": "<your strong secret>"
},
"admin": {
"username": "admin",
"password": "password"
},
"enabled": false
},
"sample-template": {
"createSamples": true
},
"tasks": {
"strategy": "http-server",
"numberOfWorkers": 10,
"timeout": 1250000,
"allowedModules": []
},
"scripts": {
"allowedModules": ["request"],
"timeout": 1250000
},
"assets": {
"allowedFiles": "static/**.css",
"searchOnDiskIfNotFoundInStore": false,
"rootUrlForLinks": "http://localhost:5488",
"publicAccessEnabled": true
},
"express": {
"InputRequestLimit": "200mb"
}
}
}
-
the shape of your configuration looks good, but the configuration is called
inputRequestLimit
notInputRequestLimit
(you are using uppercase in the first character)another mistake in your config is that this part does not do anything:
"tasks": { "strategy": "http-server", "numberOfWorkers": 10, "timeout": 1250000, "allowedModules": [] }
in jsreport v2
tasks
has been renamed totemplatingEngines
, so you can move all the options that you have intasks
intotemplatingEngines
-
Thank you for your comments. I did not notice that it is in upper case in the first character.
Also I have moved all the attributes from tasks to templatingEngines and removed tasks attribute.
It works now.