Copied to clipboard

Flag this post as spam?

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


  • Jim 7 posts 28 karma points
    Oct 03, 2014 @ 16:03
    Jim
    1

    6.2.2 InternalIndexer error ArgumentNullException: Parameter name: contentType

    I upgraded from 4.11 to 6.2.2. Everything works on my site but I am unable to run the indexer. The Developer section of the backoffice is really slow because it attempts to index every time I go to that section. Whenever I run the Rebuild tool from the Examine dashboard it fails with the error below. I have checked in my database in tables like cmsContent and cmsContentType but see nowhere where this value could be null.

    error: The index could not be rebuilt at this time, most likely there is another thread currently writing to the index. Error: System.ArgumentNullException: Value cannot be null.
    
    Parameter name: contentType
       at Umbraco.Core.Mandate.That[TException](Boolean condition, Func`1 defer)
       at Umbraco.Core.Models.ContentBase..ctor(String name, Int32 parentId, IContentTypeComposition contentType, PropertyCollection properties)
       at Umbraco.Core.Models.Content..ctor(String name, Int32 parentId, IContentType contentType, PropertyCollection properties)
       at Umbraco.Core.Models.Content..ctor(String name, Int32 parentId, IContentType contentType) 
       at Umbraco.Core.Persistence.Factories.ContentFactory.BuildEntity(DocumentDto dto)
       at Umbraco.Core.Persistence.Repositories.ContentRepository.CreateContentFromDto(DocumentDto dto, Guid versionId)
       at Umbraco.Core.Persistence.Repositories.ContentRepository.PerformGet(Int32 id) 
       at Umbraco.Core.Persistence.Repositories.RepositoryBase`2.Get(TId id)
       at Umbraco.Core.Persistence.Repositories.ContentRepository.<PerformGetByQuery>d__22.MoveNext()
       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.Services.EntityXmlSerializer.Serialize(IContentService contentService, IDataTypeService dataTypeService, IContent content, Boolean deep)
       at UmbracoExamine.DataServices.UmbracoContentService.GetLatestContentByXPath(String xpath)
       at UmbracoExamine.BaseUmbracoIndexer.AddNodesToIndex(String xPath, String type)
       at UmbracoExamine.BaseUmbracoIndexer.PerformIndexAll(String type)
       at UmbracoExamine.BaseUmbracoIndexer.PerformIndexRebuild()
       at Umbraco.Web.WebServices.ExamineManagementApiController.PostRebuildIndex(String indexerName)
    
  • Jim 7 posts 28 karma points
    Oct 03, 2014 @ 18:58
    Jim
    0

    In the examine settings I tried to set supportUnpublished="false" which allowed my InternalIndexer to complete. However, my InternalMemberIndexer still does not index correctly even though it runs to completion

    <add name="InternalIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"
               supportUnpublished="false"
               supportProtected="true"
               interval="10"
               analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net"/>
    
  • Charles Afford 1163 posts 1709 karma points
    Oct 16, 2014 @ 20:02
    Charles Afford
    2

    Hmmm do you have any media that is null in the content tree?

    Charlie :)

  • Mark Bowser 273 posts 860 karma points c-trib
    May 11, 2015 @ 22:58
    Mark Bowser
    1

    Thanks for the hint, Charles. In my case, I had almost the exact same error as Jim, except my stack trace referenced the mediaRepository instead of the contentRepository. Sure enough, I found some media in the root of my media tree that had no icon. I clicked it and saw YSODs that said:

    Value cannot be null. Parameter name: contentType.

    It looks like sometime in the site's past, the media type associated with these media items was deleted. I am unable to delete these offending media nodes from the umbraco backoffice, so I had to manually delete them with SQL

    DELETE
    FROM cmsContent
    WHERE nodeId = 3400 OR nodeId = 3512
    
    DELETE
    FROM umbracoNode
    WHERE id = 3400 OR id = 3512
    

    I ran an additional query to find any other nodes without contentTypes. I found a bunch more, but left them alone because they aren't causing any problems. They are all nodes in the content tree. Looks like umbraco only freaks out if the media lack a contentType.

    SELECT TOP 1000 *
    FROM umbracoNode n
    INNER JOIN cmsContent c
       ON c.nodeId = n.id
    WHERE c.contentType = 0
    
  • Charles Afford 1163 posts 1709 karma points
    May 11, 2015 @ 23:07
    Charles Afford
    0

    No worries mark, a I guy I used to work with had the problem when we were importing media and they became null. When We tried to index we got exceptions. Speaking of SQL I thought the was a script knocking around that would clean any duplications or corrupt nodes.

    The one above with almost certainly be a doc type that has been removed or has duplicated fields perhaps or is just null.

    Thanks for the SQL, that rocks :). I will try and see if I can find the script it might help as well. Charlie.

  • Heather Floyd 610 posts 1032 karma points MVP 6x c-trib
    Sep 01, 2015 @ 18:08
    Heather Floyd
    1

    This information saved me today - thank you all!

    One thing - I had to add an additional first SQL statement for it to run correctly:

    DELETE
    FROM cmsContentVersion
    WHERE ContentId = 23222
    
    DELETE
    FROM cmsContent
    WHERE nodeId = 23222
    
    DELETE
    FROM umbracoNode
    WHERE id = 23222
    

    ~Heather

  • Charles Afford 1163 posts 1709 karma points
    Sep 01, 2015 @ 19:03
    Charles Afford
    0

    Glad it helped :) feel free too high five ;)

Please Sign in or register to post replies

Write your reply to:

Draft