Copied to clipboard

Flag this post as spam?

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


  • Bogdan F. 249 posts 425 karma points
    Feb 26, 2015 @ 20:00
    Bogdan F.
    0

    Umbraco 4.5.2 uComponents 2.1 errors

    Hello,

    In an older site on U 4.5.2 all data types based on uComponents 2.1 started throwing the error

    [KeyNotFoundException: The given key was not present in the dictionary.]
       System.Collections.Generic.Dictionary`2.get_Item(TKey key) +2195365
       umbraco.cms.businesslogic.datatype.controls.Factory.GetNewObject(Guid DataEditorId) +60
       umbraco.cms.businesslogic.datatype.controls.Factory.DataType(Guid DataTypeId) +50
       umbraco.cms.businesslogic.datatype.DataTypeDefinition.get_DataType() +93
       umbraco.cms.presentation.developer.editDatatype.Page_Load(Object sender, EventArgs e) +1306
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
       System.EventHandler.Invoke(Object sender, EventArgs e) +0
       System.Web.UI.Control.OnLoad(EventArgs e) +91
       umbraco.BasePages.BasePage.OnLoad(EventArgs e) +49
       System.Web.UI.Control.LoadRecursive() +74
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207

    Any suggestions?

    Thanks!

  • Jan Skovgaard 10758 posts 21135 karma points admin mvp c-trib
    Feb 26, 2015 @ 20:27
    Jan Skovgaard
    0

    Hi Bogdan

    What changes was made to the site before this started to happen?

    Have you tried to simply recycle the app pool and see if it helps?

    /Jan

  • Bogdan F. 249 posts 425 karma points
    Feb 27, 2015 @ 10:01
    Bogdan F.
    0

    Hi Jan,

    Yes, I touched the web.config to restart the application pool.

    The search stopped working, so to try to fix that we tried the Examineindexadmin_1.0 package to rebuild the examine indexes. The package didn't work, there were errors on the dashboard tab, and was uninstalled, but now the error from uComponents data types is making all pages with any uComponents property throw errors. Deleting the ExamineIndexes folders a few times and restarting the site got the search working, but now we are stuck with this error.

    Thanks, Bogdan

  • Lee Kelleher 3690 posts 13439 karma points admin core mvp c-trib
    Feb 27, 2015 @ 11:41
    Lee Kelleher
    0

    Hi Bogdan,

    As Jan asks, was anything changed on your website before this error started to appear?

    Which uComponents data-type are you using?

    The only time that I've seen the KeyNotFoundException error is when someone upgraded uComponents to the latest version that didn't support their older version of Umbraco (e.g. uComponents 4.0 on Umbraco 4.7.1).

    See the compatibility matrix for more details:
    http://ucomponents.org/compatibility/

    It might be worth upgrading to uComponents v3.1.2? (as that works on Umbraco v4.5.2)

    Cheers,
    - Lee

  • Bogdan F. 249 posts 425 karma points
    Feb 27, 2015 @ 11:52
    Bogdan F.
    0

    Hi Lee,

    The uComponents version is 2.1.

    The data types used are Multi-Node Tree Picker and URL Picker.

    As for the changes made prior to the error, as far as I know only what I wrote above. I will try to upgrade to 3.1.2 and see if it helps.

    Thanks!

  • Lee Kelleher 3690 posts 13439 karma points admin core mvp c-trib
    Feb 27, 2015 @ 11:54
    Lee Kelleher
    0

    Just to rule this out... can you check if the uComponents.Core.dll is in your /bin folder?

    Thanks,
    - Lee

  • Bogdan F. 249 posts 425 karma points
    Feb 27, 2015 @ 13:43
    Bogdan F.
    0

    It is definitely there. File version 2.1.0.0.

    Thanks,

    Bogdan

  • Bogdan F. 249 posts 425 karma points
    Feb 27, 2015 @ 13:48
    Bogdan F.
    0

    I noticed in installedPackages.config

    package id="10" version="2.1" url="" name="uComponents" folder="6e67d7b5-af1f-4814-8c7c-9bd3393b7f05"

    but I don't see the 6e67d7b5-af1f-4814-8c7c-9bd3393b7f05 folder. Could this be it?

  • Lee Kelleher 3690 posts 13439 karma points admin core mvp c-trib
    Feb 27, 2015 @ 15:32
    Lee Kelleher
    0

    No, the folder GUID is only for the package installation. Hmmm, I'm not sure what could be causing that error.

    Maybe it is worth trying to upgrade uComponents to v3.1.2?
    http://ucomponents.codeplex.com/releases/view/90019

    Do make a backup of your current version of uComponents.Core.dll - in case you need to revert it back.

    Good luck!

    Cheers,
    - Lee

  • Bogdan F. 249 posts 425 karma points
    Feb 27, 2015 @ 15:36
    Bogdan F.
    0

    Ok, trying it right now. Should I install the package, or just overwrite the dll?

    Thanks, Bogdan

  • Lee Kelleher 3690 posts 13439 karma points admin core mvp c-trib
    Feb 27, 2015 @ 15:37
    Lee Kelleher
    0

    Installing the package is fine.

  • Bogdan F. 249 posts 425 karma points
    Feb 27, 2015 @ 15:40
    Bogdan F.
    0

    Got an error from package installation :(

    Server Error in '/' Application.
    
    Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
    
    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.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
    
    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: 
    
    
    [ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.]
       System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) +0
       System.Reflection.RuntimeModule.GetTypes() +4
       System.Reflection.Assembly.GetTypes() +78
       uComponents.Core.Install.uComponentsInstaller.Page_Init(Object sender, EventArgs e) +47
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
       System.Web.UI.Control.OnInit(EventArgs e) +91
       System.Web.UI.UserControl.OnInit(EventArgs e) +83
       System.Web.UI.Control.InitRecursive(Control namingContainer) +140
       System.Web.UI.Control.AddedControl(Control control, Int32 index) +197
       System.Web.UI.ControlCollection.Add(Control child) +79
       umbraco.presentation.developer.packages.Installer.processInstall(String currentStep) +951
       umbraco.presentation.developer.packages.Installer.Page_Load(Object sender, EventArgs e) +549
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
       System.EventHandler.Invoke(Object sender, EventArgs e) +0
       System.Web.UI.Control.OnLoad(EventArgs e) +91
       umbraco.BasePages.BasePage.OnLoad(EventArgs e) +49
       System.Web.UI.Control.LoadRecursive() +74
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
    
    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1025
    

    Thanks, Bogdan

  • Bogdan F. 249 posts 425 karma points
    Feb 27, 2015 @ 15:43
    Bogdan F.
    0

    I see that the new dll did make it to the bin folder, but the KeyNotFoundException is the same.

  • Lee Kelleher 3690 posts 13439 karma points admin core mvp c-trib
    Feb 27, 2015 @ 15:52
    Lee Kelleher
    0

    uh oh, that's not good - I'd copy back the original uComponents.Core.dll - just to be on the safe side.

    I'm not sure what to advise next. I can't see how the uComponents data-types suddenly broke. Feels like something else is at play here.

    What other packages (specifically data-type ones) do you have installed? Are those ones still working?

  • Bogdan F. 249 posts 425 karma points
    Feb 27, 2015 @ 15:56
    Bogdan F.
    0

    I put back the original 2.1 dll and everything seems the same.

    Yes, all other data types are working, I checked. I see under Installed packages uComponents 3 times, if I uninstall all and install 2.1, the existing data types will not be affected, right?

    Thanks!

  • Lee Kelleher 3690 posts 13439 karma points admin core mvp c-trib
    Feb 27, 2015 @ 15:59
    Lee Kelleher
    0

    No, don't uninstall the uComponents packages ... it will destroy any associated data.

    The 3 installed packages are just for display purposes only anyway - you can either leave them as they are ... or if you want to edit the /App_Data/packages/installed/installedPackages.config XML file, you can manually remove the extra entries.

  • Bogdan F. 249 posts 425 karma points
    Feb 27, 2015 @ 16:16
    Bogdan F.
    0

    What do you know about the exception KeyNotFoundException from

    umbraco.cms.businesslogic.datatype.controls.Factory.GetNewObject(Guid DataEditorId) +60
       umbraco.cms.businesslogic.datatype.controls.Factory.DataType(Guid DataTypeId) +50
    

    ? I mean, what key and what dictionary are we talking about? I don't know where to find the U 4.5.2 source to start looking, but from here http://umbraco.codeplex.com/SourceControl/latest#src/umbraco.cms/businesslogic/datatype/factory.cs it seems that the DataEditorId is missing from DataTypesResolver.Current.DataTypes.ToArray()

    Thanks!

  • Bogdan F. 249 posts 425 karma points
    Feb 27, 2015 @ 16:29
    Bogdan F.
    0

    DataTypes from DataTypesResolver, before returning Values, calls EnsureRefreshersList(); from LegacyTransientObjectsResolver which is

    /// <summary>
    /// Populates the refreshers dictionary to allow us to instantiate a type by Id since the ICacheRefresher type doesn't contain any metadata
    /// </summary>
            protected void EnsureRefreshersList()
            {
                using (var l = new UpgradeableReadLock(_lock))
                {
                    if (_trackIdToType == null)
                    {
                        l.UpgradeToWriteLock();
                        _trackIdToType = new ConcurrentDictionary<Guid, Type>();
                        foreach (var v in Values)
                        {
                            _trackIdToType.TryAdd(GetUniqueIdentifier(v), v.GetType());
                        }
                    }
                }
            }
    

    ... and I'm lost.

  • Lee Kelleher 3690 posts 13439 karma points admin core mvp c-trib
    Feb 27, 2015 @ 16:56
    Lee Kelleher
    1

    What the DataTypesResolver does is keep a list of all the loaded data-type editor-controls (e.g. Multi-Node Tree Picker) and the GUID/ID for that editor-control (e.g. MNTP's GUID is "C2D6894B-E788-4425-BCF2-308568E3D38B").

    When the content edit screen is being loaded it will try to look up the editor-controls it needs via the "key" (e.g. the GUID).

    So in the case where you are getting the KeyNotFoundException error, it is because the GUID can not be found in the look up.
    Which suggests that it can not be loaded in the first place :-(

  • Bogdan F. 249 posts 425 karma points
    Mar 03, 2015 @ 10:33
    Bogdan F.
    0

    How are the data-type editor-controls GUIDs loaded? Reflection? If I try to make a new data type, there are no uComponenents under "Render control".

    Thanks!

  • Lee Kelleher 3690 posts 13439 karma points admin core mvp c-trib
    Mar 03, 2015 @ 10:40
    Lee Kelleher
    0

    Yeah, Umbraco core uses reflection to find the data-type editor-controls. If they aren't being listed in the "Render Control" dropdown, then something else is going on.

    How comfortable are you with HTML? Could you do a view-source for around the "Render Control" dropdown? See if there are any error messages within the HTML?

    Thanks,
    - Lee

  • Bogdan F. 249 posts 425 karma points
    Mar 03, 2015 @ 10:52
    Bogdan F.
    0

    Your reply got me the idea to replace all assemblies with ones from another site which I learned uses the same codebase (I don't have the source project), and uComponents are working again! :)

    Thanks a lot Lee!

  • Lee Kelleher 3690 posts 13439 karma points admin core mvp c-trib
    Mar 03, 2015 @ 10:55
    Lee Kelleher
    0

    Excellent news that you resolved it! :-)

Please Sign in or register to post replies

Write your reply to:

Draft