title: Ghost (NodeJS blog) on Azure: Periodic 500 error troubleshooting
body: <h2>Background / Issue</h2>
  <p>Having a strange issue running a <a href="https://ghost.org/" rel="nofollow noreferrer">Ghost</a> blog on Azure. The site seems to run fine for a while, but every once in a while, I'll receive a 500 error with no further information. The next request always appears to succeed (in tests so far).</p>
  <p>The error seems to happen after a period of inactivity. Since I'm currently just getting set up, I'm utilizing an Azure &quot;Free&quot; instance, so I'm wondering if some sort of resource conservation is causing it behind the scenes (which will be allevaited when I upgrade).</p>
  <p>Any idea what could be causing this issue? I'm sort of at a loss for where to start since the logs don't necessarily help me in this case. I'm new to NodeJS (and nodeJS on Azure) and since this is my first foray, any tips/tricks on where to look would be helpful as well.</p>
  <h2>Some specific questions:</h2>
  <ul>
  <li>When receiving an error like this, is there anywhere I can go to see any output, or is it pretty much guaranteed that Node actually didn't output something?</li>
  <li>On Azure free instances, does some sort of resource conservation take place which might cause the app to be shut down (and thus for me to see these errors only after a period of inactivity)?</li>
  </ul>
  <h2>The Full Error</h2>
  <p>The full text of the error is below (I've turned debugging on for this reason):</p>
  <blockquote>
  <p>iisnode encountered an error when processing the request.</p>
  <p>HRESULT: 0x2</p>
  <p>HTTP status: 500</p>
  <p>HTTP reason: Internal Server Error</p>
  <p>You are receiving this HTTP 200 response because system.webServer/iisnode/@devErrorsEnabled configuration setting is 'true'.</p>
  <p>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.</p>
  <p>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'.</p>
  </blockquote>