Developer's Security friend - if nothing works, try Everyone
I had this issue with Unicorn wherein yml files started throwing:
1. Access denied error for the concerned yml file from Sitecore while saving an item in content editor
2. Initial Serialization in Unicorn page threw access denied error
To add to the woes, I was running on an AWS workspace image cloned from another developer so, had to replace the original username with mine in many environment variables and obviously git extensions. Some titbits below:
*****************************************************************
Titbits/Side-notes:
- Refrain hard-coded profile folder path in Environment variables: Use tokens instead like %APPDATA% or %UserProfile% this way, even if your profile folder is in D:\ the env variables will automatically pick it up even in case of cloning your machine image to another user. In other words, check and rectify the environment variables list in case if you inherited your machine from a cloned image.
- gulp wasn't recognised as a command (although installed globally) due to a misconfigured env variable in the above list pointing to old user name
- In case if you inherited your machine from a cloned image, ensure to change the username and email in git extensions from old user to yours. Without this, I saw that my code was pushed with the old user name, so scary!
*****************************************************************
The other issue was, my website was running in c:\inetpub\wwwroot while my source code was in D:\ but I wasn't sure if that could cause any issues.
I checked the access for a random yml file in the d:\ project code and my windows user name had necessary security access. System, Computer Users and Administrators had full permissions for whole of the serialization folder. I was frankly not very confident as well as lazy going the other routes like app pool user permission etc.
Since I couldn't narrow down the issue and also it was my local development environment, I took the liberty of giving Everyone complete access at the parent folder level of source code. The serialization folder under the parent folder also had complete access now. Then, when I performed Initial Serialization followed by a re-serialize, I didn't have the access denied issue anymore.
Saving items in Sitecore content tree also worked fine.
Error:
xxxx.Core is being reserialized.
[D] Clearing existing items from Serialization File System Data Store (if any)
ERROR: Access to the path 'xxx.yml' is denied. (System.UnauthorizedAccessException)
at System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound, WIN32_FIND_DATA& data)
at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive, Boolean checkHost)
at Rainbow.Storage.SerializationFileSystemDataStore.ClearAllFiles()
at Rainbow.ActionRetryer.Perform(Action action, Int32 delayInMs)
at Rainbow.Storage.SerializationFileSystemDataStore.Clear()
at Unicorn.SerializationHelper.ReserializeConfigurations(IConfiguration[] configurations, IProgressStatus progress, ILogger additionalLogger)
Comments
Post a Comment