Git Product home page Git Product logo

unicorn's Introduction

la la la la

Unicorn is a utility for Sitecore that solves the issue of moving templates, renderings, and other database items between Sitecore instances. This becomes problematic when developers have their own local instances - packages are error-prone and tend to be forgotten on the way to production. Unicorn solves this issue by writing serialized copies of Sitecore items to disk along with the code - this way, a copy of the necessary database items for a given codebase accompanies it in source control.

For basic usage, Unicorn has two moving parts:

  • Data provider - The default Sitecore data provider is extended to automatically serialize item changes as they are made to Sitecore. This means that at any given time, what's serialized is the "master copy."
  • Control panel - this tool (/unicorn.aspx) is a page that can sync the state of Sitecore to the state stored on disk (respecting presets and exclusions). You do this after you pull down someone else's serialized changes from source control.

Unicorn avoids the need to manually select changes to merge unlike some other serialization-based solutions because the disk is always kept up to date by the data provider. This means that if you pull changes in from someone else's Sitecore instance you will have to immediately merge and/or conflict resolve the serialized files in your source control system - leaving the disk always the master copy of everything. Then if you execute the sync page, the merged changes are synced into your Sitecore database. Unicorn uses the Rainbow serialization engine, which uses some format enhancements that make it far simpler to merge than the Sitecore default format.

Is this like TDS?

Unicorn solves some of the same issues as Hedgehog's TDS. The major difference in approach is that because Unicorn forces all of the merging to be done on the disk, you never have to manually select what to update when you're running a sync operation or remember to write changed items to disk. Unless you have actual collisions, this saves a lot of time because you can take advantage of Git, SVN, TFS, etc to do automerges for you. That said, TDS and Unicorn have different feature sets and goals. TDS is a monolithic product with commercial support and marketing that does a lot more than just serialization. Unicorn is relatively simple, free and open source, and does one thing well. Use whatever makes you happy :)

Initial Setup

  • Upgrading from Unicorn 3? Great: it's just a NuGet upgrade away. From Unicorn 2.x, you can follow the same directions for 2.x->3.x to go from 2 to 4.
  • You'll need Sitecore 7 or later (including 8.x).
  • Install Unicorn. This is as simple as adding the Unicorn NuGet package to your project.
  • When you install the NuGet package, a README file will come up in Visual Studio with help to get you started.

Using Unicorn

When using Unicorn it's important to follow the expected workflow.

  • When you update/pull from your source control system, execute the Sync operation using /unicorn.aspx if any changes to .yml files were present. Note: Unicorn supports transparent syncing which allows you to skip this step during development.
  • When you commit to source control, include your changed items along with your code changes. Unicorn will automatically serialize item changes you make in Sitecore to items that match the predicate(s) configured.
  • Conflicts in items are resolved at the source control level - at any given time, the disk is considered the master copy of the Sitecore items (due to local changes being automatically serialized as they're made)

Unicorn Features

There are a few special features that Unicorn has that are worth mentioning.

  • You can define multiple configurations, which allow you a lot of flexibility: you can serialize items to different places on disk, set up groups that can be synced separately, and override any aspect of Unicorn in each configuration. Configurations may also define dependencies between each other to enforce a hierarchy.
  • Using Rainbow gives Unicorn a unique, easy to manage serialization format and hierarchy.
  • Unicorn rejects "inconsequential" changes to items. The Sitecore Template Editor likes to make a lot of item saves that change nothing but the last modified date and revision. These are ignored to reduce churn in your source control.
  • During a sync operation, Unicorn can detect improperly merged renamed items (e.g. two serialized items with the same ID in different files) and will report that fact as an error.
  • Automatic retries are performed in the event of a load failure during a sync, which means that syncing items with a missing template along with the template itself in the same sync session will work correctly.
  • Unicorn's logging routines report on exactly what was changed about a deserialized item (changed fields, added/removed versions, moved, renamed, etc)
  • The control panel writes all console output - e.g. of a sync - to both the screen and the Sitecore log file. This provides a handy audit trail of what synchronizations did in the event of someone asking where an item went.
  • You can use FieldFilters to ignore deserialization and changes to specific fields you don't want to sync.
  • The automatic serialization cannot be blocked by event disabling code because it runs at a data provider level.
  • Content editor warnings are shown for items that Unicorn is controlling.
  • You can define custom ways to compare fields, if there are equivalencies that are more complex than string equality
  • There are event pipelines that can be used to hook to sync events. These can be used, for example, to auto-publish synced items.
  • Transparent syncing allows the data provider to read directly from the serialized items on disk, making them appear directly in Sitecore.
  • Super-fast syncing with the 'Dilithium' direct-SQL item reading engine (optional, considered mostly stable but still experimental)
  • Integration with Sitecore PowerShell Extensions to perform Unicorn tasks

You can find further details about Unicorn 4 at Kam's blog:

There is also a series of blog posts detailing Unicorn 3 (and why the Rainbow serialization format exists) at Kam's blog, which are still relevant:

Best Practices

  • If using Helix architecture plan to use one Unicorn configuration per module. You can use Unicorn 4's configuration conventions to avoid repetition and promote a consistent item architecture across modules.
  • If using Sitecore 9 or the Sitecore Configuration Roles module, the Unicorn configuration files are automatically enabled or disabled based on the server role that they are deployed to. If not, make sure to enable and disable configuration files appropriately when developing, and deploying to CE/CM and CD environments. Each config file has a comment header that details when it should be enabled and disabled. Most important is to disable the data provider config when deployed.
  • Always automate your deployments of Unicorn items (see Automated Deployment below). This ensures a consistent item state during deployments.
  • Consider automating local development Unicorn syncing using scripts (e.g. PowerShell or Gulp), which can enable you to have a one-click "post-pull" experience that both builds your projects and syncs any item changes in. Sitecore Habitat does this using a combination of Gulp and the Unicorn PowerShell API.

Automated Deployment

With Unicorn you've got two options for automated deployment of item changes, for example from a Continuous Integration server or production deploy scripts.

Use Transparent Sync

When using Transparent Sync, the items on disk magically appear in Sitecore without syncing. So one automated deployment option is to simply use Transparent Sync and copy your updated serialized items to the deployment target alongside your code. This is advantageous because it's simple to set up and requires no direct intervention with the deployed server after deployment (e.g. a HTTP call).

Use the Automated Tool API

Unicorn has an automated tool API whereby you can invoke actions in the Unicorn control panel from a script, such as invoking a sync after a code deployment.

NOTE: Automated Tool API is completely overhauled in Unicorn 3.1 and later, and these instructions are for 3.1+ only

Tools are authenticated using a shared secret between the tool and the Sitecore server running Unicorn, which is relayed via CHAP+HMAC-SHA512. The practical upshot of this is that the shared secret never travels over the wire, the authentication key is unique every time, and replay attacks are not possible. You should still use the tool API over a TLS (SSL) connection if possible.

Calls to the control panel from an automated tool behave a little differently from interactive control panel sessions. Specifically:

  • Automated calls are not streaming (nothing is written to the response until everything is complete)
  • Automated calls return HTTP 500 if an error occurs (interactive calls that fail return HTTP 200, because the HTTP headers have been sent long before the error occurs). In the example PS script above, this will throw a PowerShell exception.
  • The output is text formatted, instead of HTML formatted, so it is much easier to read in logs.

Ok, ok. Shut up about crypto and tell me how to set it up.

  1. Generate a very long random shared secret key, preferably using a password generator. There are no limits on character count, character types, etc but it must be > 30 characters.
  2. Install the shared secret into the Unicorn.UI.config file - or a patch thereof, under the authenticationProvider/SharedSecret node. There are comments to help.
  3. To call the tool API from a script, a PowerShell module is provided. Acquire the module and its supporting files from the packages\Unicorn.version\tools\PSAPI folder of where you installed the Unicorn NuGet package. (Alternatively, it's also in doc\PowerShell Remote Scripting folder of the Unicorn git repository, however this is always the latest and not necessarily matching your installed Unicorn version)
  4. Review the sample.ps1 file and adapt it to your needs, including putting the shared secret into it and setting the URL as needed. Don't worry the guts of sample.ps1 are two simple lines of code :)

NOTE: When deploying to a Content Editing or Content Delivery server, the Unicorn configuration should be trimmed down from development. Each config file in App_Config/Include/Unicorn has comments at the top designating what environment(s) it should live on. If you opt to use Transparent Sync as a deployment mechanism, make sure you do not disable the data provider config file.

Darren Guy has written a practical dissertation on his experiences setting up Unicorn 3 with TeamCity and Octopus Deploy that goes all the way from install to automated deployment. A recommended read if you're wanting to use a similar setup.

Andrew Lansdowne has also written a post (for version 1, so some of it is outdated but the concepts still apply) about setting up Unicorn with TeamCity and WebDeploy that may be useful when setting up automated deployments.

Unicorn's Sync Rules

Note: these rules concern the default Evaluator only. This is probably what makes sense for most people, but be aware you can plug in and change all of this: for example the NewItemsOnlyEvaluator only writes new items into Sitecore and ignores all others (see Unicorn.Configs.NewItemsOnly.example in the config folder for an example)

  • The disk is considered the master at all times. Because the Unicorn data provider is automatically serializing item changes as they are made in Sitecore, changes you make are already serialized. Others' serialized updates from source control merge just like code.
  • "Changed" items are determined by any difference in field values (in shared or versioned fields, across all versions).
  • Items that exist in Sitecore but not on disk are deleted, because the disk is the master.

Pitfalls

  • Don't use Unicorn if you have a shared Sitecore database unless only one person is writing changes to it. If person A makes changes, then person B syncs to the shared database, person A's changes will be lost because B's disk is the master. Do not use a shared Sitecore database!
  • Don't use Unicorn to serialize actively versioned or workflow-enabled content (e.g. non-developer items). You can easily have two people create totally different "version 2" (or even v3, overwriting someone else's v2) content on different locations, and merging those is probably not what you want. It may be relatively safe during initial development if sharing test content, but be wary.

Manual Installation/Install from Source

  • Clone the repository
  • Place a copy of your Sitecore.Kernel.dll assembly in /lib/sitecore/v7 (for v7/v8)
  • Build the project for your Sitecore version using Visual Studio 2012 or later
  • Copy Unicorn.dll, Rainbow.dll, Rainbow.Storage.Sc.dll, Rainbow.Storage.Yaml.dll and Kamsar.WebConsole.dll to your main project in whatever fashion you wish (project reference, as binary references, etc)
  • Copy Standard Config Files\*.config to the App_Config\Include\Unicorn folder
  • Configure to your liking; the setup README file is a good starting point.
  • Hit $yoursite/unicorn.aspx to perform initial serialization of your configured predicate

Advanced Usage and Customization

Unicorn uses a very flexible configuration system based on Dependency Injection that allows you to plug in your own rules for almost any part of what Unicorn does.

Configurations

The IConfiguration is the heart of all Unicorn customizations. This is an abstracted IoC container that contains registrations for all other pluggable types. The container is Unicorn's own very tiny purpose built IoC container 'Micro', and it does not depend on any other DI libraries.

But wait, there's more. You can configure more than one IConfiguration using the IConfigurationProvider. The default provider is registered in Unicorn.config (configurationProvider element). It reads configuration from...the Unicorn.config. The defaults element defines the standard dependency configuration, and the configurations/* elements define custom configurations that can override the defaults. Each dependency type can have non-DI constructor params (string or bool) passed to it by adding XML attributes to the main declaration - e.g. <foo type="..." bar="hello"> would pass "hello" to public MyType(string bar). You can also receive any XML body passed to the dependency to a configNode XmlNode parameter. This is how the SerializationPresetPredicate defines its preset.

Evaluator

The evaluator is a very powerful thing to customize. Evaluators are responsible for:

  • Detecting if a Sitecore item and a serialized item have a change that is a "difference"
  • Deciding what to do if a difference is there (overwrite Sitecore? overwrite serialized?)
  • Deciding what to do with orphan items (items that are not serialized, but exist in Sitecore - the default would delete them)

For examples check out Unicorn.Evaluators.SerializedAsMasterEvaluator, which uses the Rainbow ItemComparer to compare items.

Predicate

The predicate is another powerful customization. Predicates define what items get included and excluded from Unicorn - for both automatic serialization and the sync process.

The default predicate uses serialization presets, but it's easy to imagine other possibilities such as a rules engine based preset.

For examples see Unicorn.Predicates.SerializationPresetPredicate

Field Filter

The Field Filter is a way to exclude certain fields from being controlled by Unicorn. Note that the control is not complete in that the value of ignored fields is never stored; it is stored and updated when other fields' values that are included change. However it is never deserialized or considered in the evaluator, and thus the value is effectively ignored.

For examples see Rainbow.Filtering.ConfigurationFieldFilter

Target Data Store

The target data store defines where we are writing serialized items to. The default target data store uses Rainbow's SFS tree structure and YAML serialization formatter.

For examples see the Rainbow project's various IDataStore implementations.

Source Data Store

The source data store is another Rainbow IDataStore that defines where we read values from and sync values to. Normally this is the Rainbow Sitecore data store, however you could also hook up a sync say between two separate serialization formats, or a serialization database - your imagination is the limit :)

