question

GCS-8925 avatar image
0 Votes"
GCS-8925 asked ·

Azure App Services Times Out

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-webapps
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ryanchill avatar image
0 Votes"
ryanchill answered ·

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.


·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.