A bunch of exceptions jsreport local



  • Hi all,

    so here we were, using the free jsreport local version embedded in our application. For a time it worked great.
    Until we went on our test environment which ran multiple instances of our application.
    We first got an exception that told us that the executable was not a valid executable for this OS.
    A bit of a surprise to us because it was working for another instance on our test server.
    After discovering jsreport had an http port, we configured each instance to have it's own port.
    Now the exception about the OS was gone, but a new exception was logged.
    This time jsreport logged that there was something undefined in the model en that we could not forEach on an undefined object. Made sense at first, until we verified what was send as request model data to jsreport.
    This was all correct, so we could not figure out why it gave us this exception. It worked locally.
    Then we discovered jsreport copies itself to a windows temp directory.
    So we gave every instance it's own temp directory, and now the forEach problem went away.

    Then finally we had again a new exception. This time it complained about a file being in use from C:windows\temp\jsreport\chrome something.
    Now we don't know what to do about this, cause we already configured the temp folder to be in our applications folder\temp
    We see the files being created there, but why also still files in windows\temp is what we don't understand.

    Is there a way to configure the temp folder for chrome?
    We deleted the windows/temp/jsreport directory and now we can render the template again.

    Also, we noticed that when jsreport goes into trial mode, and we bring back the number of templates to five, the forEach error returned. If we begin with an empty temp dir, and also stay on the five templates, then it works again.

    We now have the yearly enterprise license, and we hope anyone could shed some light on the chrome temp files and why they are not being put in our configured temp folder?

    Exception :

    One or more errors occurred. ---> jsreport.Local.JsReportBinaryException: Error rendering report: A critical error occurred while trying to execute the render command: An error occurred while trying to start daemonized process: An error has occurred when trying to initialize jsreport (2). ENOENT: no such file or directory, stat 'C:\work\jsreport\jsreport\node_modules' (1). caused by error (2) -> meta = {"code":"ENOENT"}, stack = Error: at instance.init.then.catch ([eval]:71911:29) at tryCatcher (jsreportRuntime.js:44358:23) at Promise._settlePromiseFromHandler (jsreportRuntime.js:42379:31) at Promise._settlePromise (jsreportRuntime.js:42436:18) at Promise._settlePromise0 (jsreportRuntime.js:42481:10) at Promise._settlePromises (jsreportRuntime.js:42557:18) at _drainQueueStep (jsreportRuntime.js:39272:12) at _drainQueue (jsreportRuntime.js:39265:9) at Async._drainQueues (jsreportRuntime.js:39281:5) at Immediate.Async.drainQueues (jsreportRuntime.js:39151:14) at runCallback (timers.js:794:20) at tryOnImmediate (timers.js:752:5) at processImmediate [as _immediateCallback] (timers.js:729:5)caused by error (1) -> meta = {"cause":{"errno":-4058,"code":"ENOENT","syscall":"stat","path":"C:\work\jsreport\jsreport\node_modules"},"isOperational":true,"errno":-4058,"code":"ENOENT","syscall":"stat","path":"C:\work\jsreport\jsreport\node_modules"}, stack = Error: (1). caused by error (1) -> meta = {"code":"ENOENT"}, stack = Error: at exports.NsSocket.socket.dataOnce ([eval]:72301:25) at exports.NsSocket.listener ([eval]:19019:10) at exports.NsSocket.EventEmitter.emit ([eval]:19107:22) at exports.NsSocket._onData ([eval]:91412:8) at Lazy.<anonymous> ([eval]:73008:13) at Lazy.<anonymous> ([eval]:72990:19) at emitTwo (events.js:126:13) at Lazy.emit (events.js:214:7) at Lazy.<anonymous> ([eval]:72991:22) at emitOne (events.js:116:13) at Lazy.emit (events.js:211:7) at yieldTo ([eval]:73098:18) at Function.<anonymous> ([eval]:73136:27) at Lazy.<anonymous> ([eval]:73104:21) at emitOne (events.js:116:13) at Lazy.emit (events.js:211:7)
    at jsreport.Local.Internal.LocalUtilityReportingService.<RenderAsync>d__10.MoveNext()
    --- End of inner exception stack trace ---
    at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
    at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
    at Diract.Component.JSReportsLocal.RenderLocalReport.RenderReport(String templateName, String customerName, Object modelData, String country, String language, String company, String shipFrom)
    at Diract.Component.JSReportsLocal.LocalJsReportsBusHandler.<Handle>d__4.MoveNext()
    ---> (Inner Exception #0) jsreport.Local.JsReportBinaryException: Error rendering report: A critical error occurred while trying to execute the render command: An error occurred while trying to start daemonized process: An error has occurred when trying to initialize jsreport (2). ENOENT: no such file or directory, stat 'C:\work\jsreport\jsreport\node_modules' (1). caused by error (2) -> meta = {"code":"ENOENT"}, stack = Error: at instance.init.then.catch ([eval]:71911:29) at tryCatcher (jsreportRuntime.js:44358:23) at Promise._settlePromiseFromHandler (jsreportRuntime.js:42379:31) at Promise._settlePromise (jsreportRuntime.js:42436:18) at Promise._settlePromise0 (jsreportRuntime.js:42481:10) at Promise._settlePromises (jsreportRuntime.js:42557:18) at _drainQueueStep (jsreportRuntime.js:39272:12) at _drainQueue (jsreportRuntime.js:39265:9) at Async._drainQueues (jsreportRuntime.js:39281:5) at Immediate.Async.drainQueues (jsreportRuntime.js:39151:14) at runCallback (timers.js:794:20) at tryOnImmediate (timers.js:752:5) at processImmediate [as _immediateCallback] (timers.js:729:5)caused by error (1) -> meta = {"cause":{"errno":-4058,"code":"ENOENT","syscall":"stat","path":"C:\work\jsreport\jsreport\node_modules"},"isOperational":true,"errno":-4058,"code":"ENOENT","syscall":"stat","path":"C:\work\jsreport\jsreport\node_modules"}, stack = Error: (1). caused by error (1) -> meta = {"code":"ENOENT"}, stack = Error: at exports.NsSocket.socket.dataOnce ([eval]:72301:25) at exports.NsSocket.listener ([eval]:19019:10) at exports.NsSocket.EventEmitter.emit ([eval]:19107:22) at exports.NsSocket._onData ([eval]:91412:8) at Lazy.<anonymous> ([eval]:73008:13) at Lazy.<anonymous> ([eval]:72990:19) at emitTwo (events.js:126:13) at Lazy.emit (events.js:214:7) at Lazy.<anonymous> ([eval]:72991:22) at emitOne (events.js:116:13) at Lazy.emit (events.js:211:7) at yieldTo ([eval]:73098:18) at Function.<anonymous> ([eval]:73136:27) at Lazy.<anonymous> ([eval]:73104:21) at emitOne (events.js:116:13) at Lazy.emit (events.js:211:7)
    at jsreport.Local.Internal.LocalUtilityReportingService.<RenderAsync>d__10.MoveNext()<---

    Cheers, and best regards,

    Casper Blokzijl
    Diract-IT



  • Hi,

    | apologize for your troubles. We are looking into the temp directory config issue as you reported.
    We will probably need to release hotfix there, I will come back to you here soon.

    We will also try to document how to run multiple instances of jsreport.Local on the same machine and verify this use case.



  • Hi, thanks for your reply.
    We also have a problem with chrome being in use in this setup. We already have tempdirectory set to our appdirectory, but part of the files go to windows\temp\jsreport. Tried setting the rootpath property in a .sjon config file. But no files arrive in the target folder and rendering won't work without chrome.exe

    One or more errors occurred. ---> jsreport.Local.JsReportBinaryException: Error rendering report: A critical error occurred while trying to execute the render command: An error occurred while trying to start daemonized process: An error has occurred when trying to initialize jsreport (2). EBUSY: resource busy or locked, open 'C:\Windows\TEMP\jsreport\compile\jsreport-2.4.0-H1DuB-TUV\chrome\chrome.exe' (1). caused by error (2) -> meta = {"code":"EBUSY"}, stack = Error: at instance.init.then.catch ([eval]:71911:29) at tryCatcher (jsreportRuntime.js:44358:23) at Promise._settlePromiseFromHandler (jsreportRuntime.js:42379:31) at Promise._settlePromise (jsreportRuntime.js:42436:18) at Promise._settlePromise0 (jsreportRuntime.js:42481:10) at Promise._settlePromises (jsreportRuntime.js:42557:18) at _drainQueueStep (jsreportRuntime.js:39272:12) at _drainQueue (jsreportRuntime.js:39265:9) at Async._drainQueues (jsreportRuntime.js:39281:5) at Immediate.Async.drainQueues (jsreportRuntime.js:39151:14) at runCallback (timers.js:794:20) at tryOnImmediate (timers.js:752:5) at processImmediate [as _immediateCallback] (timers.js:729:5)caused by error (1) -> meta = {"errno":-4082,"code":"EBUSY","syscall":"open","path":"C:\Windows\TEMP\jsreport\compile\jsreport-2.4.0-H1DuB-TUV\chrome\chrome.exe"}, stack = Error: (1). caused by error (1) -> meta = {"code":"EBUSY"}, stack = Error: at exports.NsSocket.socket.dataOnce ([eval]:72301:25) at exports.NsSocket.listener ([eval]:19019:10) at exports.NsSocket.EventEmitter.emit ([eval]:19107:22) at exports.NsSocket._onData ([eval]:91412:8) at Lazy.<anonymous> ([eval]:73008:13) at Lazy.<anonymous> ([eval]:72990:19) at emitTwo (events.js:126:13) at Lazy.emit (events.js:214:7) at Lazy.<anonymous> ([eval]:72991:22) at emitOne (events.js:116:13) at Lazy.emit (events.js:211:7) at yieldTo ([eval]:73098:18) at Function.<anonymous> ([eval]:73136:27) at Lazy.<anonymous> ([eval]:73104:21) at emitOne (events.js:116:13) at Lazy.emit (events.js:211:7)
    at jsreport.Local.Internal.LocalUtilityReportingService.<RenderAsync>d__10.MoveNext()
    --- End of inner exception stack trace ---
    at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
    at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
    at Diract.Component.JSReportsLocal.RenderLocalReport.RenderReport(String templateName, String customerName, Object modelData, String country, String language, String company, String shipFrom)
    at Diract.Component.JSReportsLocal.LocalJsReportsBusHandler.<Handle>d__4.MoveNext()
    ---> (Inner Exception #0) jsreport.Local.JsReportBinaryException: Error rendering report: A critical error occurred while trying to execute the render command: An error occurred while trying to start daemonized process: An error has occurred when trying to initialize jsreport (2). EBUSY: resource busy or locked, open 'C:\Windows\TEMP\jsreport\compile\jsreport-2.4.0-H1DuB-TUV\chrome\chrome.exe' (1). caused by error (2) -> meta = {"code":"EBUSY"}, stack = Error: at instance.init.then.catch ([eval]:71911:29) at tryCatcher (jsreportRuntime.js:44358:23) at Promise._settlePromiseFromHandler (jsreportRuntime.js:42379:31) at Promise._settlePromise (jsreportRuntime.js:42436:18) at Promise._settlePromise0 (jsreportRuntime.js:42481:10) at Promise._settlePromises (jsreportRuntime.js:42557:18) at _drainQueueStep (jsreportRuntime.js:39272:12) at _drainQueue (jsreportRuntime.js:39265:9) at Async._drainQueues (jsreportRuntime.js:39281:5) at Immediate.Async.drainQueues (jsreportRuntime.js:39151:14) at runCallback (timers.js:794:20) at tryOnImmediate (timers.js:752:5) at processImmediate [as _immediateCallback] (timers.js:729:5)caused by error (1) -> meta = {"errno":-4082,"code":"EBUSY","syscall":"open","path":"C:\Windows\TEMP\jsreport\compile\jsreport-2.4.0-H1DuB-TUV\chrome\chrome.exe"}, stack = Error: (1). caused by error (1) -> meta = {"code":"EBUSY"}, stack = Error: at exports.NsSocket.socket.dataOnce ([eval]:72301:25) at exports.NsSocket.listener ([eval]:19019:10) at exports.NsSocket.EventEmitter.emit ([eval]:19107:22) at exports.NsSocket._onData ([eval]:91412:8) at Lazy.<anonymous> ([eval]:73008:13) at Lazy.<anonymous> ([eval]:72990:19) at emitTwo (events.js:126:13) at Lazy.emit (events.js:214:7) at Lazy.<anonymous> ([eval]:72991:22) at emitOne (events.js:116:13) at Lazy.emit (events.js:211:7) at yieldTo ([eval]:73098:18) at Function.<anonymous> ([eval]:73136:27) at Lazy.<anonymous> ([eval]:73104:21) at emitOne (events.js:116:13) at Lazy.emit (events.js:211:7)
    at jsreport.Local.Internal.LocalUtilityReportingService.<RenderAsync>d__10.MoveNext()<---



  • On our customer environment with only one instance of jsreport we sometimes get:

    A critical error occurred while trying to execute the render command: An error occurred while trying to start daemonized process: An error has occurred when trying to initialize jsreport (2). ENOENT: no such file or directory, stat 'C:\work\jsreport\jsreport\node_modules'



  • Thanks. We will check that as well.



  • Hi @jan_blaha , is there any news or prognoses to make for the above?



  • We fixed the temp directory bug and now releasing updated .net binaries 2.5.0 where it will be included.
    I will ping here when it is uploaded. Then you can just update jsreport.Local and jsreport.Binary nugets.

    We haven't been able to find out the reason for ENOENT: no such file or directory, stat 'C:\work\jsreport\jsreport\node_modules' (1).
    We are planning some rewrites to make the binary more robust and better handle parallel runs, it should be part of the next 2.6.0 release.



  • Thanks for the quick reply! We are glad there will be some examination of the parallel running. Looking forward to 2.6.0



  • The jsreport.Binary@2.5.0 and jsreport.Local@2.1.0 with TempDirectory fixes are now available in nuget.



  • Hi, we are still getting the ENOENT error:

    jsreport.Local.JsReportBinaryException: 'Error rendering report: A critical error occurred while trying to execute the render command: An error occurred while trying to start daemonized process: An error has occurred when trying to initialize jsreport (2). ENOENT: no such file or directory, stat 'C:\work\jsreport\jsreport\node_modules' (1). caused by error (2) -> meta = {"code":"ENOENT"}, stack = Error: at instance.init.then.catch ([eval]:66283:29) at tryCatcher (jsreportRuntime.js:158306:23) at Promise._settlePromiseFromHandler (jsreportRuntime.js:157998:31) at Promise._settlePromise (jsreportRuntime.js:158055:18) at Promise._settlePromise0 (jsreportRuntime.js:158100:10) at Promise._settlePromises (jsreportRuntime.js:158176:18) at _drainQueueStep (jsreportRuntime.js:39442:12) at _drainQueue (jsreportRuntime.js:39435:9) at Async._drainQueues (jsreportRuntime.js:39451:5) at Immediate.Async.drainQueues (jsreportRuntime.js:39321:14) at runCallback (timers.js:794:20) at tryOnImmediate (timers.js:752:5) at processImmediate [as _immediateCallback] (timers.js:729:5)caused by error (1) -> meta = {"cause":{"errno":-4058,"code":"ENOENT","syscall":"stat","path":"C:\work\jsreport\jsreport\node_modules"},"isOperational":true,"errno":-4058,"code":"ENOENT","syscall":"stat","path":"C:\work\jsreport\jsreport\node_modules"}, stack = Error: (1). caused by error (1) -> meta = {"code":"ENOENT"}, stack = Error: at exports.NsSocket.socket.dataOnce ([eval]:66671:25) at exports.NsSocket.listener ([eval]:13402:10) at exports.NsSocket.EventEmitter.emit ([eval]:13490:22) at exports.NsSocket._onData ([eval]:94250:8) at Lazy.<anonymous> ([eval]:74361:13) at Lazy.<anonymous> ([eval]:74343:19) at emitTwo (events.js:126:13) at Lazy.emit (events.js:214:7) at Lazy.<anonymous> ([eval]:74344:22) at emitOne (events.js:116:13) at Lazy.emit (events.js:211:7) at yieldTo ([eval]:74451:18) at Function.<anonymous> ([eval]:74489:27) at Lazy.<anonymous> ([eval]:74457:21) at emitOne (events.js:116:13) at Lazy.emit (events.js:211:7)'

    _localReportRenderer = new LocalReporting()
    .RunInDirectory(runPath)
    .KillRunningJsReportProcesses()
    .UseBinary(JsReportBinary.GetBinary())
    .Configure(cfg =>
    {
    cfg.FileSystemStore().BaseUrlAsWorkingDirectory();
    cfg.LicenseKey = "12345";
    cfg.HttpPort = 8066;
    cfg.AllowLocalFilesAccess = true;
    cfg.Logger = new LoggerConfiguration { Transport = new LoggerTransportConfiguration { Transport = "file", Filename = "log_jsReport.log", Level = "debug" } };
    cfg.Discover = true;
    cfg.Chrome = new jsreport.Types.ChromeConfiguration
    {
    Timeout = 600000
    };
    return cfg;
    })
    .AsUtility()
    .Create();



  • When configuring as WebServer:

    System.Exception: 'Failed to start jsreport server, output: 2019-07-24T09:51:23.666Z - error: Error occured during reporter init Error: ENOENT: no such file or directory, stat 'C:\work\jsreport\jsreport\node_modules'An error has occurred when trying to initialize jsreport (2). ENOENT: no such file or directory, stat 'C:\work\jsreport\jsreport\node_modules' (1). caused by error (2) -> meta = {"code":"ENOENT"}, stack = Error: at instance.init.then.catch ([eval]:66283:29) at tryCatcher (jsreportRuntime.js:158306:23) at Promise._settlePromiseFromHandler (jsreportRuntime.js:157998:31) at Promise._settlePromise (jsreportRuntime.js:158055:18) at Promise._settlePromise0 (jsreportRuntime.js:158100:10) at Promise._settlePromises (jsreportRuntime.js:158176:18) at _drainQueueStep (jsreportRuntime.js:39442:12) at _drainQueue (jsreportRuntime.js:39435:9) at Async._drainQueues (jsreportRuntime.js:39451:5) at Immediate.Async.drainQueues (jsreportRuntime.js:39321:14) at runCallback (timers.js:794:20) at tryOnImmediate (timers.js:752:5) at processImmediate [as _immediateCallback] (timers.js:729:5)caused by error (1) -> meta = {"cause":{"errno":-4058,"code":"ENOENT","syscall":"stat","path":"C:\work\jsreport\jsreport\node_modules"},"isOperational":true,"errno":-4058,"code":"ENOENT","syscall":"stat","path":"C:\work\jsreport\jsreport\node_modules"}, stack = Error: 2019-07-24T09:51:23.658Z - info: Initializing jsreport@2.5.0 in development mode using configuration file: none2019-07-24T09:51:23.660Z - info: Searching for available extensions in C:\Code\Cash\Resources'



  • We have the new binary almost ready. It is way faster and also more robust. Stay tuned.
    I don't know if it solves this problem because I don't know how to replicate it, but I hope it does.
    However, let me know if there are some steps which reproduce this error.



  • It seems you are likely hitting the same issue as just reported here
    https://forum.jsreport.net/topic/1178/error-enoent-no-such-file-or-directory

    Please try the mentioned workaround and add to jsreport.config.json
    { "useExtensionsLocationCache": false}


Log in to reply
 

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