Loader

The loader class encapsulates the logic of walking the tree in the Serialization Provider and comparing it to the tree in the Source Data Provider. It checks the Predicate to determine inclusion, and invokes the Evaluator to determine how to deal with changes.

Normally this will not require customization, as its dependencies provide the extension points.

Example: Unicorn.Loader.SerializationLoader

Data Provider Architecture

There are two components to the Unicorn data provider: the database-specific implementation, and the Unicorn implementation.

The Unicorn implementation is an individual configuration of Unicorn dependencies that get automatic serialization. For example, if you were serializing two presets you'd need two instances of UnicornDataProvider - one for each IPredicate implementation.

The database specific implementation is a subclass of the original Sitecore data provider that provides a container for one or more UnicornDataProvider instances. Out of the box, a UnicornSqlServerDataProvider is provided. You could roll your own if you're on Oracle. This provider is effectively an unblockable event handler that allows Unicorn to trap item changes even if the evil EventDisabler class is being used.

If you want to wire multiple Unicorn data providers to your database, you create a class that derives from UnicornSqlServerDataProvider. In this class you can select to:

  • Create a constructor that injects your provider(s) using the base constructor:

      public MyDataProvider(string connectionString) : base(connectionString, new UnicornDataProvider(), new UnicornDataProvider(), ...)
    
  • Create a constructor that injects your provider(s) using code (this is better if you have to construct dependencies, etc that don't fit well in a base call):

       public MyDataProvider(string connectionString) : base(connectionString, null)
       {
      	AddUnicornDataProvider(new UnicornDataProvider());
      	// ...
       }
    

TL;DR

Well you just read that didn't you? If you have questions or bugs, feel free to open an issue.

You can also find help on Sitecore Community Slack in #unicorn or on Twitter (@kamsar).

unicorn's People

Contributors

ajh79 avatar akuryan avatar alan-null avatar andersrasmussen avatar blipson89 avatar cassidydotdk avatar coreyasmith avatar dottech avatar eldblom-zz avatar jamesskemp avatar jlcmad avatar jonne avatar jorrit avatar kamsar avatar michaellwest avatar mortenbock avatar olegjytnik avatar petersondave avatar pgrimaud avatar puddster avatar sebastiantecsi avatar yousleepy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unicorn's Issues

Unicorn is taking 5 Hours to complete sync Operation

Hi Kamsar,

We have around 15000 items created by us in sitecore.

The database size for master database is around 6 GB.

It takes around 5 hours to complete the sync operation.

We have already mitigated the system out of memory exception by increasing the ram ,etc.

Please suggest ways to reduce the sync time.

We have excluded item for time being in order to process items faster.

Many Thanks

Delete before Update

In TDS there was a feature to delete before update, is this how serialization currently behaves?

In TDS at least, this only impacted standard values. If I create an item, then update the standard values, the item will not inherit the changes as it was already created. So in TDS we would have it delete everything, create the templates first, then create the content items. It would then act as if the item was created for the first time, and inherit the new standard values. In early development this was really useful as templates are usually in flux for awhile.

It appears Unicorn/serialization works this way but wanted to see if there were any caveats before continuing.

Unicorn does not trigger chaning the template of an item

Hi Kam,

yesterday I've changed the template of an item to a new template and deleted my old template. Unfortunately the "template change" on the item was not triggered by Unicorn. So after calling sync-database.aspx on a different installation I could not load the item anymore, because it still referenced the old template which does not exists anymore. The result was, that the item could not be synced and was deleted afterwards.

Can you please have a look at it? Or is this not a bug and I have to sync manually after changing the template of an item? If yes, it is possible to skip sync of this item with an error/warning, but let the item in the database? I mean, if someone forgot to sync the item manually, the item would still be there :)

King regards,
Kevin

Could not resolve type name: Unicorn.UnicornSqlServerDataProvider, Unicorn (method: Sitecore.Configuration.Factory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert)).

I tried to install Unicorn 3.0 RC
below is the nuget package details

We are in the process of the auto deployment process with unicorn. It would be more helpful for us to resolve this issue.

I have also tried with sample config which are included while install the nuget package.

Server Error in '/' Application.

