locked
A duplicate name was found creating content type

    Question

  • Hello all. I'm getting a very strange SharePoint error that's proving very difficult to overcome. I created a custom content type that was a child of 'Document.' We'll call it 'Custom Parent Type.' I then went back and created several content types that are children of 'Custom Parent Type.'

    But now, strangely whenever I try to create a content type thats a child of 'Custom Parent Type,' SharePoint complains that "A duplicate name 'AnyName' was found.

    I can even use a Guid for the name and get the same error so I'm certain the name doesn't really exist. It even tell me it exists when I try to create one programmatically. But when I try to delete this content type that supposedly exists, it's never found??? Very strange. Anyone else beat this?

    Thanks in advance.
    Monday, June 07, 2010 7:16 PM

Answers

  • I just spent a couple of days trying to nail down a similar issue and I think I have a possible answer. I was also getting the following error message when trying to create a child content type:

    A duplicate content type "My Content Type" was found.

    In some cases (such as creating a new content type via the web services), you may get a message in the logs that looks like:

    Microsoft.SharePoint.SPException: The local device name is already in use. (Exception from HRESULT: 0x80070055)

    In the content database, SharePoint maintains a list of content types in the table dbo.ContentTypes. There is a column named NextChildByte that is a counter used to form the ContentTypeId when creating child content types. Under certain situations (such as creating a new child content type from a feature), it is possible to create a content type that already uses the next sequence number from its parent. Once this occurs, this error will take place whenever you try to create a new child of that parent.

    The solution: Find the row in the dbo.ContentTypes table that matches your SiteId, ContentTypeId, and Scope, then edit the NextChildByte to use a higher number.


    David Dean
    • Proposed as answer by maethe Monday, January 10, 2011 7:40 PM
    • Marked as answer by Mike Walsh FIN Monday, January 10, 2011 8:25 PM
    Friday, December 10, 2010 4:02 PM

