Problemas ao sincronizar o Unicorn. Qual era e o como resolvi

Recentemente eu trabalhei em um projeto e eu tive um problema ao tentar sincronizar o Unicorn. Por conta disso resolvi escrever este post para compartilhar o aprendizado.

O Problema:

Eu tentava sincronizar, reserializar as minhas configurações mas sempre aparecia esta tela:

screen1

As definições das minhas configurações eram as seguintes(note a parte em negrito):

<configuration xmlns:patch=”http://www.sitecore.net/xmlconfig/”&gt;

<sitecore>

<unicorn>

<configurations>

<configuration name=”Feature.Navigation” description=”Feature Navigation” dependencies=”Foundation.Serialization” patch:after=”configuration[@name=’Foundation.Serialization’]”>

<targetDataStore physicalRootPath=”$(sourceFolder)\feature\navigation\serialization” type=”Rainbow.Storage.SerializationFileSystemDataStore, Rainbow” useDataCache=”false” singleInstance=”true” />

<predicate type=”Unicorn.Predicates.SerializationPresetPredicate, Unicorn” singleInstance=”true”>

<include name=”Feature.Navigation.Templates” database=”master” path=”/sitecore/templates/Feature/Navigation” />

<include name=”Feature.Navigation.Renderings” database=”master” path=”/sitecore/layout/renderings/Feature/Navigation” />

 <include name=”Feature.Navigation.Media” database=”master” path=”/sitecore/media library/Feature/Navigation” />

</predicate>

<roleDataStore type=”Unicorn.Roles.Data.FilesystemRoleDataStore, Unicorn.Roles” physicalRootPath=”$(sourceFolder)\feature\navigation\serialization\Feature.Navigation.Roles” singleInstance=”true”/>

<rolePredicate type=”Unicorn.Roles.RolePredicates.ConfigurationRolePredicate, Unicorn.Roles” singleInstance=”true”>

<include domain=”modules” pattern=”^Feature Navigation .*$” />

</rolePredicate>

</configuration>

</configurations>

</unicorn>

</sitecore>

</configuration>

A Solução

Após revisar as configurações, notei que elas pareciam estar corretas então eu revisei todos os includes definidos nas configurações. Ao fazer esse exercício eu percebi que na seção Media, havia um caminho que não existia na arvoré de conteúdo do Sitecore. Estava faltando a pasta Navigation no caminho sitecore/media library/Feature.

Quando eu criei esta pasta o Unicorn passou a sincronizar normalmente. Em outras palavras, se você não estiver conseguindo sincronizar, revise as suas configurações e os caminhos definidos no Sitecore, e veja se eles todos estão corretos.

Talvez isso seja útil e evite perdas de tempos no futuro para alguém 🙂

screen

Advertisements

Sync issue with Unicorn. What was it and how I fixed it.

Recently I have worked on a project and I had an issue syncing Unicorn and I decided to write this post to share what was it and how I fixed it.

The Problem:

I tried syncing, reserializing Unicorn but I would still keet getting this screen:

screen1

This is what my configuration looked like(Note the bolded section):

<configuration xmlns:patch=”http://www.sitecore.net/xmlconfig/”&gt;

<sitecore>

<unicorn>

<configurations>

<configuration name=”Feature.Navigation” description=”Feature Navigation” dependencies=”Foundation.Serialization” patch:after=”configuration[@name=’Foundation.Serialization’]”>

<targetDataStore physicalRootPath=”$(sourceFolder)\feature\navigation\serialization” type=”Rainbow.Storage.SerializationFileSystemDataStore, Rainbow” useDataCache=”false” singleInstance=”true” />

<predicate type=”Unicorn.Predicates.SerializationPresetPredicate, Unicorn” singleInstance=”true”>

<include name=”Feature.Navigation.Templates” database=”master” path=”/sitecore/templates/Feature/Navigation” />

<include name=”Feature.Navigation.Renderings” database=”master” path=”/sitecore/layout/renderings/Feature/Navigation” />

 <include name=”Feature.Navigation.Media” database=”master” path=”/sitecore/media library/Feature/Navigation” />

</predicate>

<roleDataStore type=”Unicorn.Roles.Data.FilesystemRoleDataStore, Unicorn.Roles” physicalRootPath=”$(sourceFolder)\feature\navigation\serialization\Feature.Navigation.Roles” singleInstance=”true”/>

<rolePredicate type=”Unicorn.Roles.RolePredicates.ConfigurationRolePredicate, Unicorn.Roles” singleInstance=”true”>

<include domain=”modules” pattern=”^Feature Navigation .*$” />

</rolePredicate>

</configuration>

</configurations>

</unicorn>

</sitecore>

</configuration>

The Solution

So after reviewing the configurations and validating that they seemed to be correct, I reviewed all the include mappins. So when I got to the Media section I noticed that the path defined on the configuration file didn’t exist within Sitecore’s content tree. It turned out that it was missing the Navigation folder under /sitecore/media library/Feature.

When I created it, unicorn started syncing properly again.  In other words, if you are not being able to sync double check if your configs and the paths underneath Sitecore  are all valid. This was the problem in my case. Hopefully this will save anyone sometime in the future.

screen