Copied to clipboard

Flag this post as spam?

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


  • Jeroen Oostwouder 48 posts 103 karma points
    Jan 31, 2018 @ 09:27
    Jeroen Oostwouder
    0

    KeyNotFoundException in PublishedCache?

    I seem to have a problem when getting data from a TerraType field.

    But the weirdest thing is, it doesn't happen every time. At this point I've been able to recreate the issue by altering the web.config and pressing ctrl-f5 in Chrome.

    Most of the time, when I do the following:

    content.GetPropertyValue<Terratype.Models.Model>("fldGeoLocation")
    

    I get a Terratype object with the correct values.

    But when (I guess) starting fresh, it crashes there.

    'content.GetPropertyValue<Terratype.Models.Model>("fldGeoLocation")' threw an exception of type 'System.Collections.Generic.KeyNotFoundException'   object {System.Collections.Generic.KeyNotFoundException}
    

    When I put the following in my Watch-window:

    content.GetProperty("fldGeoLocation")
    

    I can get an object, but I can't get the value.

    enter image description here

    Is there anybody with the same problem? Or a solution?

  • Osman Coskun 124 posts 289 karma points
    Jan 31, 2018 @ 13:12
    Osman Coskun
    1

    Hello,

    I have the same problem. The package causing a stability problem after upgrading to 1.0.16.

  • Jeroen Oostwouder 48 posts 103 karma points
    Jan 31, 2018 @ 13:32
    Jeroen Oostwouder
    0

    Yep, totaly forgot to mention, but I have 1.0.16 too.

    Also, no icon in the installed package-list in the backend ;)

  • Dan Diplo 1291 posts 4808 karma points MVP 2x c-trib
    Feb 05, 2018 @ 16:06
    Dan Diplo
    0

    Yes, getting the same issue since upgrading to 1.0.16 via NuGet. I've also got Terratype.GoogleMapsV3 1.0.16 installed.

    As others mention, seems random, but triggered when accessing the property value converter:

    GetPropertyValue<Terratype.Models.Model>("location");
    

    Stack trace:

    [KeyNotFoundException: The given key was not present in the dictionary.]
       System.Collections.Generic.Dictionary`2.get_Item(TKey key) +12528541
       Terratype.Models.ModelConvertor.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) +2011
       Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue) +188
       Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) +488
       Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) +210
       Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer) +72
       Newtonsoft.Json.Linq.JToken.ToObject(Type objectType) +1769
       Newtonsoft.Json.Linq.JToken.ToObject() +56
       Terratype.Models.Model..ctor(JObject data) +55
       Terratype.TerratypeConverter.ConvertDataToSource(PublishedPropertyType propertyType, Object source, Boolean preview) +566
       Umbraco.Web.PublishedCache.XmlPublishedCache.XmlPublishedProperty.get_Value() +58
       Umbraco.Web.PublishedPropertyExtension.GetValue(IPublishedProperty property, Boolean withDefaultValue, T defaultValue) +79
       Umbraco.Web.PublishedContentExtensions.GetPropertyValue(IPublishedContent content, String alias, Boolean recurse, Boolean withDefaultValue, T defaultValue) +81
       Umbraco.Web.PublishedContentExtensions.GetPropertyValue(IPublishedContent content, String alias) +59
       ASP._Page_Views_Partials_JobBoard_JobBoardLocationMap_cshtml.Execute() in c:\....JobBoardLocationMap.cshtml:51
    
  • Jeroen Oostwouder 48 posts 103 karma points
    Feb 06, 2018 @ 07:23
    Jeroen Oostwouder
    0

    It almost looks like a cache problem, since I could trigger it by modifying the web.config file and pressing ctrl-f5 in chrome.

    Don't know if I can still trigger it. Haven't seen the error in a couple of days now, since I didn't need to refresh the cache

  • Dan Diplo 1291 posts 4808 karma points MVP 2x c-trib
    Feb 06, 2018 @ 08:58
    Dan Diplo
    100

    I rolled back to 1.0.15 and haven't had the issue since. So for now I'm going to stick with that until Jonathan gets a chance to look at the issue (or whether it's down to Umbraco...).

  • Tom van Enckevort 76 posts 299 karma points
    Mar 26, 2018 @ 15:16
    Tom van Enckevort
    0

    I encountered the same issue today when using 1.0.16 on an Umbraco v7.5.9 site.

    Rolling back to the previous version (1.0.15) seems to work for now.

  • Keith Hubbard 171 posts 378 karma points
    Apr 05, 2018 @ 18:49
    Keith Hubbard
    0

    crazy how this is happening. Where is Jonathon????

  • Tom van Enckevort 76 posts 299 karma points
    Apr 06, 2018 @ 06:54
    Tom van Enckevort
    3

    As mentioned by others, just use 1.0.15 for now as that one works fine.

    To be fair, 1.0.16 isn't mentioned in the changelog on the Github repo: https://github.com/Joniff/Terratype. So it could well be a case that an incomplete release was accidentally pushed to Nuget.

    I'm sure that when Jonathan has got time, he will have a look at it. But we all know and can appreciate that finding time for your side projects can be a challenge sometimes.

  • Mila Pandurska 43 posts 185 karma points
    Apr 25, 2018 @ 17:41
    Mila Pandurska
    0

    Hi,

    I have the same issue with version 1.0.16.

  • Dan Evans 562 posts 881 karma points
    1 week ago
    Dan Evans
    0

    I have the same issue with 1.0.18. Anyone find a solution?

    @Html.Terratype(Model.Content.GoogleMap, @)

Please Sign in or register to post replies

Write your reply to:

Draft