Could not resolve type name: Unicorn.UnicornSqlServerDataProvider, Unicorn (method: Sitecore.Configuration.Factory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert)).

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Exception: Could not resolve type name: Unicorn.UnicornSqlServerDataProvider, Unicorn (method: Sitecore.Configuration.Factory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert)).

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[Exception: Could not resolve type name: Unicorn.UnicornSqlServerDataProvider, Unicorn (method: Sitecore.Configuration.Factory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert)).]
Sitecore.Diagnostics.Error.Raise(String error, String method) +137
Sitecore.Configuration.Factory.CreateType(XmlNode configNode, String[] parameters, Boolean assert) +293
Sitecore.Configuration.Factory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert) +58
Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +131
Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert) +579
Sitecore.Configuration.Factory.CreateFromReference(XmlNode configNode, String[] parameters, Boolean assert) +137
Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +109
Sitecore.Configuration.Factory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert) +961
Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) +552
Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +275
Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert) +579
Sitecore.Configuration.Factory.GetDatabase(String name, Boolean assert) +144
Sitecore.Configuration.Factory.GetDatabase(String name) +42
Sitecore.Configuration.Factory.GetDatabases() +98
Sitecore.Data.Managers.HistoryManager.InitializeEventHandlers() +35
Sitecore.Pipelines.Loader.InitializeManagers.Process(PipelineArgs args) +41
(Object , Object[] ) +71
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +331
Sitecore.Nexus.Web.HttpModule.Application_Start() +228
Sitecore.Nexus.Web.HttpModule.Init(HttpApplication app) +673
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +618
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +419
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +343

[HttpException (0x80004005): Could not resolve type name: Unicorn.UnicornSqlServerDataProvider, Unicorn (method: Sitecore.Configuration.Factory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert)).]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +579
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +120
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +712

Feature request : Security serialization/revert

Hi,

I've been using Unicorn in my latest Sitecore implementation and it's been a great help.
One thing I'd love to see added though is a means to serialize and revert specific domains, roles and users with Unicorn.

Typically I leave the Sitecore domains and roles alone, but for most projects I usually add a domain for the project and some roles for them, and also include those roles into my source control.
Sitecore serializes those into a \serialization\security\ folder.

It would be cool if the Unicorn serialization.config would
%lt;include database="security" path="/xyz/Roles/ContactRole" /%gt;
%lt;include database="security" path="/xyz/Roles/LeadRole" /%gt;
%lt;include database="security" path="/xyz/Users/CustomerAdminUser" /%gt;

Kind regards,

Unable to build project with Sitecore 6.5

Using Sitecore 6.5 Sitecore.Kernel.dll
In SerializationLoader, cannot resolve

using Sitecore.Data.Serialization.Exceptions

Which version of Sitecore does Unicorn require?

Yellow screens when used with uCommerce: Unknown connection string. Name: '$(1)'

On a blank install of Sitecore 7.2 140526, and uCommerce 6, I get the following exception "Unknown connection string. Name: '$(1)'". We suspect it may be something to do with the fact that uCommerce items are also data provided and live under /sitecore/ucommerce

Can you point us in the right direction?

Thanks for the great module,
Steve

[InvalidOperationException: Unknown connection string. Name: '$(1)']
Sitecore.Configuration.Settings.GetConnectionString(String connectionStringName) +364
Sitecore.Configuration.Factory.CreateFromConnectionStringName(XmlNode configNode, String[] parameters, Boolean assert) +106
Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +164
Sitecore.Configuration.Factory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert) +117
Sitecore.Configuration.Factory.GetConstructorParameters(XmlNode configNode, String[] parameters, Boolean assert) +206
Sitecore.Configuration.Factory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert) +106
Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +141
Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert) +666
Sitecore.Configuration.Factory.CreateFromReference(XmlNode configNode, String[] parameters, Boolean assert) +198
Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +118
Sitecore.Configuration.Factory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert) +1090
Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) +577
Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +296
Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert) +666
Sitecore.Configuration.Factory.GetDatabase(String name, Boolean assert) +185
Sitecore.Configuration.Factory.GetDatabases() +168
Sitecore.Data.Managers.HistoryManager.InitializeEventHandlers() +49
Sitecore.Pipelines.Loader.InitializeManagers.Process(PipelineArgs args) +38
(Object , Object[] ) +80
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +365
Sitecore.Nexus.Web.HttpModule.Application_Start() +172
Sitecore.Nexus.Web.HttpModule.Init(HttpApplication app) +516
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +530
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475

[HttpException (0x80004005): Unknown connection string. Name: '$(1)']
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12601936
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12441597

Licensing

What license is this released under? Was wondering if it was available for commercial use.

Items with the same name causes duplicate ID error

