Big reports does not work on my server



  • Hello,

    I am using this link https://jsreport.net/blog/long-reports to add configurations for my jsreport.

    My license is free and I think that maybe because of that is that when I try to created reports of more than 1MB it is failing. I could not successfully set up the configuration for the logger and I do not know what is happening. I am just getting a 500 error. Another reason may be that I am using configurations of the new version that does not works on mine. I really don't know if there is much difference between v1 and v2 config json. If someone can help me it will be great.

    Specifications:
    jsreport version 1.0.6
    server ec2 with amazon linux 2
    run using docker version 18.06.1-ce
    node version 6.11.4
    recipe: xlsx
    engine: handlebars

    Thanks in advance.
    Best Regards.



  • It would help if you share the logs...

    Here you can find the old version of this blog post which uses v1 configuration.
    https://github.com/jsreport/website/blob/0.1.0/_posts/long-reports.md



  • Hi @jan_blaha thanks for the response, here is the log.

    error: Error during processing request: https://{jsreporturl}/api/report details: Error during rendering report: Timeout error during executing script Error: Timeout error during executing script
    at null._onTimeout (/home/jsreport/node_modules/script-manager/lib/manager-processes.js:67:12)
    at Timer.listOnTimeout (timers.js:92:15)
    From previous event:
    at /home/jsreport/node_modules/jsreport-core/lib/render/render.js:141:54
    at _fulfilled (/home/jsreport/node_modules/listener-collection/node_modules/q/q.js:794:54)
    at self.promiseDispatch.done (/home/jsreport/node_modules/listener-collection/node_modules/q/q.js:823:30)
    at Promise.promise.promiseDispatch (/home/jsreport/node_modules/listener-collection/node_modules/q/q.js:756:13)
    at /home/jsreport/node_modules/listener-collection/node_modules/q/q.js:564:44
    at flush (/home/jsreport/node_modules/listener-collection/node_modules/q/q.js:110:17)



  • Try to increase timeouts for the scripts and templating engines.

    "scripts": {
      "timeout": 1200000  
    },
    "tasks": {
      "timeout": 120000
    }
    


  • @jan_blaha for task I was setting 600000 based on the long reports doc. Is 120000 the maximum for that config?



  • My prod.config.json is:

    {
      "certificate": {
        "key": "certificates/jsreport.net.key",
        "cert": "certificates/jsreport.net.cert"
      },
      "connectionString": {
        "name": "fs"
      },
      "httpsPort": 443,
      "blobStorage": "fileSystem",
      "phantom": {
        "numberOfWorkers": 2,
        "timeout": 600000
      },
      "logger": {
        "file": {
          "transport": "file",
          "level": "info",
          "filename": "logs/reporter.log"
        },
        "error": {
          "transport": "file",
          "level": "error",
          "filename": "logs/error.log"
        }
      },
      "tasks": {
        "numberOfWorkers": 2,
        "timeout": 600000,
        "strategy": "dedicated-process",
        "forkOptions": {
          "execArgv": [
            "--max-old-space-size=4096"
          ]
        }
      },
      "templatingEngines": {
        "numberOfWorkers": 2,
        "timeout": 600000,
        "strategy": "http-server"
      },
      "authentication": {
        "cookieSession": {
          "secret": "{secret}"
        },
        "admin": {
          "username": "{username}",
          "password": "{password}"
        }
      },
      "express": {
        "renderTimeout": 600000,
        "inputRequestLimit": "200mb"
      },
      "scripts": {
        "timeout": 1200000,
        "allowedModules": "*"
      }
    }
    

    Still getting the same error.

    With 100mb for inputRequestLimit before I was getting "request entity too large" for Content bigger than 20mb. It is like it is does not being applied. But other things works like auth.

    When a run or restart the container it inputs info: Initializing jsreport in production mode using configuration file prod.config.json.

    thanks in advance.



  • Hi @jan_blaha,

    Do you have any comments regarding the last input?. We are getting the same error and we improve the helpers functions that we use. Now we process most data on our side because we were doing some calculations with helpers. Since we are doing those in out side before calling de report api we really don't know why scripts are still being a problem for us.

    Thanks,
    Best regards.



  • Can't you update to the latest jsreport version and try it there? Since you have anyway the free license...
    There are improvements for the performance of xlsx.
    Maybe you could try just updating the xlsx recipe, if you don't want to update whole jsreport.
    This version could work for you

    npm i jsreport-xlsx@1.1.1 --save --save-exact
    

    Also please share the logs. From the time when it crashed. Including the rendering start and error. You just provided the exception so far.



  • Hi I upgraded to 2.3.0 the entire jsreport:

    Here is the logs output:

    2019-01-17T19:16:32.463Z - info: Starting rendering request 2 (user: null) requestId=2
    2019-01-17T19:16:32.465Z - info: Rendering template {shortid:41ebdPIJ-8, recipe:xlsx,engine:handlebars}
    2019-01-17T19:16:42.609Z - error: Error when processing render request Error during rendering report: Timeout error during executing script Error: Timeout error during executing script
    at null._onTimeout (/home/jsreport/node_modules/script-manager/lib/manager-processes.js:67:12)
    at Timer.listOnTimeout (timers.js:92:15)
    From previous event:
    at /home/jsreport/node_modules/jsreport-core/lib/render/render.js:141:54
    at _fulfilled (/home/jsreport/node_modules/listener-collection/node_modules/q/q.js:794:54)
    at self.promiseDispatch.done (/home/jsreport/node_modules/listener-collection/node_modules/q/q.js:823:30)
    at Promise.promise.promiseDispatch (/home/jsreport/node_modules/listener-collection/node_modules/q/q.js:756:13)
    at /home/jsreport/node_modules/listener-collection/node_modules/q/q.js:564:44
    at flush (/home/jsreport/node_modules/listener-collection/node_modules/q/q.js:110:17) requestId=2
    2019-01-17T19:16:42.612Z - error: Error during processing request: https://ec2-54-204-166-233.compute-1.amazonaws.com/api/report details: Error during rendering report: Timeout error during executing script Error: Timeout error during executing script
    at null._onTimeout (/home/jsreport/node_modules/script-manager/lib/manager-processes.js:67:12)
    at Timer.listOnTimeout (timers.js:92:15)
    From previous event:
    at /home/jsreport/node_modules/jsreport-core/lib/render/render.js:141:54
    at _fulfilled (/home/jsreport/node_modules/listener-collection/node_modules/q/q.js:794:54)
    at self.promiseDispatch.done (/home/jsreport/node_modules/listener-collection/node_modules/q/q.js:823:30)
    at Promise.promise.promiseDispatch (/home/jsreport/node_modules/listener-collection/node_modules/q/q.js:756:13)
    at /home/jsreport/node_modules/listener-collection/node_modules/q/q.js:564:44
    at flush (/home/jsreport/node_modules/listener-collection/node_modules/q/q.js:110:17)

    Thanks in advance for the help.
    Best Regards.



  • Thank you. I apologize for the delay.
    Great you have the latest jsreport now.

    I see from the logs that the timeout comes after 10s. That is typically default value. Please change this to some big value.

    "templatingEngines": {
        "timeout": 1800000 
    },
    

    If this won't help... How many lines of excel do you produce?
    If the rendering doesn't end after some minutes, it must be really big input.
    Or there can be another error.
    In that case it would help me if you email me the export from jsreport studio and the input data set.
    So I can check it out.

    Thank you


Log in to reply
 

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