aspnetcore: Deploying ASP.NET Core from git with kudu fails because of locked pdb file
Moved from https://github.com/dotnet/core/issues/1721 - opened by @ellern. PTAL @pakrym. cc @muratg
I got a couple of web apps running .NET Core 2.1.0 on different Azure service plans running on Windows.
Lately I’ve started getting a file locked error when deploying from git on Azure. Almost every single time I push, it errors out telling me the file (Site.Views.pdb) is in use. Restart app, redeploy works every time, but it’s annoying. I found out if I push two changes within a short timespan then there is no lock on the pdb file and the deployment works as expected.
Remote debugging is disabled for the web apps, so I have no idea why there is a lock on the pdb file.
I can’t remember having any issues before I updated my web apps to .NET Core 2.0.0
KuduSync.NET from: 'D:\local\Temp\8d5d80c09bb9d1c' to: 'D:\home\site\wwwroot'
Error: Failed to change file that is currently being used "D:\home\site\wwwroot\Site.Web.Views.pdb"
Copying file: 'Site.Web.deps.json'
Copying file: 'Site.Web.runtimeconfig.json'
Copying file: 'Site.Web.Views.dll'
Copying file: 'Site.Web.Views.pdb'
Failed exitCode=1, command="kudusync" -v 50 -f "D:\local\Temp\8d5d80c09bb9d1c" -t "D:\home\site\wwwroot" -n "D:\home\site\deployments\c764c8a77ef871df3f13953049f5bc51088cac1f\manifest" -p "D:\home\site\deployments\bd8a3c2f17acba1e45b1c14276d9530f24e5a649\manifest" -i ".git;.hg;.deployment;deploy.cmd"
An error has occurred during web site deployment.
Error: Failed to change file that is currently being used "D:\home\site\wwwroot\Site.Web.Views.pdb"\r\nD:\Program Files (x86)\SiteExtensions\Kudu\74.10611.3437\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"
This issue is copied from projectkudu/kudu#2788
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 8
- Comments: 45 (19 by maintainers)
We have recently upgraded to 2.2 and we are still hitting this issue very often.
This is extremely troubling and a real blocker for any production application. How does this not receive much more attention?
@MGudgin I opened a PR for the backport here https://github.com/dotnet/corefx/pull/38291
We’ve identified the issue and are looking at backporting the fix to older versions of .NET Core (possibly 2.1 and 2.2). More information here https://github.com/dotnet/corefx/issues/38212
We also ran into this problem. .NET Core 2.2.105, remote debugging disabled, no custom deploy.cmd -> failure rate 95%+ on a simple service that isn’t even used yet.
And please let me express my astonishment at the state of this issue. 9 months+ old, no one assigned, no milestone, no one responsible is even trying to be helpful and the only workaround is to stop the service before deployment, start it afterwards and hope it manages to finish in time. That’s something I remember doing cca 7+ years ago on Azure Web Roles back when they were still young. Ahh, never gets old…
EDIT: we have actually decided to “downgrade” to .NET 4.7.2 because using KUDU Zip Deploy over WebDeploy actually brings us more value than compiling to .NET Core 2.2 over .NET 4.7.2. This was my 4th try to actually use .NET Core. Needless to say, that it has also been my 4th disappointment.