All replies

  • Hi Sconyelq,

    can you please check your contenttype ID or it's better to paste here so that every one have a chance to look in to it.

    For creating a child by using the parent you make sure to give the same contenttypeID+01 hope you followed the same thing.if not correct it.

    for deleting the content type make sure you delete all site columns associated to that content type and list/document libraries activates that content type.

     in worst case your site columns also assoicated in the Custom site columns group and delete those also. i had faced this s ituation once. now you can delete your content type

    let me know your feedback

    Thanks,

    Nivas 

    Tuesday, June 08, 2010 6:57 AM
  • The parent's content type id is 0x010100D7F3664261AB9940B9871BA69883F007. All of the children I created have the correct ending (01, 02, etc). All of these content types were created through the SharePoint interface, not via a feature, so I don't think there's a mistake.

    Unfortunately, I cannot back up and delete anything. These content types are already heavily used in our organization.

    Tuesday, June 08, 2010 11:58 AM
  • Sconyleg

    I got the same issue today itself. I was wondering I am the only person that getting this error. Basically I have created content type based on custom parent type and binded to my publishing layout. Then deployed as feature attribute. When I tried to create page based up on the content type I am getting this error " A duplicate name "ContentType_somename" was found" When I checked the log file I observed the following

    A critical error occurred while creating a PublishingPage through PublishingPageCollection.Add(string, PageLayout). Microsoft.SharePoint.SPException: A duplicate name "ContentType_somename" was found.     at Microsoft.SharePoint.SPContentTypeCollection.AddContentType(SPContentType contentType, Boolean checkName, Boolean updateResourceFileProperty)     at Microsoft.SharePoint.SPContentTypeCollection.Add(SPContentType contentType)     at Microsoft.SharePoint.Publishing.PublishingPageCollection.ForceAddContentTypeToList(SPContentType contentTypeToAdd)     at Microsoft.SharePoint.Publishing.PublishingPageCollection.<>c__DisplayClass5.<Add>b__0()     at Microsoft.Office.Server.Diagnostics.FirstChanceHandler.ExceptionFilter(Boolean fRethrowException, TryBlock tryBlock, FilterBlock filter, Ca...

     

    My Guid is 0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF390004596A23B7914d2e94BD107C8B43A0FA and I didnt find any content type with this id in my entire huge solution.

    Did you resolved the issue. I believe I provided the details. Please can anyone help me out. 


    Best
    Thursday, June 10, 2010 5:37 AM
  • 0x0101 ::::: Base content type

    00

    C568DB52D9D0A14D9B2FDCC96666E9F2  :::::Parent of Parent

    00

    7948130EC3DB064584E219954237AF39 :::: Parent

    00

    04596A23B7914d2e94BD107C8B43A0FA :::::   Your content type

     

    If we look at the above GUID n break up, above is what we see. Just check in case we have all content types present (parent &  parents parent)?

    Thursday, June 10, 2010 7:18 AM
  • @sharepoint_alien: Unfortunately I haven't gotten this resolved yet.
    Thursday, June 10, 2010 11:35 AM
  • Okay ..

    I have just created another content type and attached to the new page layout..But believe me it took a while. Then I tried to delete the previous content type but it is saying content type is still in use. Appreciate me as I've already deleted the pages which have been created earlier depend on the previous page layout.  What could be the reason for that.

     I executed the following delete query 

    DELETE

    FROM AllUserData

    WHERE(tp_DirName LIKE '%')

    AND((tp_ContentType = 'ContentType_somename'))

    It deleted from sql but surprisingly I am getting the same error saying contenttype is still in use. (my content type is not attached to any workflows at all) What could be the reason? Will be any chance of having hidden pages that uses the content type? And How can I delete it

    Thanks


    Best
    Friday, June 11, 2010 1:03 PM
  • I fixed this problem of contenttype in use. Actually it was my mistake. I have deleted the content type by editing the pages library itself. 

    But it lead me another error message when I try to delete the content type. It is saying The content type is part of application feature. DO any one got this prob before.. Please let me know.


    Best
    Monday, June 14, 2010 2:29 PM
  • Hold on just a second Anjali! That is not the answer to the original thread question...which is my issue. :) Otherwise this would be considered a thread highjack. The original question is still unanswered.
    Thursday, June 24, 2010 11:20 AM
  • I just spent a couple of days trying to nail down a similar issue and I think I have a possible answer. I was also getting the following error message when trying to create a child content type:

    A duplicate content type "My Content Type" was found.

    In some cases (such as creating a new content type via the web services), you may get a message in the logs that looks like:

    Microsoft.SharePoint.SPException: The local device name is already in use. (Exception from HRESULT: 0x80070055)

    In the content database, SharePoint maintains a list of content types in the table dbo.ContentTypes. There is a column named NextChildByte that is a counter used to form the ContentTypeId when creating child content types. Under certain situations (such as creating a new child content type from a feature), it is possible to create a content type that already uses the next sequence number from its parent. Once this occurs, this error will take place whenever you try to create a new child of that parent.

    The solution: Find the row in the dbo.ContentTypes table that matches your SiteId, ContentTypeId, and Scope, then edit the NextChildByte to use a higher number.


    David Dean
    • Proposed as answer by maethe Monday, January 10, 2011 7:40 PM
    • Marked as answer by Mike Walsh FIN Monday, January 10, 2011 8:25 PM
    Friday, December 10, 2010 4:02 PM
  • Hey guys, I had exactly the same problem and Davids solution resolved it.
    I have a custom ct (Room) derived from an item. some days before i could create sub cts from it. today as I wanted to create another sub ct from it I got the same error message as written above:

    A duplicated content type "Application" was found.

    NextChildByte in dbo.ContentTypes was set to 1 and after editing to 2 its possible again to create sub cts of my custom ct.
    Thx David you've just saved me the day.. :)

    Monday, January 10, 2011 7:50 PM
  • Moderator Note:

     

    sconyelg hasn't posted anything to any forum since September so I'm ignoring his final post in this thread; marking the one full answer in the thread and then locking it.


    SP 2010 "FAQ" (mainly useful links): http://wssv4faq.mindsharp.com/default.aspx
    WSS3/MOSS FAQ (FAQ and Links) http://wssv3faq.mindsharp.com/default.aspx
    Both also have links to extensive book lists and to (free) on-line chapters
    Monday, January 10, 2011 8:28 PM