Publish to Web App from local git repo fails

Thomas 21 Reputation points

I have a Node.js 14 web app and I try to deploy it via local git repo.

When I run
git add . && git commit -am \"Deployment\" && git push azure master

I get the following error:

[master e097827] Deployment
 2 files changed, 2 insertions(+), 2 deletions(-)
Enumerating objects: 13, done.
Counting objects: 100% (13/13), done.
Delta compression using up to 12 threads
Compressing objects: 100% (6/6), done.
Writing objects: 100% (7/7), 601 bytes | 601.00 KiB/s, done.
Total 7 (delta 4), reused 0 (delta 0)
remote: Deploy Async
remote: Updating branch 'master'.
remote: Deployment failed
remote: Error - Changes committed to remote repository but deployment to website failed.
remote: Deployment Logs : ''
   db1e10d..e097827  master -> master

The log looks like this:

  "0" :
    "details_url" : "...",
    "id" : "b56037e0-5ecb-4670-b56c-a62a3340c642",
    "log_time" : "2020-12-28T13:09:42.2365927Z",
    "message" : "Updating branch 'master'.",
    "type" : 2

Additional log:

     "message":"fatal: Unable to create '/home/site/repository/.git/index.lock': File exists.\\n\\nAnother git process seems to be running in this repository, e.g.\\nan editor opened by 'git commit'. Please make sure all processes\\nare terminated then try again. If it still fails, a git process\\nmay have crashed in this repository earlier:\\nremove the file manually to continue.\\n\\n/usr/bin/git checkout master --force",

My first deployment is online, but now I can't do any changes. What do I need to do differently?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,003 questions
{count} votes

Accepted answer
  1. SnehaAgrawal-MSFT 15,946 Reputation points Microsoft Employee

    Thanks for asking question! You may want to know that during deployment of app, All the officially supported deployment methods make changes to the files in the /home/site/wwwroot folder of your app. These files are used to run your app. Therefore, the deployment can fail because of locked files. The app may also behave unpredictably during deployment, because not all the files updated at the same time.
    So, there are a few different ways to avoid these issues:

    Run your app from the ZIP package directly without unpacking it.
    • Stop your app or enable offline mode for your app during deployment. For more information, see Deal with locked files during

    Deploy to a staging slot with auto swap enabled.

    Also refer to Troubleshoot deployment for the error message and and check deployments logs from (Home/Site/Deployments folder) might be helpful.

    Let us know if issue persists.

1 additional answer

Sort by: Most helpful
  1. Thomas 21 Reputation points

    After removing the file ``ìndex.lock
    and a redeployment, I get another error:

    remote: Done in 1452 sec(s).
    remote: Running post deployment command(s)...
    remote: Triggering recycle (preview mode disabled).
    remote: Deployment successful.
    fatal: the remote end hung up unexpectedly
    error: error in sideband demultiplexer
    95ecc52..112a346 master -> master
    error Command failed with exit code 1.