Docker container deployment fails in azure web app - azure-web-app-service

I have deployed the simple Hello-world docker image in azure web app for testing as my original application is failing with the similar issue. The hello-world image will download successfully but fail to start with below error:
INFO - Initiating warmup request to container container123445_0_2ec54b26 for site container123445
ERROR - Container container123445_0_2ec54b26 for site container123445 has exited, failing site start
ERROR - Container container123445_0_2ec54b26 didn't respond to HTTP pings on port: 80, failing site start. See containerlogs for debugging.
INFO - Stoping site container123445 because it failed during startup.
When I browse the webapp URL, it gives me "application error" page. Its very simple deployment, but failing.

Related

Octopus deploy error "no port showing when running a docker container in VM"?

I am trying to deploy a sample application in VM using 'run docker container' template.
Everything is working fine but no ports are showing up in the container details while I am explicitly mentioning host and container port.

Azure App Service using Windows Containers fails to start

I've created a Azure App Service using a custom Docker Image for Windows Containers. The image runs completely fine on my Windows machine using Docker Desktop.
However, the Azure container keeps restarting and failing.
Azure Deployment Log from Kudo:
05/04/2022 18:04:28.774 INFO - Site: app-myappdockertest1 - [6a0179c8984360af8ceecd4730b66112335c73c54aa0ead74a2651f9f0abcc28] - Attempting to start container
05/04/2022 18:04:46.474 INFO - Site: app-myappdockertest1 - [6a0179c8984360af8ceecd4730b66112335c73c54aa0ead74a2651f9f0abcc28] - Start container succeeded.
05/04/2022 18:04:52.593 INFO - Site: app-myappdockertest1 - [6a0179c8984360af8ceecd4730b66112335c73c54aa0ead74a2651f9f0abcc28] - Attempting to stop container: 6a0179c8984360af8ceecd4730b66112335c73c54aa0ead74a2651f9f0abcc28. Site app-myappdockertest1
05/04/2022 18:04:52.593 INFO - Site: app-myappdockertest1 - [6a0179c8984360af8ceecd4730b66112335c73c54aa0ead74a2651f9f0abcc28] - Shutdown container: 6a0179c8984360af8ceecd4730b66112335c73c54aa0ead74a2651f9f0abcc28
05/04/2022 18:04:52.611 INFO - Site: app-myappdockertest1 - [6a0179c8984360af8ceecd4730b66112335c73c54aa0ead74a2651f9f0abcc28] - Attempting to remove container: 6a0179c8984360af8ceecd4730b66112335c73c54aa0ead74a2651f9f0abcc28
05/04/2022 18:04:52.992 INFO - Site: app-myappdockertest1 - Purging pending logs after stopping container
05/04/2022 18:04:52.992 INFO - Site: app-myappdockertest1 - [6a0179c8984360af8ceecd4730b66112335c73c54aa0ead74a2651f9f0abcc28] - Container removed successfully. Container Id: 6a0179c8984360af8ceecd4730b66112335c73c54aa0ead74a2651f9f0abcc28
05/04/2022 18:04:53.003 INFO - Site: app-myappdockertest1 - Purging after container failed to start
05/04/2022 18:04:53.003 ERROR - Site: app-myappdockertest1 - Unable to start container. Error message: One or more errors occurred.
I was unable to find any additional information to this error. Any idea to find detailed information about the error?
The image is based on the latest version of mcr.microsoft.com/dotnet/framework/wcf. It contains a .NET WCF service hosted in IIS
Solution for the issue after reviewing the information given by AjayKumar-MSFT:
The main issue was that I was using a not supported parent image. The image "mcr.microsoft.com/dotnet/framework/wcf" in its current version was based on "Windows Server Core 2022" while Microsofts supported images requires "Windows Server Core 2019" as of April 2022.
I've changed my Dockerfile to
FROM mcr.microsoft.com/dotnet/framework/wcf:4.8-windowsservercore-ltsc2019
and was able to solve the issue. The container starts without any error message.
However AjayKumar-MSFT's tips regarding memory usage were also helpful as I was getting OutOfMemoryExceptions after the application start.
As for as supported parent images, review the supported list.
--You may always, fetch more details on the errors, review the logs:
Navigate to https://.scm.azurewebsites.net/DebugConsole and click the LogFiles folder to see the individual log files.
--Navigate directly to https://.scm.azurewebsites.net/api/logs/docker to see metadata for the Docker logs.
--You may test with the listed parent image in the doc.
Additionally,
By default, if your container does not respond after 230 seconds, it will time out. (This time out can be increased by with the WEBSITES_CONTAINER_START_TIME_LIMIT app setting.) and be increased to 1800
Used the following base image mcr.microsoft.com/windows/servercore:ltsc2019 which seems to have solved the error for me.

