Request Limit Property without config file



  • Hello!

    We are running JSreports in visual studio, via the binaries. We're running into this error:

    {"originalError":{"remoteStack":"Error: request entity too large\n at readStream

    We do not have a configuration file, so as you would imagine, setting the express.inputRequestLimitProperty isn't an option.

    Currently, we start our service with the following line of code:

            JSReport.Service= new LocalReporting()
                .KillRunningJsReportProcesses()
                .UseBinary(JsReportBinary.GetBinary())
                .RunInDirectory(Path.Combine(AppDomain.CurrentDomain.BaseDirectory + Path.DirectorySeparatorChar.ToString() + @"bin", "jsreport"))
                .Configure(cfg => cfg.AllowLocalFilesAccess().FileSystemStore().BaseUrlAsWorkingDirectory())
                .AsUtility()
                .Create();
    

    Is there any way to increase the limit with our set up?

    Thank you!



  • I've add support for it here.
    Please update the jsreport.Local to 1.10.1 and use something like

     .Configure(cfg => { 
         cfg.AllowLocalFilesAccess().FileSystemStore().BaseUrlAsWorkingDirectory();
         cfg.Express = new ExpressConfiguration() { InputRequestLimit = "50mb" }
         return cfg;
     })
    

    Give it few minutes for CI to publish the nuget update...



  • Once again, thank you so much! Your help is very much appreciated.



  • We've installed the new package through NuGet package manager, and are now receiving this error:

    instance has been daemonized and initialized successfully (pid: 28216)rendering has finished with errors:Error: An error occurred while trying to execute the command: at onCriticalError ([eval]:29603:25) at [eval]:29558:13 at tryCatcher ([eval]:36038:23) at Promise.settlePromiseFromHandler ([eval]:34061:31) at Promise.settlePromise ([eval]:34118:18) at Promise.settlePromise0 ([eval]:34163:10) at Promise.settlePromises ([eval]:34238:18) at Async.drainQueue ([eval]:31008:16) at Async.drainQueues ([eval]:31018:10) at Immediate.Async.drainQueues [as onImmediate] ([eval]:30892:14) at processImmediate [as immediateCallback] (timers.js:396:17) {"originalError":{"code":"ECONNRESET","errno":"ECONNRESET","syscall":"read"}}(Original) Error: read ECONNRESET at exports._errnoException (util.js:907:11) at TCP.onread (net.js:558:26) {"code":"ECONNRESET","errno":"ECONNRESET","syscall":"read"}

    And, this is our configuration:

    JSReport.Service = new LocalReporting()
    .KillRunningJsReportProcesses()
    .UseBinary(JsReportBinary.GetBinary())
    .RunInDirectory(Path.Combine(AppDomain.CurrentDomain.BaseDirectory + Path.DirectorySeparatorChar.ToString() + @"bin", "jsreport"))
    .Configure(cfg =>
    {
    cfg.AllowLocalFilesAccess().FileSystemStore().BaseUrlAsWorkingDirectory();
    cfg.Express = new ExpressConfiguration() { InputRequestLimit = "50mb" };
    return cfg;
    })
    .AsUtility()
    .AsWebServer()
    .Create();

    We haven't changed anything else, so we were wondering if the error might be related.

    Thanks!



  • I did check the InputRequestLimit configuration and it works for me fine.
    Does this fail only for big reports?
    If yes, can you check the memory consumption?
    It can be problem with node memory.


Log in to reply
 

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