Json data size limit?



  • Hello,

    is there a limit in size data of Json files?
    I have a large document of 5.8 MB and I give a 413 error "request entity too large".

    Thank you
    Daniele


  • administrators

    hi! yes, there is a limit for the express routes that receive input but by default it is 50mb.

    what is the action that throw this error? did you created a data entity and the error shows on save? can you show the full stack trace (probably visible on the console)?



  • I have a feeling this was nginx limit. Don't you use a webserver that just needs a proper config?



  • I think that it's a nginx limit. Please show attached screenshot.
    The error message appears when I click on "Save" button.

    Thank you for your help.
    0_1657185461431_jsreport.jpg



  • Yes, so you need to properly configure nginx. The request doesn't even reach jsreport...



  • But it seems that the nginx problem is on jsreportonline.net domain, right?
    So I think that I have nothing to do about that...
    Thank you
    Daniele



  • Ah I see, you use the jsreportonline.
    Yes, unfortunately, there is this limit and you can't change it.
    We will consider increasing it, but at this moment you can't save an entity bigger than 5mb.

    These are your input data, right? You can still send them from the client or postman, but you won't be able to save them in studio.



  • Hello,

    here you can see my code snippet.

    The 5 MB nginx limit will occurs even in this case?
    If so, how can I do to print this document?
    Thank you

    var paramsForRequest = {
        followRedirects: true,
        npmRequestOptions: {
            encoding: encoding ? encoding : null
        },
        headers:
        {
            'cache-control': 'no-cache',
            'authorization': reportEngine.authorization,
            'content-type': 'application/json'
        },
        data: {
            data: {},     // json data 5.8 MB
            template: {}  // jsreport template ref
        }
    };
    
    try {
        var res = HTTP.post(
            reportEngine.url, // https://techmakers.jsreportonline.net
            paramsForRequest
        );
        
        ...
    }
    


  • The limit 5mb is just for saving entities.
    Such render request as you have should work.

    However the url should be https://techmakers.jsreportonline.net/api/report



  • I tried to do some modifications but still I can't print this large json file.

    I use the asynchronous version of your library.

    Now the 5.8 MB file is compressed (removing all spaces) in 3.4 MB but I have a 504 error.

    Here some snippets of the HAR file:

    "bodySize": 3403549

    {
    "_initiator": {
    "type": "preflight",
    "url": "https://techmakers.jsreportonline.net/api/report"
    },
    "_priority": "High",
    "_resourceType": "preflight",
    "cache": {},
    "connection": "203421",
    "pageref": "page_2",
    "request": {
    "method": "OPTIONS",
    "url": "https://techmakers.jsreportonline.net/api/report",
    "httpVersion": "http/2.0",
    "headers": [
    {
    "name": ":authority",
    "value": "techmakers.jsreportonline.net"
    },
    {
    "name": ":method",
    "value": "OPTIONS"
    },
    {
    "name": ":path",
    "value": "/api/report"
    },
    {
    "name": ":scheme",
    "value": "https"
    },
    {
    "name": "accept",
    "value": "/"
    },
    {
    "name": "accept-encoding",
    "value": "gzip, deflate, br"
    },
    {
    "name": "accept-language",
    "value": "it-IT,it;q=0.9,en-US;q=0.8,en;q=0.7"
    },
    {
    "name": "access-control-request-headers",
    "value": "authorization,content-type"
    },
    {
    "name": "access-control-request-method",
    "value": "POST"
    },
    {
    "name": "origin",
    "value": "https://test.documaker.it"
    },
    {
    "name": "referer",
    "value": "https://test.documaker.it/"
    },
    {
    "name": "sec-fetch-dest",
    "value": "empty"
    },
    {
    "name": "sec-fetch-mode",
    "value": "cors"
    },
    {
    "name": "sec-fetch-site",
    "value": "cross-site"
    },
    {
    "name": "user-agent",
    "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"
    }
    ],
    "queryString": [],
    "cookies": [],
    "headersSize": -1,
    "bodySize": 0
    }

    "response": {
    "status": 504,
    "statusText": "",
    "httpVersion": "",
    "headers": [
    {
    "name": "content-length",
    "value": "534"
    },
    {
    "name": "content-type",
    "value": "text/html"
    },
    {
    "name": "date",
    "value": "Thu, 28 Jul 2022 14:12:00 GMT"
    },
    {
    "name": "server",
    "value": "awselb/2.0"
    }
    ],
    "cookies": [],
    "content": {
    "size": 0,
    "mimeType": "x-unknown"
    },
    "redirectURL": "",
    "headersSize": -1,
    "bodySize": -1,
    "_transferSize": 0,
    "_error": "net::ERR_FAILED"
    }

    Please, may I send you the HAR file so you can check where is the problem?

    Thank you very much.



  • Yes please email it to me jan.blaha@jsreport.net


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.