Steps to reproduce:

  1. Create a new item (e.g. a new folder named "Foo" under /sitecore/templates
  2. Create a second item in the same folder and with the same name
  3. Update the first item (e.g. create a new version in another language)
  4. Perform Unicorn Sync

This will give an error similar to this:

Duplicate serialized item IDs were detected ({10CDD112-2E0D-4B6B-B523-C5B7D37E70A7}) - this usually indicates corruption in the serialization provider data.
Item 1: master:/sitecore/templates/Foo ({10CDD112-2E0D-4B6B-B523-C5B7D37E70A7})
Item 1 ProviderId: d:\web\paygrounds\sc72rev14122610\Data\serialization\master\sitecore\templates\Foo.item
Item 2: master:/sitecore/templates/Foo ({10CDD112-2E0D-4B6B-B523-C5B7D37E70A7})
Item 2 ProviderId: d:\web\paygrounds\sc72rev14122610\Data\serialization\master\sitecore\templates\Foo_10CDD1122E0D4B6BB523C5B7D37E70A7.item
ERROR: Consistency check failed - aborting loading. (Unicorn.Loader.ConsistencyException)
at Unicorn.Loader.SerializationLoader.DoLoadItem(ISerializedItem serializedItem, IConsistencyChecker consistencyChecker)
at Unicorn.Loader.SerializationLoader.LoadOneLevel(ISerializedReference root, IDeserializeFailureRetryer retryer, IConsistencyChecker consistencyChecker)
at Unicorn.Loader.SerializationLoader.LoadTreeRecursive(ISerializedReference root, IDeserializeFailureRetryer retryer, IConsistencyChecker consistencyChecker)
at Unicorn.Loader.SerializationLoader.LoadTree(ISerializedItem rootItem, IDeserializeFailureRetryer retryer, IConsistencyChecker consistencyChecker)
at Unicorn.Loader.SerializationLoader.LoadAll(ISerializedItem[] rootItems, IDeserializeFailureRetryer retryer, IConsistencyChecker consistencyChecker, Action`1 rootLoadedCallback)
at Unicorn.ControlPanel.SyncConsole.Process(IProgressStatus progress)

The problem is that there are 3 serialized items file:

  • Foo.item contains the first item with the first version
  • Foo_50D0D04345B34EC982F86DF15C5F8627.item contains the second item
  • Foo_FC0AB770513F453EB0F41F742FDC3141.item contains again the first item but with both versions.

The problem is that Sitecores PathUtils.GetDirectoryPath returns a path without ID as long as there is only one item in the DB with the same path, but as soon as there are two items with the same path it will return a path with the GUID inside.

Issue with __Lock fields not being checked properly

Hi,

I am currently testing version 3.0-rc5 in combination with Sitecore 6.6.
All seems to work fine but I am now experiencing an issue with __Lock fields which seem to fail the check if the need to be updated.

I have the following item, taken from the Unicorn output:

[U] master:/sitecore/templates/Branches/User Defined/Websites/Horeca Toolbox/Quiz/Quiz root/$name/Winner slide (553fcbf5-1834-4707-8fcb-90c0eaf97bf9)
> Field __Lock - nl#1: Serialized , Source 

How many times I do a re-sync, it keeps throwing this message. It also does this with other __Lock fields of other items.

The serialized data contains:

- Language: nl
  Versions:
  - Version: 1
    Fields:
    - ID: 001dd393-96c5-490b-924a-b0f25cd9efd8
      # __Lock
      Value: <r />

It does have a value equal to but this is not present in the Unicorn output. Perhaps HTML tags are not displayed properly?

Data in target Sitecore environment before and after sync:

nl version of item: <r />
en version of item: 
en-gb version of item: this language version was not created
As you can see the nl version already contains <r /> and the serialized data does as well. But Unicorn still want to update this field with every sync.

Any ideas?

Kind regards,
Dennis

Ignoring exlude path when it's the only child of parent

Hi Kam,

We've recently updated to v2.0 and figured out an issue with an exclude path. Let's say we have the following exclude path

<exclude path="/sitecore/content/Configuration/Online Services" />

And the following items in the database:

working

Because Configuration and Specifications are included in serialization, on the file system a have a Configuration.item file and also a folder called Configuration with the Specifications in. When I sync my database with this setup everything works well.

When I now delete the Specifications folder, the result is that on my file system I only have the Configuration.item. This seems to be common serialization behavior, because nothing in the Configuration-Folder is serialized and so there is no need for creating this folder on the file system. But when I now sync my database, my folder Online Services (which is excluded from the sync by my serialization.config) will be deleted.

It seems that Unicorn only looks into the file system and because there are no child items serialized for the Configuration folder, it also deletes all it's child, ignoring that the child item is excluded by the config.

Can you please have a look into it?

Many thanks and regards,
Kevin

Revision and Updated fields are always synced

Hi Kam,

I recently found that the current version of Unicorn does not ignore the fields for the revision and updated by. But according to the README on the repository root they should. This means that for every save all the affected items are synced again also if only the revision has changed.

I've also tried to ignore the fields in the configuration, but this has no impact:

<fieldPredicate type="Unicorn.Predicates.ConfigurationFieldPredicate, Unicorn" singleInstance="true">
    <exclude fieldID="{8CDC337E-A112-42FB-BBB4-4143751E123F}" note="Revision" />
    <exclude fieldID="{D9CF14B1-FA16-4BA6-9288-E8A174D4D522}" note="Updated" />
    <exclude fieldID="{BADD9CF9-53E0-4D0C-BCC0-2D784C282F6A}" note="Updated by" />
</fieldPredicate>

I'm using Unicorn 2.0.3. Can you reproduce this or is this an issue on my side?

Thanks for looking into it,
Kevin

Loosing information while moving templates

Hi Kam

Some troubles again ;-) This time with moving templates. I've created a clean Sitecore 7.2 installation with Unicorn 2.0.2 and the default configuration. I've created a new template MovingTest in /sitecore/templates/Sample/MovingTest with one field and standard values. This all was correctly serialized, see this images:

before_sitecore

before_disk

Then I moved the complete template to another folder /sitecore/templates/User Defined. While doing this I'm loosing almost all informations about the item on the diks. The only file which remains on the disk is the MovingItem.item file, the folder MovingItem with the field definitions and the standard values is missing. In Sitecore all looks fine. See the following images:

after_sitecore

after_disk

Sometimes (not always) I also got an error in Sitecore when I want to move the item (see the stacktrace at the end):

error

When receiving this error, the item was not moved, but the MovingTest folder on the disk is already deleted.

Can you please have a look into this?

Thanks and greets,
Kevin

Stacktrace:

4236 10:23:06 INFO  AUDIT (sitecore\admin): Drag item: master:/sitecore/templates/Sample/MovingTest, language: en, version: 1, id: {1E4F4958-5B0A-49E3-8F11-BBBFA99088B2} to master:/sitecore/templates/User Defined, language: en, version: 1, id: {B29EE504-861C-492F-95A3-0D890B6FCA09}
4236 10:23:06 ERROR Application error.
Exception: System.Web.HttpUnhandledException
Message: Exception of type 'System.Web.HttpUnhandledException' was thrown.
Source: System.Web
   at System.Web.UI.Page.HandleError(Exception e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Nested Exception

Exception: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at Sitecore.Nexus.Pipelines.NexusPipelineApi.Resume(PipelineArgs args, Pipeline pipeline)
   at Sitecore.Web.UI.Sheer.ClientPage.ResumePipeline()
   at Sitecore.Web.UI.Sheer.ClientPage.OnPreRender(EventArgs e)
   at Sitecore.Shell.Applications.ContentManager.ContentEditorPage.OnPreRender(EventArgs e)
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Nested Exception

Exception: System.IO.DirectoryNotFoundException
Message: Could not find a part of the path 'D:\Sitecore\Playgrounds\unicorn\Data\serialization\master\sitecore\templates\Sample\MovingTest'.
Source: mscorlib
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
   at System.IO.Directory.InternalGetFileDirectoryNames(String path, String userPathOriginal, String searchPattern, Boolean includeFiles, Boolean includeDirs, SearchOption searchOption, Boolean checkHost)
   at System.IO.Directory.InternalGetFiles(String path, String searchPattern, SearchOption searchOption)
   at Unicorn.Serialization.Sitecore.SitecoreSerializationProvider.<GetChildReferences>b__0(String path)
   at Unicorn.Serialization.Sitecore.SitecoreSerializationProvider.GetChildReferences(ISerializedReference parent, Boolean recursive)
   at Unicorn.Serialization.Sitecore.SitecoreSerializationProvider.DeleteItemRecursive(ISerializedReference reference)
   at Unicorn.Serialization.Sitecore.SitecoreSerializationProvider.DeleteSerializedItem(ISerializedReference item)
   at Unicorn.Serialization.Sitecore.SitecoreSerializationProvider.MoveSerializedItem(ISourceItem sourceItem, ISourceItem newParentItem)
   at Unicorn.UnicornDataProvider.MoveItem(ItemDefinition itemDefinition, ItemDefinition destination, CallContext context)
   at Unicorn.UnicornSqlServerDataProvider.MoveItem(ItemDefinition itemDefinition, ItemDefinition destination, CallContext context)
   at Sitecore.Data.DataProviders.DataProvider.MoveItem(ItemDefinition item, ItemDefinition destination, CallContext context, DataProviderCollection providers)
   at Sitecore.Data.DataSource.MoveItem(ID itemID, ID destinationID)
   at Sitecore.Data.Engines.EngineCommand`2.Execute()
   at Sitecore.Data.Managers.ItemProvider.MoveItem(Item item, Item destination, SecurityCheck securityCheck)
   at Sitecore.Shell.Framework.Pipelines.DragItemTo.Execute(ClientPipelineArgs args)

SerializationPresetPredicate configuration with presetName attr throws exception

Hi,

After I configured Unicorn to use shared serialization preset it started to throw exception. The configuration I did is:

<predicate type="Unicorn.Predicates.SerializationPresetPredicate, Unicorn" presetName="default" singleInstance="true" />

and

<sitecore>
    <serialization>
      <default>
        <include database="core" path="/sitecore/system/Field types"/>
      </default>
    </serialization>
</sitecore>

The exception thrown is:
Error activating IPredicate using binding from IPredicate to SerializationPresetPredicate
Several constructors have the same priority. Please specify the constructor using ToConstructor syntax or add an Inject attribute.

Constructors:
SerializationPresetPredicate(string presetName)
SerializationPresetPredicate(XmlNode configNode)

I probably misunderstood how to configure it, but have no other idea how to make it work. Could you help?

SyncTool project file missing

It is not possible to build the SyncTool assembly. I tried to recreate the project file but have not been able to get it to it building...

I think the Kamsar.WebConsole library has changed and the sync-database.aspx has not been updated to reflect this. It has broken references to AuthenticationManager and ConfigurationManager.

Unicorn not working properly with Buckets

We're happily using unicorn for a sitecore 7 project, but it fails to properly serialize the subfolders of buckets, something which clicking "Serialize Tree" in sitecore doesn't seem to have issues with.

Would be awesome if you could look into that!

"inconsequential" changes to items

We have been evaluating Unicorn for a while now and it seems to be working rather well, except that when we add/edit/delete a field within Sitecore our pending changes list shows a lot of edits that are just the version, revision and date updated for that particular template e.g:

----version----
language: en
version: 1
revision: f09e2cd1-7c20-409d-9fdf-65778c8f336d

----field----
field: {8CDC337E-A112-42FB-BBB4-4143751E123F}
name: __Revision
key: __revision
content-length: 36

31a9c5c9-672b-4c7b-9841-59b08d140165

----field----
field: {D9CF14B1-FA16-4BA6-9288-E8A174D4D522}
name: __Updated
key: __updated
content-length: 34

20140902T094036:635452476360564977

I'm not entirely sure if we are missing some piece of config or if this is even avoidable but it seems fair enough, it's just I read the inconsequential changes feature and it sounds like it would prevent these changes?

Multiple Different Errors Upon Reserialization of Configured Items

For seemingly no reason, I am getting two different kinds of errors upon trying to "Reserialize Default Configuration Now" in the control panel.

The first error is like the following, and seems to change the path that it throws at random:

ERROR: Access to the path 'Random Path in the serialization folder' is denied. (System.UnauthorizedAccessException)
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) 
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 Unicorn.Serialization.Sitecore.SitecoreSerializationProvider.DeleteItemRecursive(ISerializedReference reference) 
at Unicorn.Serialization.Sitecore.SitecoreSerializationProvider.DeleteItemRecursive(ISerializedReference reference) 
at Unicorn.Serialization.Sitecore.SitecoreSerializationProvider.DeleteItemRecursive(ISerializedReference reference) 
at Unicorn.Serialization.Sitecore.SitecoreSerializationProvider.DeleteItemRecursive(ISerializedReference reference) 
at Unicorn.Serialization.Sitecore.SitecoreSerializationProvider.DeleteSerializedItem(ISerializedReference item) 
at Unicorn.ControlPanel.ReserializeConsole.Process(IProgressStatus progress)

The second error is consistent and happens when it reaches sitecore/layout and hasn't already crashed from the previous error:

ERROR: Object reference not set to an instance of an object. (System.NullReferenceException)
at Sitecore.Data.Serialization.ItemSynchronization.BuildSyncItem(Item item) 
at Unicorn.Serialization.Sitecore.SitecoreSerializationProvider.SerializeItem(ISourceItem item) 
at Unicorn.ControlPanel.ReserializeConsole.Serialize(ISourceItem root, IPredicate predicate, ISerializationProvider serializationProvider, ILogger logger) 
at Unicorn.ControlPanel.ReserializeConsole.Serialize(ISourceItem root, IPredicate predicate, ISerializationProvider serializationProvider, ILogger logger) 
at Unicorn.ControlPanel.ReserializeConsole.Serialize(ISourceItem root, IPredicate predicate, ISerializationProvider serializationProvider, ILogger logger) 
at Unicorn.ControlPanel.ReserializeConsole.Process(IProgressStatus progress)

I have tried reinstalling Unicorn multiple times. I get the same errors as above if I first delete the serialization folder and try to do the initial setup in the control panel again.

Azure Powershell issues

Due to a known issue with Invoke-WebRequest on Azure we have to do this:

$req = [System.Net.WebRequest]::Create($url)
$req.Headers.Add("Authenticate", $deploymentToolAuthToken)
$result = $req.GetResponse()

And invoke the WebRequest object directly. Powershell is doing something with IO buffers that is borked on Azure:

projectkudu/kudu#877

Everything else works great, thought a note on the ReadMe would be nice. Thanks!

Integration with TFS server workspace not possible?

Hello,

We use unicorn in combination with Visual Studio 2013 and TFS 2013.

When I make a change to an existing item in Sitecore, Unicorn tries to change the associated item on disk, but then raises an error: access to the path ... is denied. Also, the item in the serialization project is NOT checked out.

My Workspace is a "server workspace". All items on disk are read-only. Unicorn seems to have no rights to check out an item, make the item on disk writable and write changes to it.

Other developers in my team have a "local workspace". All their items on disk have the read-only flag NOT set. Unicorn is able to check the item out in TFS and make changes to the file on disk.

But I want to keep using a server workspace. Its performance is better when you have lots of items. TFS 2013 introduced the concept of a local workspace. Workspaces in earlier TFS versions were always on the server.

Is Unicorn not capable of working in combination with a TFS server workspace?

Thank you for your advice!

Greetings,
Jeroen

Support for field sharing changes

Hi,

We experience a conceptual issue / missing feature of Unicorn (This is a Feature request =)).

