Reputation: 19
I getting an error Container did not start within expected time error
All configuration was done through the portal of setting up a Web App and deploying either from Github or from VS Code.
ERROR - Container XXXX for site XXXX did not start within expected time limit. Elapsed time = 247.0728889 sec ERROR - Container XXXX didn't respond to HTTP pings on port: 4000, failing site start. See container logs for debugging. INFO - Stopping site XXXX because it failed during startup.
I can see that the startup is:
INFO - docker run -d --expose=4000 --name XXXX -e PORT=4000 -e WEBSITES_PORT=4000 -e WEBSITE_SITE_NAME=XXXX -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=XXXX.azurewebsites.net -e WEBSITE_INSTANCE_ID=2XXXX -e HTTP_LOGGING_ENABLED=1 -e WEBSITE_USE_DIAGNOSTIC_SERVER=True appsvc/node:18-lts_20230908.2.tuxprod
I have set a configuration variable of WEBSITE_START_TIME_LIMIT to be 460 and set the PORT configuration:
I do see logs because my express app uses middleware and I see the before and after Get middleware writing out to log.
There are multiple logs like the above and I am assuming this is part of warmup?
The middleware simple connects to the db and cache before processing the request and closes the conneciton after. No activities for writing actually happen.
This runs perfectly on my dev machine.
I tried deployment using both CD from GitHub and also directly from VS Code. Same outcome (as predicted)
Upvotes: 0
Views: 1108
Reputation: 19
This is extremely confusing.
I created a new Node project and copied the code from the old project to the new and created a new app with the same configuration and it works.
If I used the code from the old project and pushed to the Web App, it doesn't work.
Although I had removed dependencies and re-installed. Deleted the package lock json... couldn't get it to work on the old project.... but now, don't seem to have the issue anymore
The outcome is good, but zero learning
Upvotes: 0