question

OctopiNederlandBV-9275 avatar image
0 Votes"
OctopiNederlandBV-9275 asked OctopiNederlandBV-9275 edited

Azure DevOps Zip Deploy to Azure App Service fails when startup.sh was changed

We deploy our application to Azure App Service (Linux) through Azure DevOps Zip Deploy. When we deploy changes to any file except startup.sh the deployment succeeds.
However, as soon as we change the startup.sh and try to deploy we get the following error:

 "Rsync: rename "/home/site/wwwroot/.startup.sh.opLS0x" -> "startup.sh": No such file or directory"

When using SSH to access the container (ourdomain.scm.azurewebsites.net/webssh/hostcd) any operation involving the startup.sh file fails even though the startup.sh file does show up when using the "ls" command:

 cat: startup.sh: No such file or directory

This problem can be resolved by stopping the App Service and starting it again. However, I believe we should be able to deploy without this trick because it may lead to downtime if not carefully executed.

Does anyone have an idea on how to resolve this issue?

azure-webappsazure-webapps-content-deployment
· 2
5 |1600 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.

@OctopiNederlandBV-9275, I just want to confirm that when you CI/CD pipeline runs, the app startup results in "Rsync: rename "/home/site/wwwroot/.startup.sh.opLS0x" -> "startup.sh": No such file or directory" but when you SSH into the app, ls also results in cat: startup.sh: No such file or directory but browsing the file contents of the app service, you see the startup.sh in /home/site/wwwroot. Let me know if I'm misunderstanding anything. I do have the following questions:

  • What language is your app?

  • Are you using a docker container? Docker compose?

  • I'm assuming your app is hosted in a Linux plan? What region?

  • Do you have a SCM_DO_BUILD_DURING_DEPLOYMENT app setting set to True/1?

  • Does your CI/CD deploy artifacts or the codebase files?

  • When browsing and you see startup.sh, does the file contents reflect the updates pushed from your pipeline?


0 Votes 0 ·

@ryanchill Thank you for taking the time to respond to my question. Apologies for the ambiguity. Let me try and answer your questions:

  • In the CI/CD pipeline in the "Deploy Azure Web App" step the pipeline fails with the following error logs:

    copying files to destination directory '/home/site/wwwroot'...
    rsync: rename "/home/site/wwwroot/.startup.sh.5BP8kE" -> "startup.sh": No such file or directory (2)
    rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1196) [sender=3.1.2]

Please note that in the error log in the pipeline we observe that the error is related to "startup.sh" not being found. Also note it is not the app startup failing but the pipeline web deploy step. Consequently, app startup is not reached.

  • We are running a Django app (Python3.8)

  • We are not running a Docker container but we are using a custom startup file "startup.sh"

  • The app is hosted in a Linux plan in West-Europe

  • SCM_DO_BUILD_DURING_DEPLOYMENT is set to 1

  • The CI/CD deploys a ZIP file with the codebase through the pipeline step Azure Web Deploy

  • When browsing (through SCM) all files are correctly updated except "startup.sh". Trying commands such as "cat startup.sh", "rm startup.sh", "vim startup.sh" results in "startup.sh: No such file or directory". However using the command "ls -a" does reveal that "startup.sh" is present and that it is not a symbolic link.


0 Votes 0 ·

0 Answers