If i change the sharing setting of a field from Shared to Versioned, Sitecore triggers a background job to move all field data of this field from the SharedFields into the VersionedFields table. The sharing type is correctly changed and serialized trough Unicorn. Everything is fine on my machine.

Howevery, if another developer deserialises the changes on his machine, the field is set to unshared, but the data remains in the SharedFields table which makes field value changes impossible on the depending items. Every time you want to change an item value (the shared value is shown in every version), the change is silently ignored and the old value appears again after reloading the item.

There are some methods in the FieldSharingConverter class (which is placed inside the SqlDataProvider class) to change the values for a specific field id (e.g. MakeVersioned with a parameter in which the old sharing type is provided). Those methods seem to be triggered in the Content Editor after changing such a sharing flag.

Feature request:
Detect changes in the field sharing settings while syncing and update the database inside your DataProvider to leave the items intact (This can be an asynchronous task per changed field).

Regards,
Pascal

renaming a template fails

if i rename a template that already has fields created on it and hit save, the sub-items try to be serialized to a folder under the new name of the template but this does not yet exist so the serialization fails and on the next sync the fields for the template are deleted

Problem with serialization on change not working with Sitecore 7.5, need guidance on debugging

We've setup Unicorn in our Sitecore dev environment to persist out our local SC changes to disk and sync between local instances. However, I've run into a problem where after I change an item in my local instance of Sitecore (I added 2 fields to a template), the change isn't persisted out to my serialization folder.

I've checked the serialization config, the root path is correct. I checked the predicate config, the path to my template is included in the serialization config. I checked the permissions on my serialization folder, they look correct. I even granted everyone full control temporarily; that didn't help. I checked the Sitecore logs, other than mentioning that the Unicorn.dll was loaded, no mention of Unicorn in the logs. This issue seems to only affect me, others on the team aren't experiencing the issue.

Unicorn sync works for me though, I'm able to successful import our serialized Sitecore data tree to my local instance of Sitecore. Unicorn also adds info to the logs for the sync.

I've cloned the Unicorn repo and am attempting to debug. What's the best place to set a break point to trap the on change handler of Unicorn so I can step through the code and see what's going on?

Illegal characters in path. when include content tree for serialization

We are planning to use unicorn to setup the new instance after serialize all the items from sitecore from dev env. It was working fine without content tree. When we include the content tree we are getting the below issue. Is there a way to access the log info so that we would find out exactly which items throwing exception.

Default Configuration is being reserialized
[D] Clearing existing items from Serialization File System Data Store
[U] Serializing included items under root core:/sitecore/system/Field types (76e6d8c7-1f93-4712-872b-da3c96b808f2)
[U] Serializing included items under root core:/sitecore/system/Settings (087e1ea5-6280-4575-9e70-85b588db91b2)
[U] Serializing included items under root core:/sitecore/content/Documents and settings/All users (78415f9a-e2f7-4b61-8a99-81c75904f1b1)
[U] Serializing included items under root core:/sitecore/content/Applications (c74ac643-53c8-4f1e-9508-840cdc72aaca)
[U] Serializing included items under root master:/sitecore/layout (eb2e4ffd-2761-4653-b052-26a64d385227)
[S] master:/sitecore/layout/Simulators (39522e9a-9b6e-4cb4-850c-23d0d3adfd0c) because Item path exclusion rule
[S] master:/sitecore/layout/Renderings/System (f4008f10-bbb2-4565-b652-467491361d5a) because Item path exclusion rule
[S] master:/sitecore/layout/Layouts/System (6e14276a-fd7f-40ec-9880-4ea96135ae9d) because Item path exclusion rule
[U] Serializing included items under root master:/sitecore/system (13d6d6c6-c50b-4bbd-b331-2b04f1a58f21)
[S] master:/sitecore/system/Aliases (5f094fe4-cc4b-40fd-9377-9ab00e7f7ca5) because Item path exclusion rule
[S] master:/sitecore/system/Marketing Center (33cfb9ca-f565-4d5b-b88a-7cdfe29a6d71) because Item path exclusion rule
[S] master:/sitecore/system/Publishing targets (d9e44555-02a6-407a-b4fc-96b9026caadd) because Item path exclusion rule
[S] master:/sitecore/system/Tasks/Schedules (a705d262-5714-4880-9962-051e25f1416d) because Item path exclusion rule
[U] Serializing included items under root master:/sitecore/templates (3c1715fe-6a13-4fcf-845f-de308ba9741d)
[S] master:/sitecore/templates/System (4bf98ef5-1d09-4dd1-9afe-795f9829fd44) because Item path exclusion rule
[S] master:/sitecore/templates/Branches/System (c93c0945-607b-4916-b8d9-fe9f9ba783ca) because Item path exclusion rule
[U] Serializing included items under root master:/sitecore/content (0de95ae4-41ab-4d01-9eb0-67441b7c2450)
ERROR: One or more errors occurred. (System.AggregateException)
at Unicorn.SerializationHelper.DumpTreeInternal(IItemData root, IPredicate predicate, ITargetDataStore serializationStore, ISourceDataStore sourceDataStore, ILogger logger)
at Unicorn.SerializationHelper.DumpTree(IItemData item, IConfiguration configuration)
at Unicorn.ControlPanel.ReserializeConsole.Process(IProgressStatus progress)
Illegal characters in path. (System.ArgumentException)
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
at System.IO.Path.GetDirectoryName(String path)
at Rainbow.Storage.SerializationFileSystemTree.WriteItem(IItemData item, String path)
at Unicorn.SerializationHelper.DumpItemInternal(IItemData item, IPredicate predicate, ITargetDataStore targetDataStore)
at Unicorn.SerializationHelper.<>c__DisplayClass5.b__4()

Completed. Want to return to the control panel?

Error moving item from non-tracked area to tracked area?

I moved a template from a folder which is not syncronised by Unicorn, into a folder that is synchronised, and got this exception:

Server Error in '/' Application.

