Duplicate ID Error - Best Bests Reporting as Duplicates with # Anchor Tags RRS feed

  • Question

  • Hello all!

    I usually find what I am looking for on the Internet, but today this one has me stumped.  I managed to resolve the issue, but I believe the underlying cause may actually be a bug.  So, I ask if anyone else has run into this?

    I had our Librarian entering Keywords into a MOSS 2007 SP1 with Infrastructure Updates server.  She put in the Keyword like the other 500 she has created, entered the Best Bets and created the Keyword normally.  The problem was when she opened the Keyword management list she got the infamous "An item with the same key has already been added".  So I did some digging on the Internet and found the KB article (http://support.microsoft.com/kb/939077) on duplicate Best Bets and the associated hotfix.  So I picked up the hotfix, tried to install, but I believe it was already included in SP1, so it would not install as I suspected.  After that I decided to do some digging in the databases, which I know is not supported and not recommended.  I found in the SSP DB two entries under the MSSBestBets table URL field similar to this:

    Best Bet Entry 1 - http://www.xyz.com/site/subsite/page.aspx
    Best Bet Entry 2 - http://www.xyz.com/site/subsite/page.aspx#here

    Both were just created and both related to the Keyword our Librarian just made and both had unique entries in the ID field.  So...doing the not recommended or supported action, I went ahead and changed the 2nd entry's URL field to http://www.xyz.com/site/subsite/page1.aspx#here, as I know that is the "key" used in determining duplicates, and poof, issue resolved!

    So, I guess my question is how would MOSS 2007 SP1 with Infrastructure Updates report that the two Best Bet URL Entries above are duplicates when they clearly are not?  Am I missing something or is this more an issue with the programming of the Keyword management portion of MOSS?

    EDIT: I keep running into this issue, but appears to be isolated.  Anyone else having this problem at all???

    Thanks a ton!

    Tuesday, August 19, 2008 5:26 PM

All replies

  • I am having this same issue, and have been for about a year now.
    Wednesday, June 24, 2009 1:57 PM
  • We are also having the same problem in one of our site collections and I had been looking for the solution for a couple of weeks now. We'll  be avoiding using anchor tags in our urls for best bets in the future.
    Friday, June 26, 2009 5:10 PM
  • I had this exact same issue.  I was running WSS 3.0 with SP2 installed.  Thank you very much pointing me to this table.  When looking at the MSSBestBets table I had two entries that had a similar Url, except one had an anchor tag. 
    Wednesday, September 30, 2009 2:11 PM
  • I'm glad I am not the only one! Hopefully a bug fix will be released on this one in the future as anchor tags, while infrequently used, should be available in best bet URLs without conflicts.
    Tuesday, October 13, 2009 3:51 PM
  • Jeremy,

    Thanks for pointing me in the right direction. I have resolved this issue and I no longer receive the error.

    First I ran the following database query to determine duplicate BestBetURLs:

     select url, count(url)
     from mssbestbets
     group by url
     having (count(url) > 1)

    For examples sake, it returned this url http://www.abc.com/xxx.aspx

    Then to find out the bestbetIDs, I ran this query:
    select * from mssbestbets where url = 'http://www.abc.com/xxx.aspx'

    Now, I updated one of those URL's to:
    update mssbestbets
    set url = 'http://www.abc.com/xxx.aspx2'
    WHERE bestbetID = 149

    Next, I deleted my cache and cookies, then logged back into the BestBest Admin tool.

    Then, within the Admin tool, I did a BestBestURL search for http://www.abc.com/xxx.aspx2

    For each of the listings found, I edited each one by removing the BestBetURL then re-added it by choosing the "Select Existing Best Bet" url and choosing the url without the suffix .aspx2. After I edited each listing, the BestBetURL http://www.abc.com/xxx.aspx2 was automatically removed from the database.

    In summary, when adding or editing a keyword entry, always check to see if an “Existing Best Bet” URL already exists. If a duplicate URL is entered you will once again see the "an item with the same key has already been added" error.

    Thanks again for pointing me in the right direction!!!

    Microsoft could simply have added a unique constraint on the URL field of the msbestbets table to ensure only unique urls are allowed. If you did this and your Librarian tried to add a duplicate url, then a SQL Server error would occur, which would signal her to refresh her page and choose the "Select Existing Best Bet" option.
    Thursday, January 14, 2010 9:52 PM
  • Just a tip - I got around this problem by putting in a fake querystring value. So if you have the 2 following URLs:

    change the second URL to read: http://www.xyz.com/site/subsite/page1.aspx?#here (Notice the additional question mark). If you need more just keep changing the querystring such as http://www.xyz.com/site/subsite/page1.aspx?dummy=1#here

    Hope that helps.


    Tuesday, December 21, 2010 5:05 PM
  • We ran into this today. The supported method for fixing this is to identify the problematic Best Bet, either by looking at the database (sorting the Best Bets table by Url), or by looking at the latest entry added (it is the most likely candidate). Then once the problematic BB is identified, remove it from the keyword(s) it is in and save, this will remove the BB from the database, then add in the BB which has the Url without the anchor tag as the BB for these keywords.

    Worked for us, many thanks for the pointer Jeremy!

    Doug Chandler SharePoint Application Architect

    Monday, September 30, 2013 3:28 PM