Domanda

I have an Orchard CMS website deployed to Windows Azure using Git Deploy from BitBucket.

Just with my latest changes I'm getting an error when I try to deploy:

The process cannot access the file 'C:\DWASFiles\Sites[MyWebsite]\VirtualDirectory0\site\wwwroot\App_Data\Dependencies\Joel.Net.Akismet.dll' because it is being used by another process.

Given its Azure Websites, I can't "stop the AppPool" or anything like that. I've tried stopping the site, but then I can't do a deployment with the site stopped. I'm out of ideas as to how to troubleshoot further.

Trying to update via ftp

There is no option to "restart" but I can stop and start the site, this does not work (502 web server error).

Deleting the files the the \App_Data\Dependencies folder via ftp does not work, and gets the same error.

Stopping the site and then uploading the files via ftp does work. But trying to redeploy via Git, I get a similar error:

Command: deploy.cmd Handling Basic Web Site deployment. KuduSync.NET from: 'C:\DWASFiles\Sites[MyWebsite]\VirtualDirectory0\site\repository' to: 'C:\DWASFiles\Sites[MyWebsite]\VirtualDirectory0\site\wwwroot' Error: The process cannot access the file 'C:\DWASFiles\Sites[MyWebsite]\VirtualDirectory0\site\wwwroot\App_Data\Dependencies\Markdown.dll' because it is being used by another process. Copying file: 'App_Data\Dependencies\dependencies.compiled.xml' Copying file: 'App_Data\Dependencies\dependencies.xml' Copying file: 'App_Data\Dependencies\Ionic.Zip.dll' Copying file: 'App_Data\Dependencies\Joel.Net.Akismet.dll' Copying file: 'App_Data\Dependencies\Markdown.dll' An error has occurred during web site deployment. Handling Basic Web Site deployment.

I'm sure its not just the one dll, but rather, all the dlls in the \App_Data\Dependencies folder don't get "stopped" during a Git deployment.

Trying to set up another site on Azure Websites to do the Git Deploy

I have set up another Azure site for Git to deploy the same branch of code to and this works fine.

But when I switch my domain name to the new Azure Website, my new site no longer works, but my old one can accept git deploy.

So the website with my domain name directed at it, must be getting activity causing the update to stop working. Is there a way to stop the site AND do a Git deploy?


So after removing the Dependencies folder from my repo as per @David's comments, I'm getting a new error:

Command: deploy.cmd Handling Basic Web Site deployment. KuduSync.NET from: 'C:\DWASFiles\Sites[MyWebsite]\VirtualDirectory0\site\repository' to: 'C:\DWASFiles\Sites[MyWebsite]\VirtualDirectory0\site\wwwroot' Error: Access to the path 'Joel.Net.Akismet.dll' is denied. Copying file: '.gitignore' Deleting file: 'App_Data\Dependencies\Joel.Net.Akismet.dll' An error has occurred during web site deployment. Handling Basic Web Site deployment.

Seems like the Kudu sync is seeing that there are no files in the Dependencies folder, and trying to delete them! The same happens when I have no Dependencies folder at all - it tries to delete the Dependencies folder.

@David is there a kudu ignore file?


SOLVED!

OK I kept at it, and I have finally resolved it.

  • I deleted the entire app_data folder (backed it up first) then checked this into Git.
  • This was pushed into Azure, giving me a fresh Orchard site
  • I then re-added my app_data but chose to ignore the app_data/dependencies folder
  • pushed to Git and updated to Azure perfectly

Hope my next check in still works (fingers crossed)

È stato utile?

Soluzione

I'm guessing that the root of the problem is that you are committing the App_Data\Dependencies folder into your repo. This folder is something that Orchard creates dynamically, and should not be in your repo.

I suspect that if you don't do this (by using .gitignore), everything will work fine and you won't get this error.

Altri suggerimenti

You can restart the website just before deployment, which is akin to recycling the app pool. Just hit the restart button from the footer on the dashboard.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top