Could not find a part of the path 'C:\workingsvn\website\trunk\src\website\website.Website\App_Data\Serialization\master\sitecore\templates\website\Base\website Base'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\workingsvn\website\trunk\src\website\website.Website\App_Data\Serialization\master\sitecore\templates\website\Base\website Base'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[DirectoryNotFoundException: Could not find a part of the path 'C:\workingsvn\website\trunk\src\website\website.Website\App_Data\Serialization\master\sitecore\templates\website\Base\website Base'.]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +667
System.IO.FileSystemEnumerableIterator1.CommonInit() +162 System.IO.FileSystemEnumerableIterator1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler1 resultHandler, Boolean checkHost) +667 System.IO.DirectoryInfo.InternalGetFileSystemInfos(String searchPattern, SearchOption searchOption) +88 Unicorn.Serialization.Sitecore.SitecoreSerializationProvider.DeleteSerializedItem(ISerializedReference item) +159 Unicorn.Serialization.Sitecore.SitecoreSerializationProvider.MoveSerializedItem(ISourceItem sourceItem, ISourceItem newParentItem) +666 Unicorn.UnicornDataProvider.MoveItem(ItemDefinition itemDefinition, ItemDefinition destination, CallContext context) +349 Unicorn.UnicornSqlServerDataProvider.MoveItem(ItemDefinition itemDefinition, ItemDefinition destination, CallContext context) +192 Sitecore.Data.DataProviders.DataProvider.MoveItem(ItemDefinition item, ItemDefinition destination, CallContext context, DataProviderCollection providers) +137 Sitecore.Data.DataSource.MoveItem(ID itemID, ID destinationID) +212 Sitecore.Data.Engines.EngineCommand2.Execute() +119
Sitecore.Data.Managers.ItemProvider.MoveItem(Item item, Item destination, SecurityCheck securityCheck) +390
Sitecore.Shell.Framework.Pipelines.DragItemTo.Execute(ClientPipelineArgs args) +250

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +56
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +565
System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +35
Sitecore.Nexus.Pipelines.NexusPipelineApi.Resume(PipelineArgs args, Pipeline pipeline) +389
Sitecore.Web.UI.Sheer.ClientPage.ResumePipeline() +357
Sitecore.Web.UI.Sheer.ClientPage.OnPreRender(EventArgs e) +456
Sitecore.Shell.Applications.ContentManager.ContentEditorPage.OnPreRender(EventArgs e) +25
System.Web.UI.Control.PreRenderRecursiveInternal() +180
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4048

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18446

Is this a bug?
Thanks

Issue with Placeholder field and content as a standard value

Every time I do a re-sync, the following is displayed in the output:

[U] master:/sitecore/layout/Sublayouts/Websites/Horeca Toolbox/Social Content Generator/SCG About (427141c2-a17c-48e6-80a3-628716e3ca83)
> Field Placeholder - Serialized content, Source

In the source database this field value is equal to 'content', it is shared and not a standard value, it is set in the item.
In the target database this field value is also equal to 'content' but here it is a shared field and a standard value, so not yet set in the item.
When I create a new sublayout in the source database the field value is set to 'content', a shared field and also a standard value.

When Unicorn does a sync with the target it reads an empty value from the item (correct). But persisting the 'content' value from the serialized item is not done because perhaps Sitecore sees it already as a standard value and skips the saving of the value in the item?

This issue seems to have some resemblance with the __Lock field issue.

I have the same issue with other fields like __SortOrder where the value is set in the item but equal to the original standard value. I am now solving this issue by fixing it in the source database by resetting these fields back to the original standard values.

You cannot have a sparse serialized tree.

After installing the lastest version https://www.nuget.org/packages/Unicorn/3.0.0-beta04 in a Sitecore 8 Update 5 website the following error occurs when starting the site.

Unicorn.aspx is also not accessible because of the error.

Unicorn configuration is default. In the data folder a Rainbow folder is automatically created.

Stacktrace from the Sitecore Log:

