6

I am running an express.js app, with iisnode as the handler.

Whenever I restart the site in IIS, or recycle the app pool (either manually or by saving the web config after changing a file) the app crashes with a 500.1001 error but only on the very first request. If the same route or any other route is requested thereafter, the app works fine.

I have this code in the index.js entry point

var server = app.listen(process.env.PORT, function () {
  var host = server.address().address;
  var port = server.address().port;
  console.log('Example app listening at http://%s:%s', host, port);
});

which is logging undefined for host, port on the first request, but I have no idea why!

Detailed Error Information:

  • Module iisnode
  • Notification ExecuteRequestHandler
  • Handler iisnode
  • Error Code 0x00000002
  • Requested URL (app entry point url)
  • Physical Path (physical file path to app entry point)
  • Logon Method Anonymous
  • Logon User Anonymous
Benghis Ghrant
  • 183
  • 1
  • 11
  • Solved - got rid of namedPipeConnectionRetryDelay from the web config. You can also do this apparently: https://tomasz.janczuk.org/2013/07/application-initialization-of-nodejs.html – Benghis Ghrant Sep 16 '16 at 08:37
  • If that solved your issue, please post it below as an answer. – Ryan Gates Jan 12 '18 at 21:56

0 Answers0