Failed to deploy App Service (ERROR_FILE_IN_USE)
See original GitHub issueOccasionally we get the following exception thrown from the Azure App Service Deploy task (version 2.*)
Failed to deploy App Service.
Error Code: ERROR_FILE_IN_USE
Error: C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe failed with return code: 4294967295
System.Management.Automation.CmdletInvocationException: Could not find a part of the path 'C:\agent\_work\2\s\test\Postman\Collections\results'. ---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\agent\_work\2\s\test\Postman\Collections\results'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileSystemEnumerableIterator`1.CommonInit()
at System.IO.Directory.EnumerateFiles(String path, String searchPattern, SearchOption searchOption)
at Microsoft.TeamFoundation.DistributedTask.Task.Common.Core.FindFiles.<GetPathIterator>d__4.MoveNext()
at Microsoft.TeamFoundation.DistributedTask.Task.Common.Core.FindFiles.GetMatchingItems(List`1 includePatterns, List`1 excludePatterns, Boolean includeFiles, Boolean includeFolders)
at Microsoft.TeamFoundation.DistributedTask.Task.Common.Core.FindFiles.FindMatchingFiles(String rootFolder, String matchPattern, Boolean includeFiles, Boolean includeFolders)
at Microsoft.TeamFoundation.DistributedTask.Task.Common.PowerShell.FindFilesCmdlet.ProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
--- End of inner exception stack trace ---
at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
at Microsoft.TeamFoundation.DistributedTask.Handlers.PowerShellHandler.Execute(ITaskContext context, CancellationToken cancellationToken, Int32 timeoutInMinutes)
at Microsoft.TeamFoundation.DistributedTask.Worker.JobRunner.RunTask(ITaskContext context, TaskWrapper task, CancellationTokenSource tokenSource)
Configuration:
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Getting ERROR_FILE_IN_USE while using Web Deploy in ...
Failed to deploy web package to App Service. Try to deploy app service again with Rename locked files option selected. Error Code: ...
Read more >Azure App Service Deploy(4.3.8) - ERROR_FILE_IN_USE
while Build/Deploy the pipeline failing with below details:- Azure App Service Deploy(4.3.8) - ERROR_FILE_IN_USE.
Read more >ERROR_FILE_IN_USE when Deploying .NET Core App to ...
This temporary page will use one of the default templates that Azure provides for App Service error messages. This last setting, in particular, ......
Read more >failed to deploy web app to App service" in Azure Devops?
How to solve "Error : failed to deploy web app to App service" in Azure Devops? Hi, I really dont know where this...
Read more >Failed to deploy web package to App Service ...
There is an issue tracked here : Azure App Service Deploy fails for .net core 2.0 with ERROR_FILE_IN_USE and based on vincentdass's comment...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Checking Take App Offline, Publish using WebDeploy and Rename locked files check boxes fixed my issue. However the deployment was successful for two concurrent releases. Will update you once my nightly scheduled builds get succeeded.
@rmarinho , Is App Offline flag enabled in Release definition? Can you please add
-retryInterval:6000 -retryAttempts:10
in Additional arguments of Web Deploy option? We have another thread to monitor the same issue.Is there any webjobs or Application Insights extensions running in your App Service?