Node js app error didn't respond to HTTP pings on port: 8080, failing site start. on Azure app service linux (not docker)

Nodejs app works locally and also works on app service if deployed to Azure app service Linux directly from visual studio but does not work when deployed using azure devops
Artifact files and folders using visual studio -
config
demo
dist
src
gulpfile.babel.js
node_modules
package-lock.json
package.json
postcss.config.js
web.config
node_modules.tar.gz
oryx-manifest.toml
Artifact files using Azure devops -
config
demo
dist
src
gulpfile.babel.js
node_modules
package-lock.json
package.json
postcss.config.js
web.config
When I am trying to deploy using azure devops App service deploy task deployment works but URL is not working and logs errors are -
container test didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.
2020-09-12T05:37:46.165Z INFO - Stopping site because it failed during startup.
2020-09-12T05:53:51.152Z INFO - Starting container for site
2020-09-12T05:53:51.153Z INFO - docker run -d -p 1861:8080 --name -e WEBSITE_SITE_NAME=test -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=test.azurewebsites.net -e
I don't have any docker-file , if ports is the issue, then why its works when I publish to Azure app service using visual studio?
These are my mentioned ports
serve({
port: process.env.PORT || 3000,
open: true,
server: {
baseDir: 'src'
},
Now what you are doing is to publish the webapp through devops. The phenomenon is that it cannot be accessed normally. The error message prompts that container test didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.
Similar related posts should be helpful to you.
Struggling to upload my node.js application to azure
Because the project is normal locally, we are now troubleshooting the problem.
Because azure app services only supports ports 80 and 443. So check if only one port is enabled in the program. Such as configuring port: process.env.PORT || 3000.
It is recommended to use git for continuous deployment to test whether your webapp project can run normally in azure app services
If continuous deployment using Git is successful:
If git continuous deployment can replace your deployment method requirements, and the project can start normally, then your problem will be solved.
But if you must want deploy apps by using devops, there may be errors when configuring release.
If you are really not sure where there is an error, you can raise a support ticket on the portal. Let an official engineer assist you in checking logs and troubleshooting problems.

Azure App Service Container keeps on restarting

I created an azure app Service running a docker container.
but the container seems to be restarting all the time:
2020-01-09 07:21:56.543 INFO - Container XXX for site xxx initialized successfully and is ready to serve requests.
2020-01-09 07:22:01.559 ERROR - Container for xxx site xxx is unhealthy, Stopping site.
2020-01-09 07:22:01.559 INFO - Stoping site xxx because it is not healthy.
As it is a ressource intensive application it can be that the Service is not responding quickly.
i already tried to add the following Setting:
{
"name": "CONTAINER_AVAILABILITY_CHECK_MODE",
"value": "Off",
"slotSetting": false
}
but with no effect.
According to the Dockerfile of the image apache/drill:1.17.0 you used, it does not expose the port 8047 to access outside. And there are two ways to expose the port that displayed here and then you can access outside if you want. So the second way is suitable for this situation, and when you set the environment variable WEBSITES_PORT with value 8047, then you can access the web app outside. Here is the screenshot which works fine on my side:
Update:
It seems the image needs an interactive mode and the docker command to run it should be docker run -i --name drill-1.17.0 -p 8047:8047 --detach -t apache/drill:1.17.0 /bin/bash or another similar command with an interactive mode. Or it would stop in a few munites later. But you cannot change the command that runs the image in Web App, so you also cannot use an interactive mode in Web App for the image.
So the solution is that you need to create a custom image to keep it on running state base on the image apache/drill:1.17.0. Then it will work well.

Not able to deploy to Google App Engine Managed VM

When I try to deploy my node app on GAE I get this error (app ID stripped):
WARNING: If this is your first deployment, please try again.
ERROR: (gcloud.preview.app.deploy) Server responded with code [404]:
Not Found Unexpected HTTP status 404.
This application does not exist (app_id=u'<app-id>').
This is this project's first deployment. I am using the app.yaml from the getting started repo, nodejs runtime.

Resources