Writing command to persistent storage is hanging in Azure App Service for Linux Containers

242 Views Asked by At

We have a custom container image that we are trying to run within Azure App Service. The image has a shell script as an entry point, which executes a lot of commands some of which are file IO related. We need to turn on Persisten Storage by changing the configuration WEBSITES_ENABLE_APP_SERVICE_STORAGE = true.

The container is failing to start and by viewing the logs, we are seeing that the process hangs during the following statement:

echo "start"
tar cf - --one-file-system -C /usr/src/folder . | tar xf -
echo "end"

The statement is basically compressing a folder and extracting it in the /home/site/wwwroot directory, which is the one that is persisted within the App Service.

We can see start being logged in the logs, but we can't see end, which leads us to believe that the process is hanging on the tar statement, but we are seeing some of the files and folders being copied.

If we set WEBSITES_ENABLE_APP_SERVICE_STORAGE = false everything works as expected... of course until a restart of the container, where we loose all of our changes. Hence why we need Persistent Storage. Furthermore, this works ok on my local machine pointing to an external volume.

What gives?

1

There are 1 best solutions below

0
On

After a lot of troubleshooting I figured the issue was the command was taking a long time to execute because files were being moved to another network location and the container was restarting before the command had time to finish. We changed the WEBSITES_CONTAINER_START_TIME_LIMIT to give it enough time to finish the command and everything started working as expected.