IISnode error 500



  • Hi all,

    In the past I've managed to correctly configure and install jsreport on IIS using IISNODE.
    I'm now in the need to set it up on a new server, but I can't make it work.
    I've followed the general installation instructions, and then the IIS Node advanced ones.

    While launching jsreport from the command line via the jsreport start command works, it doesn't via IISNode, returning the following information.

    iisnode encountered an error when processing the request.
    HRESULT: 0x2
    HTTP status: 500
    HTTP subStatus: 1002
    HTTP reason: Internal Server Error
    
    You are receiving this HTTP 200 response because system.webServer/iisnode/@devErrorsEnabled configuration setting is 'true'.
    
    In addition to the log of stdout and stderr of the node.exe process, consider using debugging and ETW traces to further diagnose the problem.
    
    The node.exe process has not written any information to stderr or iisnode was unable to capture this information. Frequent reason is that the iisnode module is unable to create a log file to capture stdout and stderr output from node.exe. Please check that the identity of the IIS application pool running the node.js application has read and write access permissions to the directory on the server where the node.js application is located. Alternatively you can disable logging by setting system.webServer/iisnode/@loggingEnabled element of web.config to 'false'.
    

    Please, what's wrong with my jsreport installation?
    Thanks,
    MP



  • Hi,

    the common problem and solution is actually mentioned in the error message

    Frequent reason is that the iisnode module is unable to create a log file to capture stdout and stderr output from node.exe. Please check that the identity of the IIS application pool running the node.js application has read and write access permissions to the directory on the server where the node.js application is located.

    If it helps, this is what I do usually when running iisnode application

    Directory properties => Security => Edit => Add => IIS AppPool[yourpool] => Check Names => Ok => Full Control => Apply => Restart Application pool

    Jan



  • Thanks for the quick reply.
    I forgot to mention that IIS_IUSRS is already configured with "full control" permissions on the jsreport working directory, as it is on my other working machines (with older jsreport versions)

    Thanks,

    MP



  • Ups, ok, this is our fault. I apologize. We forgot that IISNode doesn't support require.main which we call in the latest version of server.js

    Quick fix is to edit the server.js in application folder with the following

    var jsreport = require('jsreport')()
    
    jsreport.init().then(function () { 
      console.log('running')
    }).catch(function (e) {
      // error during startup
      console.error(e.stack)
      process.exit(1)
    })
    

    The tracking issue for this bug can be found here
    https://github.com/jsreport/jsreport/issues/281



  • Excellent, thanks.
    The server started correctly on IISNode with this workaround.


Log in to reply
 

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