aspnet / dnx

OBSOLETE - see readme
Other
963 stars 224 forks source link

Issue deleting packages #3401

Closed sethreidnz closed 8 years ago

sethreidnz commented 8 years ago

I get errors during deployments at times when deploying to Azure WebApps:

Error: An error was encountered when processing operation 'Delete Directory' on 'D:\home\site\wwwroot\App_Data\jobs\Continuous\****\packages\***\1.1.3'.
Error: The error code was 0x80070091.
Error: The directory is not empty.
at Microsoft.Web.Deployment.NativeMethods.RaiseIOExceptionFromErrorCode(Win32ErrorCode errorCode, String maybeFullPath)
at Microsoft.Web.Deployment.DirectoryEx.Delete(String path)
at Microsoft.Web.Deployment.DirPathProviderBase.Delete(Boolean whatIf)
Error count: 1.

This can happen with my own packages and also third party ones. Generally restarting the site works but sometimes it doesn't and I get stuck where I cannot delete the folder. I have tried mannually doing it through Azure Kudu tools but to no avail. I found this issue on the Kudu github:

https://github.com/projectkudu/kudu/issues/1697

Which sounds similar and the person there mentioned it sounded like a DNX issue.

I understand that the new aspnet stuff is not fully supported on Azure yet but I'm wondering if this is a known issue or if I am doing something wrong?

sethreidnz commented 8 years ago

To add to this I have figured out the root problem I think. I am deploying WebJobs as well. My deployment will turn off the web app slot but that does not kill the process that the webjobs are running under. Therefore the files are locked.

I think that means its not really a DNX issue..

muratg commented 8 years ago

Closing based on the root cause.

philmh-isams commented 8 years ago

@justsayno How do you kill the process the WebJobs are running under - we have the same issue trying to remove some WebJobs; we had to turn on DoNotDelete flag in the interim to get our releases working.

If you redeploy a failed deployment, it works.

PrashanthReddyAnnedla commented 8 years ago

If we set the DoNotDelete flag then unnecessary files are not being removed, this is causing reference issues for one of my website. Hope there is some solution for this.

muratg commented 8 years ago

Why are you guys still using DNX? It's obsolete,

sethreidnz commented 8 years ago

@philmh-isams what @muratg said. However to answer your question more fully. What I did was just put the webjobs into the correct file location (in my web project output) as part of my build process and then published the whole website as a package. This seemed to work.

philmh-isams commented 8 years ago

@justsayno and @muratg I am using .NET Core not DNX - sorry for the confusion. Thanks for the response.

steve-warwick commented 7 years ago

I'm experiencing the same issue. We are .Net Core. Also, we deploy our web jobs separately from the primary app service they are hosted in. Our VSTS release management deployment attempts to stop the web jobs, stops the app service, deploys the app service, deploys the web jobs, starts the app service and web jobs. During the app service deploy we get this error. I verified the app service isn't running and the web jobs are not running when it attempts the deploy. Has anyone found a solution or workaround for this issue?

philmh-isams commented 7 years ago

@steve-warwick We have not found one, but DoNotDelete is a suitable workaround for us at present. I would be interested if anyone else has a solution too ;o)