Azure App Services Times Out

GCS 1 Reputation point
2020-06-09T05:08:04.117+00:00

I am having an issue with a deployment of an Node application to Azure App Services, where it keeps timing out as it starts up.

I am the Azure App Service extension to deploy my app (Node 10) from Visual Studio Code. This worked perfectly fine for quite a while, but I've been seeing an issue crop up lately that I can't seem to fix. VS Code will push the code to Azure correctly, but then there is trouble when Azure tries to start up the app. It'll sit there for a while before I finally see these messages in the Log Stream:

2020-06-09T02:40:34.913Z INFO - Waiting for response to warmup request for container xxx-xxxxxx-xxxx-xxxxxxxx_0_843c47b3. Elapsed time = 92.0771237 sec

2020-06-09T02:43:13.794Z ERROR - Container xxx-xxxxxx-xxxx-xxxxxxxx_0_8609429c for site xxx-xxxxxx-xxxx-xxxxxxxx did not start within expected time limit. Elapsed time = 236.6884906 sec

2020-06-09T02:43:13.822Z ERROR - Container xxx-xxxxxx-xxxx-xxxxxxxx_0_8609429c didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.

2020-06-09T02:43:13.905Z INFO - Stopping site xxx-xxxxxx-xxxx-xxxxxxxx because it failed during startup.

Status_WatchFile :: Error Error: ENOENT: no such file or directory, open '/appsvctmp/status.txt'Status_WatchFile :: Error Error: ENOENT: no such file or directory, open '/appsvctmp/status.txt'Status_WatchFile :: Error Error: ENOENT: no such file or directory, open '/appsvctmp/status.txt'

I try to SSH into the container as it's starting up, and everything appears to be fine. callin "ps -ef" shows that the node process is running, and "netstat -tulpn" shows that it is listening on port 8080. So why can't Azure detect that it's running? What does '/appsvctmp/status.txt' have to do with any of this?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,865 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 25,661 Reputation points Microsoft Employee
    2020-06-12T04:32:03.417+00:00

    Hi @GCS-8925,

    The /appsvctmp/status.txt is a file that's used by the platform to determine when your app is started or in the process of being started.

    In looking at the logs you appended, it appears you're running a node app in either a linux hosting plan or docker container. For Azure to be able to connect app inside the container, you app should be listening on 0.0.0.0.

     const http = require('http');
     
     // const hostname = '127.0.0.1';
     const port = 3000;
     
     const server = http.createServer((req, res) => {
       res.statusCode = 200;
       res.setHeader('Content-Type', 'text/plain');
       res.end('Hello World');
     });
     
     server.listen(port,/* hostname */, () => {
       console.log(`Server running at http://${hostname}:${port}/`);
     });
    

    You can effectively use hostname = 0.0.0.0; but for running in the cloud, it's not required. Let me know if you still have an issue.

    0 comments No comments