Search code examples
node.jsexpressiisnode

Error during Node startup/recovery in progress. Not yet ready to accept connections?


I'm running an express server on IISNode, but noticed the web service is down due to:

I need to handle the exception which occurs during any crash of the system in IIS node due to configuration mismatch or connection problem.

I got the following error that Application has thrown an uncaught exception and it get terminated, not able to handle the exception:
 Error: Node startup/recovery in progress. Not yet ready to accept connections
    at process.<anonymous> (C:\Program Files\iisnode\interceptor.js:201:110)
    at emitOne (events.js:77:13)
    at process.emit (events.js:169:7)
    at process._fatalException (node.js:224:26)

Looking at the error on Google. It looks like the error is coming from a failed query to a vertica datatbase:

https://community.hpe.com/t5/Cloud-Optimizer-Practitioners/vPV-1-10-Error-Unable-to-collect-performance-data-from-data/td-p/6164633

Question:

How can I prevent IISNOde crashing on failed query? Code to Handle the uncaught exception while IISNode Crashes.

These are my node dependencies in the package.json:

"dependencies": {
    "async": "^2.1.4",
    "body-parser": "^1.15.2",
    "cors": "2.7.1",
    "cron": "^1.2.1",
    "express": "4.14.0",
    "mssql": "3.3.0",
    "winston": "2.2.0",
    "xmlhttprequest": "^1.8.0"
  }

Solution

  • The reason for the "Error: Node startup/recovery in progress." is that the IISNode older version has the bug which was crashing when the script tries to access the resources, which was fixed in the newer version of "IISNode".

    In the following code mentioned, the line "<iisnode idontexist="12" />" take care of the fix and adding this following line of code will avoid the crash and handle the exception in IISNode.

    This issue was fixed for a while,

    Please install the latest "IISNode" and try again.

    Can you try adding/Replacing these lines in the "Web.Config"

    <configuration>
      <system.webServer>
        <handlers>
          <add name="iisnode" path="hello.js" verb="*" modules="iisnode" />
        </handlers>
    
        <iisnode idontexist="12" />
    
      </system.webServer>
    </configuration>
    

    Reference: https://github.com/tjanczuk/iisnode/blob/master/test/functional/www/116_configerror/web.config