Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Trey 14 posts 108 karma points
    May 02, 2016 @ 13:46
    Trey
    0

    Cache Misses on working types after sync

    Hello,

    We have been using usync on a project for a few months now as a tool for keeping our database changes managed in git. We have two main developers who make changes to the umbraco backend. Each of the developers works on a local compact DB and then tracks changes to the usync data folder and packs those changes in their commits.

    We use VSTS to do CI/CD and have several environments for pre-production and user acceptance. We have had a lot of success with this until lately when we started getting missing content on our environments.

    When stepping through the code we noticed this exception being thrown from the GetVortoValue call to retrieve an Archetype Model.

    "Object reference not set to an instance of an object."
           at Umbraco.Core.Cache.HttpRuntimeCacheProvider.GetCacheItem(String cacheKey, Func`1 getCacheItem, Nullable`1 timeout, Boolean isSliding, CacheItemPriority priority, CacheItemRemovedCallback removedCallback, CacheDependency dependency)
           at Umbraco.Core.Cache.HttpRuntimeCacheProvider.GetCacheItem(String cacheKey, Func`1 getCacheItem, Nullable`1 timeout, Boolean isSliding, CacheItemPriority priority, CacheItemRemovedCallback removedCallback, String[] dependentFiles)
           at Umbraco.Core.Cache.HttpRuntimeCacheProvider.GetCacheItem(String cacheKey, Func`1 getCacheItem)
           at Umbraco.Core.Cache.DeepCloneRuntimeCacheProvider.GetCacheItem(String cacheKey, Func`1 getCacheItem)
           at Archetype.Extensions.ArchetypeHelper.GetArchetypePreValueFromDataTypeId(Int32 dataTypeId)
           at Archetype.Extensions.ArchetypeHelper.IsPropertyValueConverterOverridden(Int32 dataTypeId)
           at Archetype.PropertyConverters.ArchetypeValueConverter.IsConverter(PublishedPropertyType propertyType)
           at Umbraco.Core.Models.PublishedContent.PublishedPropertyType.<InitializeConverters>b__0(IPropertyValueConverter x)
           at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
           at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
           at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
           at Umbraco.Core.Models.PublishedContent.PublishedPropertyType.InitializeConverters()
           at Umbraco.Core.Models.PublishedContent.PublishedPropertyType..ctor(PublishedContentType contentType, PropertyType propertyType)
           at Our.Umbraco.Vorto.Extensions.IPublishedContentExtensions.CreateDummyPropertyType(Int32 dataTypeId, String propertyEditorAlias, PublishedContentType contentType)
           at Our.Umbraco.Vorto.Extensions.IPublishedContentExtensions.DoInnerGetVortoValue[T](IPublishedContent content, String propertyAlias, String cultureName, Boolean recursive, T defaultValue)
           at Our.Umbraco.Vorto.Extensions.IPublishedContentExtensions.DoGetVortoValue[T](IPublishedContent content, String propertyAlias, String cultureName, Boolean recursive, T defaultValue)
           at Our.Umbraco.Vorto.Extensions.IPublishedContentExtensions.GetVortoValue[T](IPublishedContent content, String propertyAlias, String cultureName, Boolean recursive, T defaultValue, String fallbackCultureName)
           at Backend.Core.Extensions.IPublishedContentExtensions.GetCulturedValue[T](IPublishedContent content, String propertyName) in C:\Development\Source\Intranet-Project\Umbraco\Backend\Core\Extensions\IPublishedContentExtensions.cs:line 38
    

    It had initially cropped up on our user acceptance environments and we were able to resolve it by doing a full usync export from a working environment and doing a full import on the broken environment.

    Unfortunately we have now seen this error come up on a development environment and our method that seemingly corrected the user acceptance environment did not fix the issue.

    Looking through some of the other posts on this forum lead me to investigate if the GUID for the underlying properties of our vorto/archetypes were being synced correctly, but I have not found anything.

    Have any of you experienced this issue?

  • Kevin Jump 2311 posts 14696 karma points MVP 7x c-trib
    May 03, 2016 @ 08:34
    Kevin Jump
    0

    Hi

    it does depend on the setup but if your archetype values are inside a vorto control that probably means the ids aren't being translated (in fact that might be true the other way around)

    usync doesn't know about every property type (esp 3rd party ones) So it's likely it just doesn't know that their are IDs inside the property to map.

    We do have an archetype mapper, but that works when the archetype contains known types (so MNTP, editors etc). it might not pick up other things :(

    At the moment there isn't a vorto mapper, so i guess that's where it's going wrong.

    Content Mappers

    Content Mappers are configured in usync.core.config (ContentMappings section) there you will see the core and archetype mappings.

    The basic content mapper Mapping="Content" just does a search for possible ids in the value and translates them, in the absence of another mapping you could try this on values* that aren't being mapped. *A specific mapper is always better as it's less search and hope and more targeted

    I am currently building more mappings into the next release of usync (notably, nested content and the grid) - I will have a quick look at vorto and see if that's something i can get a mapper for too.

    *mappings are against data types - so if you have a specific doctype property you want mapping you need the property editor alias, so usync will know what to map.*

  • Kevin Jump 2311 posts 14696 karma points MVP 7x c-trib
    May 05, 2016 @ 15:07
    Kevin Jump
    0

    Hi,

    Unfortunately the mapper for vorto didn't make it into the latest release of usync, because i had some other testing to do and needed that to be stable - There is however an out-of-bound release dll & config in github.

    https://github.com/KevinJump/uSync/tree/Dev-V7_4-VortoMapper/umbPackage/uSync.Core

    this has a slightly modified config from the latest release to trigger the vorto mapper

    <uSyncContentMapping Alias="Our.Umbraco.Vorto" Mapping="Custom" CustomMappingType="Jumoo.uSync.Core.Mappers.VortoContentMapper, Jumoo.uSync.Core" />
    

    The mapper is only really needed when you embed another doctype that needs mapping (like a content picker or something) inside the vorto controls.

    This should map the values you are having the problems with, if you have a chance to test this one that would be great.

Please Sign in or register to post replies

Write your reply to:

Draft