This project is read-only.

Same error running your fix

Dec 21, 2007 at 5:27 PM
So, I downloaded your SharePointFix utility, because I am having the same problem with a MOSS installation at a client site. The farm has 2 Web Front End Servers, 1 Application Server, and 1 Database Server. I cannot make any configuration changes in Central Administration, I get the following error:

"Item has already been added. Key in dictionary: '217' Key being added: '217'"

I can't run a backup from stsadm -o backup because I get the same error. I tried upgrading to Service Pack 1 for WSS and MOSS, and I get the same error when the upgrade attempt happens in SharePoint Configuration Wizard.

Now, I run your utiity on the primary MOSS Web Front end server, and I get the same error!

Has anyone experienced this same issue and successfully gotten it resolved?

Thanks,
Matt
Dec 28, 2007 at 3:32 AM
is your primary web server also the application server? if it isn't run the fix on your application server. if you are still having the problem let me know and I will tell you where I found the problem in the database.
Dec 31, 2007 at 3:52 PM
Thanks, I will try that. Given the holidays, I was out of the office last week. I will try this today. In the meantime, I'd be interested in knowing where the problem is in the database, so if you could post that information that would be great!

Thanks again, I'll let you know if it worked successfully on the Application Server.
Dec 31, 2007 at 6:29 PM
I tried running SharePointFix.exe from the Application Server, after waiting for awhile, the application returned the same error.

"Item has already been added. Key in dictionary: '217' Key being added: '217'"

at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add
)
at Microsoft.SharePoint.Administration.SPAutoSerializingObject.DeserializeBas
icObject(XmlElement xmlValue)
at Microsoft.SharePoint.Administration.SPAutoSerializingObject.SetStateXml(Xm
lNodeList childNodes)
at Microsoft.SharePoint.Administration.SPAutoSerializingObject.SetStateXml(Xm
lDocument value)
at Microsoft.SharePoint.Administration.SPPersistedObject.Initialize(SPConfigu
rationDatabase configurationDatabase, Guid id, Guid parentId, String name, SPObj
ectStatus status, Int64 version, XmlDocument state)
at Microsoft.SharePoint.Administration.SPConfigurationDatabase.GetObject(Guid
id, Guid parentId, Guid type, String name, SPObjectStatus status, Byte[] versio
nBuffer, String xml)
at Microsoft.SharePoint.Administration.SPConfigurationDatabase.GetObject(SqlD
ataReader dr)
at Microsoft.SharePoint.Administration.SPConfigurationDatabase.RefreshCache(I
nt64 currentVersionOverride, List`1& newObjects, List`1& deletedObjects, Int64&
newestObjectVersion)
at Microsoft.SharePoint.Administration.SPConfigurationDatabase.RefreshCache()

at Microsoft.SharePoint.Administration.SPConfigurationDatabase.StoreObject(SP
PersistedObject obj, Boolean storeClassIfNecessary, Boolean ensure)
at Microsoft.SharePoint.Administration.SPConfigurationDatabase.PutObject(SPPe
rsistedObject obj, Boolean ensure)
at Microsoft.SharePoint.Administration.SPPersistedObject.Update()
at Microsoft.SharePoint.Administration.SPService.Update()
at Microsoft.SharePoint.Administration.SPDiagnosticsService.Update()
at Microsoft.SharePoint.Administration.SPDiagnosticsService.get_Local()
at SharePointFix.Program.Main(String[] args)

Thanks!
Jan 3, 2008 at 2:25 PM
Sorry I'm late in my response but I was out for new years. Anyway heres a break down of what sharepointfix.exe does and where you can find the record it fixes in the database:
Basically what I found when I had the problem was that they was a database record for the Diagnostic Service that had a hashtable that stored events with a key assigned to them. In your case key 217 is already in use but it keeps trying to use that key. Sharepointfix.exe essentially clears the log using Sharepoints API and allows you to start with a blank log. I later turned of the diagnostic service so I didn't run into the problem again but that is totally up to you.

Since the fix isn't working for you I'm not sure manipulating the database directly is going to work for you but heres where I found the problem:
  • BACKUP YOUR ALL YOUR SHAREPOINT DATABASES BEFORE DOING ANY OF THESE STEPS
  • Open your Sharepoint Configuration database in SQL Management Studio or whatever tool you want to use.
  • That database contains a table called dbo.Objects right-click and open the table
  • Right-click over the open table results and go to Pane>SQL
  • In the SQL Pane run this query
    • SELECT Id, ClassId, ParentId, Name, Status, Version, Properties
    • FROM Objects
    • WHERE (Properties LIKE '%DiagnosticsService%')
  • Once you execute that query you should see two results. Lookin the properties field and you should see something like:
    • <object type="Microsoft.SharePoint.Administration.SPDiagnosticsService ...
    • <object type="Microsoft.Office.Server.Administration.DiagnosticsService ...
  • If you copy and paste the entire properties field of both those rows into notepad(its easier to read in notepad) you should see your 217 key in there.
  • I have tried just removing the 217 key from the properties field without success. The only thing I found that worked consisiantly was to delete both rows from the database The reason for backing up all the databases before you run this fix
  • Then open the sharepoint administration site and you should be able to make changes again.

If you have any more questions please let me know and I'll will do my best.

Thanks,
Kent
Jan 3, 2008 at 3:03 PM
I guess I should have asked this first but are you running Sharepoint 2003 or 2007?
Nov 23, 2011 at 8:29 AM

This worked for me. Thanks!

Nov 15, 2012 at 11:08 AM

Hi,

I'm getting the below error while creating the Calculated Site column in SharePoint 2010.

I executed your EXE in App server but still I'm seeing this issue, I tried manual steps which you provided in above discussions but I didn't find the Key specified in the below error "Auto Update_AutoUpdate" in Objects table properties column.

Could you please help me on this issue, let me know if you need any information from my side.

System.ArgumentException: Item has already been added. Key in dictionary: 'Auto Update_AutoUpdate'  Key being added: 'Auto Update_AutoUpdate'    at System.Collections.SortedList.Add(Object key, Object value)     at Microsoft.SharePoint.ApplicationPages.BasicFieldEditPage.WriteFieldNamesForFormulaColumnPicker(TextWriter output, SPFieldCollection fields, String currentDisplayName)     at ASP._layouts_fldnew_aspx.__Render__control15(HtmlTextWriter __w, Control parameterContainer)     at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)     at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)     at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)     at System.Web.UI.Control.RenderChil...    4f298607-8562-4ca6-a137-e97a53a6e1fe
11/14/2012 05:37:32.57*    w3wp.exe (0x239C)                           0x2940    SharePoint Foundation             Runtime                           tkau    Unexpected    ...drenInternal(HtmlTextWriter writer, ICollection children)     at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer)     at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output)     at System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer)     at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)     at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)     at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)     at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)     at Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase.RenderChildren(HtmlTextWriter writer)     at System.Web.UI.Page.Ren...    4f298607-8562-4ca6-a137-e97a53a6e1fe
11/14/2012 05:37:32.57*    w3wp.exe (0x239C)                           0x2940    SharePoint Foundation             Runtime                           tkau    Unexpected    ...der(HtmlTextWriter writer)     at Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase.Render(HtmlTextWriter writer)     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)    4f298607-8562-4ca6-a137-e97a53a6e1fe

 

I created this issue in Issue Tracker, please remove it if not required to be there.

 

Thanks,

Suman