title: Azure Web App on Linux: "Error: Container didn't respond to HTTP pings on port: 8080" - when using: "start": "pm2 start server.js"
body: <p>My App Service Linux instance crashes if my node app is using the start script: <code>&quot;start&quot;: &quot;pm2 start server.js&quot;</code>:</p>
  <pre><code>2019-04-15 11:36:34.432 ERROR - Container crime-digest__6ea5_0 for site crime-digest__6ea5 has exited, failing site start
  2019-04-15 11:36:34.489 ERROR - Container crime-digest__6ea5_0 didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.
  </code></pre>
  <p>Container logs have nothing but the above error. If I use just: <code>&quot;start&quot;: &quot;node server.js&quot;,</code> the app starts just fine.</p>
  <p>I understand that if the container doesn't respond via 8080 the container gets stopped, but I'm having <code>process.env.PORT</code> set as the port of my server so I can't figure out why the pm2 start script crashes the container.</p>
  <p>I have a feeling that <code>process.env.PORT</code> is undefined if using the above start script because of some mixup in the process but can't find any way to debug it because <strong>after the container crashes I'm unable to ssh into it any more</strong> to inspect it.</p>