Wednesday, April 12, 2017

Sitecore Error: Could not delete candidate folder

This week I ran accross the following error:

ManagedPoolThread #10 09:55:21 INFO  Directory is being deleted by cleanup task: Directory name: E:\_Websites\CMS\cmwebsite\Data\diagnostics\configuration_history\20151211Z.215309Z, directory date: 12/11/2015 4:53:11 PM, age: 156.16:02:09.8430906 (min age: 00:30:00, max age: 30.00:00:00). Reason: Folder is older than max age 30.00:00:00
ManagedPoolThread #10 09:55:21 ERROR Could not delete candidate folder.
Exception: System.UnauthorizedAccessException
Message: Access to the path 'DataFolder.config' is denied.
Source: mscorlib
   at System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound)
   at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive, Boolean checkHost)
   at Sitecore.Tasks.FileCleaner.GetCandidateFiles(DirectoryInfo folder)

The permission all looked correct and then I came across this knowledge base article. This pointed me to check the advanced permissions on the data folder. What is needed is to set the "Delete subfolders and files" permission on the Data folder.

1. Right click the Data folder and select properties.

2. Go the Security tab and select Advanced.
 

3. Click on the IIS Application Pool user and select Edit.


4. Click on "Show advanced permissions"


5.Check the "Delete subfolders and files" permission.


6. OK your way out, waiting for permission propagation when it comes and you should be good.

If you're still not good, then also make sure the read-only flag is not on. What happens is that Sitecore will keep a copy of any configs that are changed and store them under the diagnostic folder. If the source files have the read-only flag, it will persist when the copy is made. Make sure the App_Config folder and its children don't have the read-only flag.



14 comments:

  1. Even though you believe that you are the only person accessing your computer, you can't be sure at all times. With a folder locking mechanism put to good use, data theft can be avoided completely Folder lock

    ReplyDelete
    Replies
    1. Great Article Image Processing Projects Deep Learning Projects for Final Year JavaScript Training in Chennai JavaScript Training in Chennai The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training Project Centers in Chennai

      Delete
  2. It's really a nice and useful piece of info. I am glad that you just shared this useful info with us. Please stay us up to date like this. Thanks for sharing. Additional reading How To Lock Files The Spartan Way

    ReplyDelete
  3. Yasaklı sitelere giriş! Sende yasaklı sitelere giriş nasıl yapılır öğrenmek istiyorsan tıkla:


    yasaklı sitelere giriş

    ReplyDelete
  4. Ucuz, kaliteli ve organik sosyal medya hizmetleri satın almak için Ravje Medyayı tercih edebilir ve sosyal medya hesaplarını hızla büyütebilirsin. Ravje Medya ile sosyal medya hesaplarını organik ve gerçek kişiler ile geliştirebilir, kişisel ya da ticari hesapların için Ravje Medyayı tercih edebilirsin. Ravje Medya internet sitesine giriş yapmak için hemen tıkla: ravje.com

    İnstagram takipçi satın almak için Ravje Medya hizmetlerini tercih edebilir, güvenilir ve gerçek takipçilere Ravje Medya ile ulaşabilirsin. İnstagram takipçi satın almak artık Ravje Medya ile oldukça güvenilir. Hemen instagram takipçi satın almak için Ravje Medyanın ilgili sayfasını ziyaret et: instagram takipçi satın al

    Tiktok takipçi satın al istiyorsan tercihini Ravje Medya yap! Ravje Medya uzman kadrosu ve profesyonel ekibi ile sizlere Tiktok takipçi satın alma hizmetide sunmaktadır. Tiktok takipçi satın almak için hemen tıkla: tiktok takipçi satın al

    İnstagram beğeni satın almak için Ravje medya instagram beğeni satın al sayfasına giriş yap, hızlı ve kaliteli instagram beğeni satın al: instagram beğeni satın al

    Youtube izlenme satın al sayfası ile hemen youtube izlenme satın al! Ravje medya kalitesi ile hemen youtube izlenme satın almak için tıklayın: youtube izlenme satın al

    Twitter takipçi satın almak istiyorsan Ravje medya twitter takipçi satın al sayfasına tıkla, Ravje medya güvencesi ile organik twitter takipçi satın al: twitter takipçi satın al

    ReplyDelete