Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
Hi @Tom-1146 ,
Thanks for reaching out in Microsoft Q&A forum,
The lines "Container get mounts received unexpected exception" and "Container get processes received unexpected exception" are usually not the cause of a startup problem on their own. The platform logs them while it collects details about the container as it is being created, and they also appear on starts that complete successfully. If your log shows these lines followed by "Container is running" and "Site started", the container started normally and you can ignore them.
If the site does fail to start, look a few lines further down the platform log for the actual error. One pattern worth checking is a site that fails only on certain instances with "Create container failed with unexpected exception", "ContainerCreateFailure" or "ImagePullFailure", keeps failing until that instance is replaced, and comes back after a number of deployments. That is often caused by files in the image owned by a user ID (UID) or group ID (GID) above 65535. App Service on Linux maps container user and group IDs into a 65,536-ID range. When an image has IDs outside that range, the image is pulled through a slower path, and over repeated deployments that can exhaust disk resources on the instance.
To check and fix this:
Find out whether your image has files with IDs above 65535:
docker run --rm <your-image> find / -xdev \( -uid +65535 -o -gid +65535 \) -print
If this prints anything, the listed paths are the cause. Package managers that keep ownership from the archives they extract are a common source.
Reset file ownership in your Dockerfile after installing dependencies, for example RUN chown -R root:root /app. If the container runs as a non-root user, use that user instead. If the package with the high IDs is only needed for development or testing, install production dependencies only.
Rebuild the image, run the command from step 1 again to confirm it prints nothing, and deploy the new image to every slot that uses it.
Scale the App Service plan up one tier and back down to move the app onto fresh instances.
If the command in step 1 prints nothing and the site still fails to start, please share the platform log lines that come just after the "unexpected exception" messages (the ones with "LastError" and "LastErrorDetails"), together with the UTC time of a failed start. That will show where the start is actually failing.
Useful references:
- Configure a custom container for Azure App Service
- Can't pull image from Azure Container Registry to Azure Web App
Kindly let us know if the above helps or you need further assistance on this issue.
Please do not forget to
and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.