I have a Sitecore 7.2 solution that I have installed Unicorn 3 into.
I have used the default config file that is supplied. On development, I have enabled transparent sync after doing an initial sync
<dataProviderConfiguration type="Unicorn.Data.DataProvider.DefaultUnicornDataProviderConfiguration, Unicorn" enableTransparentSync="true" />
I have created a transofrm file so that when I deploy the solution to non development environments, it switches the enableTransparentSync back to false.
Within this solution, there are some custom modules, and I am using the command Package Installer created by Benjamin Vangansewinkel (https://github.com/VGBenjamin/PackageInstaller)
When I run the command line to install a package, it its giving me an error indicating that it cannot write to the yml file to disk.
Now I have checked the Unicorn.config file on this environment, and I can confirm that the enableTransparentSync is set to false.
The package I am attempting to install is attempting to create items to /sitecore/content/Applications/Content Editor/Context Menues/Default/ and I can see that with the default configuration, everything within /sitecore/content/Applications/ will be sync'ed.
On the dev machines, all the sitecore modules are installed, and the yml files under /sitecore/content/Applications/Content Editor/Context Menues/Default/ are serialized to disk.
This may be my misunderstanding, but I thought that if transparent sync is disabled, then when changes are made into Sitecore, you have to go to the unicorn control panel and sync all the modifications manually. So why then am I getting errors about not being able to write changes to disk when transparent sync is not enabled.
Now another option will be to delete the following lines from the default.config
<include database="core" path="/sitecore/system/Field types"/>
<include name="Core Settings" database="core" path="/sitecore/system/Settings" />
<include name="Core Start Menu" database="core" path="/sitecore/content/Documents and settings/All users"/>
<include name="Core Applications" database="core" path="/sitecore/content/Applications"/>
But before I do that I want to know why Unicorn appears to be using transparent sync.
FYI: this is the full error stack
2016-03-22 15:38:15,996 [1] ERROR Sidewalk.SC.PackageInstaller.Client.Program [(null)] - System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.UnauthorizedAccessException: Access to the path 'D:\Websites\CI\Website\Unicorn\Default Configuration\Core Applications\Applications\Content Editor\Context Menues\Default\Bulk Export.yml' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalDelete(String path, Boolean checkHost)
at Rainbow.Storage.SerializationFileSystemTree.WriteItem(IItemData item, String path)
at Rainbow.Storage.SerializationFileSystemTree.Save(IItemData item)
at Unicorn.Data.DataProvider.UnicornDataProvider.SaveItem(ItemDefinition itemDefinition, ItemChanges changes, CallContext context)
at Unicorn.Data.DataProvider.UnicornSqlServerDataProvider.SaveItem(ItemDefinition itemDefinition, ItemChanges changes, CallContext context)
at Sitecore.Data.DataProviders.DataProvider.SaveItem(ItemDefinition item, ItemChanges changes, CallContext context, DataProviderCollection providers)
at Sitecore.Data.DataSource.SaveItem(ID itemID, ItemChanges changes)
at Sitecore.Data.Engines.EngineCommand`2.Execute()
at Sitecore.Data.Engines.DataEngine.SaveItem(Item item)
at Sitecore.Data.Managers.ItemProvider.SaveItem(Item item)
at Sitecore.Data.Items.ItemEditing.AcceptChanges(Boolean updateStatistics, Boolean silent)
at Sitecore.Install.Items.ItemInstaller.VersionInstaller.InstallVersion(Item version)
at Sitecore.Install.Items.ItemInstaller.VersionInstaller.PasteVersion(XmlNode versionXml, Item target, VersionInstallMode mode, IProcessingContext context, Boolean removeOtherVersions)
at Sitecore.Install.Items.ItemInstaller.InstallEntry(PackageEntry entry)
at Sitecore.Install.Items.ItemInstaller.Flush()
at Sitecore.Install.Framework.SinkDispatcher.Flush()
at Sitecore.Install.Utils.EntrySorter.Flush()
at Sitecore.Install.Framework.EntryBuilder.Flush()
at Sitecore.Install.Zip.PackageReader.Populate(ISink`1 sink)
at Sitecore.Install.Installer.InstallPackage(String path, Boolean registerInstallation, ISource`1 source, IProcessingContext context)
at Sitecore.Install.Installer.InstallPackage(String path, ISource`1 source, IProcessingContext context)
at Sidewalk.SC.PackageInstaller.Service.SitecorePackageInstaller.InstallPackage(String path)
--- End of inner exception stack trace ---
System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.UnauthorizedAccessException: Access to the path 'D:\Websites\CI\Website\Unicorn\Default Configuration\Core Applications\Applications\Content Editor\Context Menues\Default\Bulk Export.yml' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalDelete(String path, Boolean checkHost)
at Rainbow.Storage.SerializationFileSystemTree.WriteItem(IItemData item, String path)
at Rainbow.Storage.SerializationFileSystemTree.Save(IItemData item)
at Unicorn.Data.DataProvider.UnicornDataProvider.SaveItem(ItemDefinition itemDefinition, ItemChanges changes, CallContext context)
at Unicorn.Data.DataProvider.UnicornSqlServerDataProvider.SaveItem(ItemDefinition itemDefinition, ItemChanges changes, CallContext context)
at Sitecore.Data.DataProviders.DataProvider.SaveItem(ItemDefinition item, ItemChanges changes, CallContext context, DataProviderCollection providers)
at Sitecore.Data.DataSource.SaveItem(ID itemID, ItemChanges changes)
at Sitecore.Data.Engines.EngineCommand`2.Execute()
at Sitecore.Data.Engines.DataEngine.SaveItem(Item item)
at Sitecore.Data.Managers.ItemProvider.SaveItem(Item item)
at Sitecore.Data.Items.ItemEditing.AcceptChanges(Boolean updateStatistics, Boolean silent)
at Sitecore.Install.Items.ItemInstaller.VersionInstaller.InstallVersion(Item version)
at Sitecore.Install.Items.ItemInstaller.VersionInstaller.PasteVersion(XmlNode versionXml, Item target, VersionInstallMode mode, IProcessingContext context, Boolean removeOtherVersions)
at Sitecore.Install.Items.ItemInstaller.InstallEntry(PackageEntry entry)
at Sitecore.Install.Items.ItemInstaller.Flush()
at Sitecore.Install.Framework.SinkDispatcher.Flush()
at Sitecore.Install.Utils.EntrySorter.Flush()
at Sitecore.Install.Framework.EntryBuilder.Flush()
at Sitecore.Install.Zip.PackageReader.Populate(ISink`1 sink)
at Sitecore.Install.Installer.InstallPackage(String path, Boolean registerInstallation, ISource`1 source, IProcessingContext context)
at Sitecore.Install.Installer.InstallPackage(String path, ISource`1 source, IProcessingContext context)
at Sidewalk.SC.PackageInstaller.Service.SitecorePackageInstaller.InstallPackage(String path)
--- End of inner exception stack trace ---
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at Sidewalk.SC.PackageInstaller.Client.ServiceReference.SitecorePackageInstaller.InstallPackage(String path) in C:\Projects\PackageInstaller\Sidewalk.SC.PackageInstaller.Client\Web References\ServiceReference\Reference.cs:line 88
at Sidewalk.SC.PackageInstaller.Client.Program.Main(String[] args) in C:\Projects\PackageInstaller\Sidewalk.SC.PackageInstaller.Client\Program.cs:line 281
Where you can see the inner exception is trying to save the item to disk at Rainbow.Storage.SerializationFileSystemTree.WriteItem(IItemData item, String path)
Update
Just so everyone is aware, the issue is related to my CI environment, and I am getting the error as part of the deployment process.
Update 2
I have read the blog post, http://kamsar.net/index.php/2015/10/Unicorn-Introducing-Transparent-Sync/, and I am obviously still understanding something.
There is the following text:
Note: you must perform an initial serialization of a configuration with Transparent Sync off before you enable it. Otherwise the items in the configuration will seem to disappear as transparent sync shows all zero items that are on disk!
Turning transparent sync on is really easy: take the you want to add transparent sync to and put this line in it:
and
Once Transparent Sync is enabled all you have to do is change items on disk and the updates will immediately appear within Sitecore.
Reading that, I assume that if you can turn transparent sync on, then you can turn it off again.
Reviewing the readme at https://github.com/kamsar/Unicorn I assume that to sync on your other environments, after doing a deployment, you can issue an http query to the control panel using the powershell.
If you cannot turn off transparent sync, then what is the best practice for stopping transparent sync when I deploy to my CI environment? and using powershell to do the update.
At present I only want transparent sync to work in development environments
I think you're misunderstanding Transparent Sync.
What it does is; it allows for updated YML to be immediately reflected in Sitecore without you performing a new sync. It does this by sneakily data providing the changes into Sitecore. This is useful for when you've just pulled from GIT or if you're switching between branches - takes away the hassle of having to sync up (or forgetting to).
What it does NOT do, is disable automatic synchronization of your Sitecore changes. These get written to disk all the time, for whatever areas of the content tree that Unicorn has been told to control.
So in fact, almost the opposite of what you write; "This may be my misunderstanding, but I thought that if transparent sync is disabled, then when changes are made into Sitecore, you have to go to the unicorn control panel and sync all the modifications manually. So why then am I getting errors about not being able to write changes to disk when transparent sync is not enabled."
Reference: http://kamsar.net/index.php/2015/10/Unicorn-Introducing-Transparent-Sync/