8616 19:18:09 ERROR Application error.
Exception: System.InvalidOperationException
Message: The parent item of /sitecore/system/Sites/scheduler was not serialized. You cannot have a sparse serialized tree.
Source: Rainbow
at Rainbow.Storage.SerializationFileSystemTree.GetTargetPhysicalPath(IItemData item)
at Rainbow.Storage.SerializationFileSystemTree.Save(IItemData item)
at Unicorn.UnicornDataProvider.SaveItem(ItemDefinition itemDefinition, ItemChanges changes, CallContext context)
at Unicorn.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.EngineCommand2.Execute() at Sitecore.Data.Engines.DataEngine.SaveItem(Item item) at Sitecore.Data.Managers.ItemProvider.SaveItem(Item item) at Sitecore.Data.Managers.PipelineBasedItemProvider.ExecuteAndReturnResult[TArgs,TResult](String pipelineName, String pipelineDomain, Func1 pipelineArgsCreator, Func`1 fallbackResult)
at Sitecore.Data.Managers.PipelineBasedItemProvider.SaveItem(Item item)
at Sitecore.Data.Items.ItemEditing.AcceptChanges(Boolean updateStatistics, Boolean silent)
at Sitecore.Data.Items.ItemEditing.EndEdit(Boolean updateStatistics, Boolean silent)
at Sitecore.Shell.Framework.Sorting.SetSortorder(Item item, Int32 sortorder)
at Sitecore.Shell.Framework.Sorting.MoveLast(Item[] items)
at Sitecore.Sites.MultiSitesManager.ArrangeSitesContext()
at Sitecore.Sites.MultiSitesManager.Process(HttpRequestArgs args)
at (Object , Object[] )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Nexus.Web.HttpModule.��(Object ��, EventArgs ��)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Long path names when using a Web-root-relative path causes errors

When I use a web-root-relative path in the seializationProvider an error occurs when the path name is longer than x. 'path is not under root'

The serializationProvider looks like this
<serializationProvider type="Unicorn.Serialization.Sitecore.Fiat.FiatSitecoreSerializationProvider, Unicorn" rootPath="~/../../Unicorn" singleInstance="true" />

Item path can look like this
/sitecore/templates/MyTemplates/Base templates/Base navigation items folder/New template with a long name/New long section name/New field name with a very very very long name

The full error looks like this

[Exception: path is not under the root]
   Sitecore.Data.Serialization.PathUtils.GetShortPath(String path) +168
   Sitecore.Data.Serialization.PathUtils.MapItemPath(String itemPath, String root) +383
   Unicorn.Serialization.Sitecore.SerializationPathUtility.GetSerializedReferencePath(String rootDirectory, ISourceItem sourceItem) +93
   Unicorn.Serialization.Sitecore.SitecoreSerializationProvider.SerializeItem(ISourceItem item) +168
   Unicorn.UnicornDataProvider.SerializeItemIfIncluded(ItemDefinition itemDefinition, String triggerReason) +126
   Unicorn.UnicornSqlServerDataProvider.CreateItem(ID itemId, String itemName, ID templateId, ItemDefinition parent, CallContext context) +238
   Sitecore.Data.DataProviders.DataProvider.CreateItem(ID itemID, String itemName, ID templateID, ItemDefinition parent, CallContext context, DataProviderCollection providers) +163
   Sitecore.Nexus.Data.DataCommands.CreateItemCommand.Execute(ID itemId, String itemName, ID templateId, Item destination) +578
   Sitecore.Data.Engines.DataCommands.CreateItemCommand.DoExecute() +108
   Sitecore.Data.Engines.EngineCommand`2.Execute() +122
   Sitecore.Data.Engines.DataEngine.CreateItem(String itemName, Item destination, ID templateId, ID newId) +98
   Sitecore.Data.Managers.ItemProvider.CreateItem(String itemName, Item destination, ID templateId, ID newId, SecurityCheck securityCheck) +363
   Sitecore.Data.Managers.ItemManager.CreateItem(String itemName, Item destination, ID templateId, ID newId, SecurityCheck securityCheck) +215
   Sitecore.Data.Managers.ItemManager.CreateItem(String itemName, Item destination, ID templateId, ID newId) +169
   Sitecore.Nexus.Data.DataCommands.AddFromTemplateCommand.��(String ��, Item �, ID ��, ID ��) +12
   Sitecore.Data.Engines.DataCommands.AddFromTemplateCommand.DoExecute() +114
   Sitecore.Data.Engines.EngineCommand`2.Execute() +122
   Sitecore.Data.Engines.DataEngine.AddFromTemplate(String itemName, ID templateId, Item destination, ID newId) +102
   Sitecore.Data.Managers.ItemProvider.AddFromTemplate(String itemName, ID templateId, Item destination, ID newId) +364
   Sitecore.Data.Managers.ItemManager.AddFromTemplate(String itemName, ID templateId, Item destination, ID newItemId) +204
   Sitecore.Data.Managers.ItemManager.AddFromTemplate(String itemName, ID templateId, Item destination) +287
   Sitecore.Data.Items.Item.Add(String name, TemplateID templateID) +146
   Sitecore.Data.Items.TemplateSectionItem.AddField(String fieldName) +266
   Sitecore.Shell.Applications.Templates.TemplateBuilder.TemplateBuilderForm.SaveField(TemplateSectionItem sectionItem, FieldDefinition field) +213
   Sitecore.Shell.Applications.Templates.TemplateBuilder.TemplateBuilderForm.SaveSection(TemplateItem templateItem, SectionDefinition section) +561
   Sitecore.Shell.Applications.Templates.TemplateBuilder.TemplateBuilderForm.SaveTemplate() +773
   Sitecore.Shell.Applications.Templates.TemplateBuilder.TemplateBuilderForm.Save(ClientPipelineArgs args) +1183

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +76
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +211
   System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +35
   Sitecore.Nexus.Pipelines.NexusPipelineApi.Resume(PipelineArgs args, Pipeline pipeline) +398
   Sitecore.Pipelines.Pipeline.Start(PipelineArgs args, Boolean atomic) +327
   Sitecore.Web.UI.Sheer.ClientPage.RunPipelines() +271
   Sitecore.Web.UI.Sheer.ClientPage.OnPreRender(EventArgs e) +547
   System.Web.UI.Control.PreRenderRecursiveInternal() +113
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4297

Sync is slow for large amount of content

We are finding the sync is slow for a large amount of content (~1GB). We found this could take several hours at least, even on high end machines. Is this a Sitecore problem or a Unicorn problem? This is less of an issue and a question as to whether you or someone has investigated where the bottleneck is. If the bottleneck is Sitecore and there's nothing that can be done I won't investigate further, however if the bottleneck is Unicorn I'm more than happy to spend some time investigating whether not I can improve it.

Also if the bottleneck is Sitecore, have you looked at the level of difficulty in overwriting the serialization provider or using the Item Web API? I think I looked at this about a year ago and concluded there were enough blackbox things going on with the serialization provider that a wholesale overhaul would run into strange problems, similar to overhauling the DataProvider.

Deserialization (sync) ordering

We have a setup where developers check in the serialized folder contents, example content items and template items, to source control (Git on Visual Studio Online). A build server pushes this to a test machine (TeamCity builds nuget packages and Octopus Deploy deploys them). We are seeing the following error:

Issue: When a developer creates a template and a content item at the same time. Unicorn will say that the template does not exist for the item and stop. This is caused by the ordering of the nodes in the "serialization.config" file and can be resolved by moving templates up above content. But what happens if the dependencies cross boundaries and the ordering of nodes need to be dynamic? Is the dependency graph inside Unicorn able to handle dependencies like this in the sync, or are users/CI systems supposed to stage items in correct order based on dependencies?

Unicorn Client Extensions

Hi Kam

We're writing some Sitecore Content Editor Helpers for Unicorn right now.

  • a gutter icon, indicating if the item is serialized according to the Serialization.config or not (not based on file system serialization, so it can help content Authors as well).
  • an item validator that can "block" saving items, that are within the serialization pattern. Again, this can protect admins on production editing items they shouldn't.

Now, would you be comfortable if we would add these client extensions to the Unicorn project (through PR) - it will ship with serialized items, additional icons and configs and thus we would need to extend the file structure and nuspec of the project. Or should we create a new "Unicorn Extension" repo/project, hosted elsewhere for that?

Thanks for your feedback,

  • reto

Item Moved Logic

The following logic for the OnItemMoved method looks like it might cause a problem:

        if (DisabledLocally) return;

        // [0] is the moved item, [1] is the ID of the previous parent item
        var item = Event.ExtractParameter<Item>(e, 0);
        var oldParentId = Event.ExtractParameter<ID>(e, 1);

        if (item == null || oldParentId == (ID)null) return;

        var oldParent = item.Database.GetItem(oldParentId);

        if (oldParent == null) return;

        if (!Presets.Includes(item)) return;

The system checks the preset location of the new item and if the new location is not in the presets then it returns:

if (!Presets.Includes(item)) return;

However this causes a problem if the item was in a preset location and then moved out of the preset locations. The item on disk in this scenario won't actually be removed.

In this scenario the old serialized item should be deleted.

Error Including Single Item w/Default Predicate

Using Unicorn 3.0 b8.

Here's the <include> that I added to the stock <predicate>

<include database="master" path="/sitecore/media library/SUGBG/Hero Images/_Default Hero" />

This is a single image item within the media library. I didn't do any further testing to see if this happens with any item anywhere or if it's unique to media. Here's the error showing up in the Unicorn console:

Unable to resolve root serialized item for predicate root path master:/sitecore/media library/SUGBG/Hero Images/_Default Hero. Either the path did not exist, or multiple items matched the path. It has been skipped.

If a path is included twice, a Unicorn.Loader.ConsistencyException is thrown

Let's assume a include configuration like this:

  <predicate type="Unicorn.Predicates.SerializationPresetPredicate, Unicorn" singleInstance="true">
            <include database="core" path="/sitecore/content/Documents and settings/All users"/>
            <include database="core" path="/sitecore/content/Documents and settings/All users/Start menu" />
</predicate>

Serialization will work fine, however when performing a sync, this will throw an exception like:

2092 10:52:52 ERROR [Unicorn]: Duplicate serialized item IDs were detected ({B965ECE5-5879-4D8D-A6B1-4233D7D06B0F}) - this usually indicates corruption in the serialization provider data.<br>Item 1: core:/sitecore/content/Documents and settings/All users/Start menu ({B965ECE5-5879-4D8D-A6B1-4233D7D06B0F})<br> Item 1 ProviderId: Z:\work\9cb9e3c71f951d07\serialization\app\core\sitecore\content\Documents and settings\All users\Start menu.item
Item 2: core:/sitecore/content/Documents and settings/All users/Start menu ({B965ECE5-5879-4D8D-A6B1-4233D7D06B0F})
Item 2 ProviderId: Z:\work\9cb9e3c71f951d07\serialization\app\core\sitecore\content\Documents and settings\All users\Start menu.item
2092 10:52:52 ERROR ERROR: Consistency check failed - aborting loading. (Unicorn.Loader.ConsistencyException)
at Unicorn.Loader.SerializationLoader.DoLoadItem(ISerializedItem serializedItem, IConsistencyChecker consistencyChecker)
   at Unicorn.Loader.SerializationLoader.LoadTree(ISerializedItem rootItem, IDeserializeFailureRetryer retryer, IConsistencyChecker consistencyChecker)
   at Unicorn.Loader.SerializationLoader.LoadAll(ISerializedItem[] rootItems, IDeserializeFailureRetryer retryer, IConsistencyChecker consistencyChecker, Action`1 rootLoadedCallback)
   at Unicorn.ControlPanel.SyncConsole.Process(IProgressStatus progress)

Would be cool if the exception was clearer or even better if this case was just ignored.

Handling customer content

Hi

I made an Sitecore upgrade from 7.1 to 7.2 with Unicorn enabled.

Some things i was faced with while upgrading:

  • It seems that the number of events fired by the upgrade was way to high in that short period. Only about 1/3 of all changes were handled by Unicorn.
  • serialization.aspx with preconfigured paths to the rescue! But sadly, all items which were deleted by the upgrade and not deleted on the disk remains, because the serialization does not delete items on the disk, even if they should.
  • The only solution is to delete the whole content of the serialization folder and serialize again.

The problem: we have some excluded paths in the content folder of the master database. These item trees are modified by the customer. The root items of these exclude paths are manually serialized within the Developer tab because they are necessary for other developers and the Sitecore Courier Module (http://sitecorecourier.codeplex.com/) to generate these items on the target system.

Now if we delete the content of the serialization folder and make a complete new serialization, these items are missing in the file system and they will generate a huuuuuge mess on the target system when Sitecore Courier will make a item package, which tells the system to remove that items and their childs (The whole websites).

Can you give me an advice how you work with Unicorn when you have items which need to be handled by the customer? Especially the root item of the exclude paths. If we don't have them on disk, the customer has no chance to get them initially. If we serialize them manually, we have a shaky serialization when we have to clean the whole serialization folder.

How do you do that? Are we missing a huge key point?

Publishing sync'd content

Hi,

Do you have a suggested approach for publishing content sync'd to the master database after a sync triggered by CI server? Previously I just added the publish code into the old unicorn.aspx file but now as this is a handler I can't do this.

It seems like it would be a common requirement, otherwise you can't actually do a full hands-free deployment because you'd have to manually do a site publish to get the new templates/layouts live. How do you handle this? A bool in the config for "publish master predicate paths after sync" would make sense to me? If you like I could fork and add this.

Thanks
Andy

Unicorn and overlength item paths

Hi

I did an upgrade from Sitecore 7.1 to 7.2

Sitecore changed the whole Speak item structure within the core:/sitecore/client path.

The path to our serialization folder is 50 characters long. One of the new items in 7.2 is the following path:

core:/sitecore/client/Business Component Library/Layouts/Renderings/Structures/Page Structures/Application/Dashboard/Dashboard Parameters/__Standard Values

Because this (and some other) path is longer than 248 characters, the item gets serialized within an cryptic folder (1F683D41) directly on the root of the serialization folder:

image

This is the Sitecore way of handling these long paths. This is the first Sitecore release where we face this behavior. To date, Sitecore had only shortened the Dictionary items which where to long within the particular character folder (for example O).

"Problem":
When i execute sync-database.aspx, all those items gets first deleted because they are not found. In a second step they get added as new items because they are found in the root folder:

image

This behavior has not really an impact onto the functionality of the sync. But it is confusing for the developer and a bit error prone. Developers tend to ignore these messages after a while and oversee an actual error if it occurs.

Feature request: Is it possible to handle these situations and do nothing? Because there is nothing to do :)

Regards,
Pascal

Consider rebuilding Link database

Hey

Very good work on Unicorn.

You could consider the following improvement.

When using clones in Sitecore, you will experience that the links between the clones are not persisted when deserializing items into Sitecore again, hence clone notifications no longer work.
This has been documented in the support database.

The solution to this is simply to rebuild the link database.
A simple - Globals.LinkDatabase.Rebuild(database); would propably solve the problem.

You could consider adding a setting to the serialization.config, that allows you to do a rebuild of the links database upon a successfull Unicorn sync.

NullReferenceException in VersionedFieldIsChanged method

Hi Kam,

I got a NullReferenceException while synchronizing items.
Exception:

[U] master:/sitecore/templates/System/Language (f68f13a6-3395-426a-b9a1-fa2dc60d94eb)
ERROR: Object reference not set to an instance of an object. (System.NullReferenceException)
at Unicorn.Evaluators.DefaultSerializedAsMasterEvaluatorLogger.VersionedFieldIsChanged(IItemData serializedItemData, IItemVersion version, Guid fieldId, String serializedValue, String sourceValue) 
at Unicorn.Evaluators.SerializedAsMasterEvaluator.<>c__DisplayClass12.b__6(ISerializedAsMasterEvaluatorLogger log) 
at Unicorn.Logging.DeferredLogWriter`1.ExecuteDeferredActions(TLog log) 
at Unicorn.Evaluators.SerializedAsMasterEvaluator.EvaluateUpdate(IItemData sourceItem, IItemData targetItem) 
at Unicorn.Loader.SerializationLoader.DoLoadItem(IItemData serializedItemData, IConsistencyChecker consistencyChecker) 
at Unicorn.Loader.SerializationLoader.LoadTree(IItemData rootItemData, IDeserializeFailureRetryer retryer, IConsistencyChecker consistencyChecker) 
at Unicorn.Loader.SerializationLoader.LoadAll(IItemData[] rootItemsData, IDeserializeFailureRetryer retryer, IConsistencyChecker consistencyChecker, Action`1 rootLoadedCallback) 
at Unicorn.SerializationHelper.SyncTree(IConfiguration configuration, Action`1 rootLoadedCallback, IItemData[] roots) 
at Unicorn.ControlPanel.SyncConsole.Process(IProgressStatus progress)

What I did is I simply updated project on my local machine it went fine, no errors.
When I pushed my changes to a dev server it failed to "Sync" items with this error.
I made a clean "Serialization" on dev, and turns out that there is only one difference in failing files:
sc_lang_diff

This issue appears not only in Language item it appears in other items not created by me (Sitecore items).
From the de-compiler I can see that there are not a lot of places for NullRef,
possible_errors

Please let me know if you need more info.
Thanks.

Serialize different presets

I see in your code that you support deserialization of named presets through a query string parameter (in the sync tool), but the serialization part on the events only seems to consider the default preset. Am I missing something? Thank you very much for your answer, there will be follow up questions ;)

Sitecore.Social requires Ninject, Version 3.2.0.0

In Sitecore 8.0 rev. 150223 the following warning is thrown in the Sitecore log file.

  • Sitecore.Social: Ninject, Version=3.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7 is not loaded. The task execution is skipped.

As Unicorn is dependent of Ninject, Version 3.0.1.10 these two are not working very well together. Can you upgrade Ninject to version 3.2.0.0 in the unicorn solution?

Items in Core DB resolve to null when in LiveMode

When going to the Unicorn.aspx page Sitecore isn't able to resolve my Core database items if I have LiveMode.config in my Include folder (content of LiveMode.config is at the bottom of the issue).

I'm using the OOTB Serialization.config, apart from the /sitecore/unicorn/configurations/configuration[@name='default configuration']/predicate node. In that node I have the following:

<include database="core" path="/sitecore/Client"/>
<include database="core" path="/sitecore/Client/Your Apps/Reporting"/>
<include database="core" path="/sitecore/Client/Sitecore/Applications/Launch Pad/Page Settings/Shortcuts/Analytics"/>
<include database="master" path="/sitecore/system/settings/analytics/dashboard reports/analytics reports">

I have no additional Include files for my SPEAK app, and am running Sitecore 7.1 Initial Release. All config files are Sitecore OOTB files.

LiveMode.config:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <sites>
      <site name="website">
        <patch:attribute name="database">master</patch:attribute>
        <patch:attribute name="filterItems">true</patch:attribute>
        <patch:attribute name="enableWorkflow">true</patch:attribute>
      </site>
    </sites>
  </sitecore>
</configuration>

Cannot build sync-database.aspx

IsAuthorized method has reference to "correctAuthToken". Build reports:

The name 'correctAuthToken' does not exist in the current context C:\Projects\Unicorn\Source\Sync Tool\sync-database.aspx.cs

sync page does not render correctly with X-Content-Type-Options header

i have recently had a sitecore build tested by external penetration testers, one of the suggestions was to add the header;
X-Content-Type-Options: nosniff
to the custom headers section of the web.config.
if i do this and try to navigate to the unicorn console it renders the entire page as text. I'm assuming that no content type is being sent in the request

Critical error while updating media items

Hi Kam

We have an error with Unicorn 2 in the media library. For this example I have the whole media library serialized:

<include database="master" path="/sitecore/media library"/>

When I add a file (i.e. an image) to the media library it seems to work and the item is serialized. But when I want to save the item again without changing the blob (i.e. changing the alt-text of my image), I always get the following error message as browser popup (here in chrome):

save_image

It doesn't matter if I sync the database exactly before I change the alt-text and save the image item, the error message is always shown. I have tested this on a clean Sitecore 7.2 (rev. 140314).

Can you reproduce this or am I doing something wrong? Or what be the cause of this? When I interpret the error message correctly it says that the blob has changed...

The physical root path of this SFS tree is longer than the configured max base path length 90.

[InvalidOperationException: The physical root path of this SFS tree, D:\Projects\Sitecore\src\abcorp-site\abcorp.sitecore.abc\data\Unicorn\Default Configuration\Field types, is longer than the configured max base path length 90. If the tree contains any loopback paths, unexpected behavior may occur. You should increase the Serialization.SerializationFolderPathMaxLength setting to greater than 103 and perform a reserialization from a master content database.]
Rainbow.Storage.SerializationFileSystemTree.get_MaxRelativePathLength() +233
Rainbow.Storage.SerializationFileSystemTree.get_MaxItemNameLengthBeforeTruncation() +61
Rainbow.Storage.SerializationFileSystemTree.PrepareItemNameForFileSystem(String name) +58
System.Linq.WhereSelectArrayIterator2.MoveNext() +84 System.Linq.Buffer1..ctor(IEnumerable1 source) +176 System.Linq.Enumerable.ToArray(IEnumerable1 source) +77
Rainbow.Storage.SerializationFileSystemTree.GetPhysicalFilePathsForVirtualPath(String virtualPath) +224
Rainbow.Storage.SerializationFileSystemTree.GetItemsByPath(String globalPath) +87
Rainbow.Storage.SerializationFileSystemDataStore.GetByPath(String path, String database) +48
Unicorn.Data.ConfigurationDataStore.GetByPath(String path, String database) +28
Unicorn.Predicates.PredicateRootPathResolver.GetRootSerializedItems() +78
Unicorn.ControlPanel.ControlPanelUtility.HasAnySerializedItems(IConfiguration configuration) +36
System.Linq.Enumerable.All(IEnumerable1 source, Func2 predicate) +146
Unicorn.ControlPanel.d__0.MoveNext() +109
Unicorn.ControlPanel.UnicornControlPanelPipelineProcessor.ProcessRequest(HttpContext context) +473
Unicorn.ControlPanel.UnicornControlPanelPipelineProcessor.Process(HttpRequestArgs args) +74
(Object , Object[] ) +59
Sitecore.Pipelines.PipelineMethod.Invoke(Object[] parameters) +36
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +241
Sitecore.Pipelines.CorePipeline.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists) +158
Sitecore.Pipelines.CorePipeline.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +64
Sitecore.Pipelines.CorePipeline.Run(String pipelineName, PipelineArgs args) +50
Sitecore.Nexus.Web.HttpModule.��(Object ��, EventArgs ��) +450
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +141
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

I have problems as above, its releated to the length of path.
I changed :
- "Serialization.SerializationFolderPathMaxLength" from web.config.
- "Rainbow.SFS.SerializationFolderPathMaxLength" from Rainbow.config.
but everything still got the errors. Please help me !

Ver :
- Unicorn.3.0.0-rc4, Unicorn.Core.3.0.0-rc4
- Sitecore 8 Update 4

Unable to install NuGet Package for 1.0.6.0 or 1.0.5.1

Could not install package 'Unicorn 1.0.6.0'. You are trying to install this package into a
project that targets '.NETFramework,Version=v4.0', but the package does not contain any assembly references that
are compatible with that framework. For more information, contact the package author

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.