Showing posts with label MOSS 2007. Show all posts
Showing posts with label MOSS 2007. Show all posts

SharePoint Web Services Error : An item with the same key has already been added

Hi There,


Recently i found that none of my SharePoint 2013 application services are working. Crashing and throwing unknown multiple kind of errors in event viewer. One of the famous error that i found was below with Event ID 3.

[code]WebHost failed to process a request. Sender Information: System.ServiceModel.Activation.HostedHttpRequestAsyncResult/47208365 Exception: System.ArgumentException: An item with the same key has already been added. at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result) at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) Process Name: w3wp Process ID: 12724 [/code]


While troubleshooting i noticed that none of SharePoint Web Services are browsing and crashing with below error. I knew that it isn't any SharePoint specific error so i tried to recall the changes i have done on server.

Server Error in '/925bc7e108ff47198283782382a09c0d' Application.


An item with the same key has already been added.
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.ArgumentException: An item with the same key has already been added.

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: 

[ArgumentException: An item with the same key has already been added.]
   System.Runtime.AsyncResult.End(IAsyncResult result) +622882
   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +196075
   System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar) +166




Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.33440




Resolution:

I noticed that somehow during troubleshooting of some other bug i removed the HTTPS bindings from IIS for SharePoint Web Services on Port 32844 which is must even if its not being used by SharePoint. I ran the below Command Prompt command and boom. The services are back.


[code]appcmd set site /site.name:"SharePoint Web Services" /+bindings.[protocol='https',bindingInformation='*:32844:'][/code]





Hope it help someone.

Happy SharePointing...!

MOSS 2007 Error While Central Administration Navigation

Hi There,

We got an error while using SharePoint 2007 or MOSS 2007 in our production farm that whenever we navigate to few links in MOSS 2007, the pages seems crashing. SharePoint threw some unexpected errors with a correlation ID. Nothing special found in ULS logs regarding this crash. SharePoint was working fine with no issue. Each and every MOSS site was working as expected. The issue was only with SharePoint 2007 Central Administration. After some troubleshooting we were able to locate some error and noticed that its throwing from SQL server side not any SharePoint crash. Digging out more confirmed its a SQL server issue. Below are the error details.

Error:
A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
   at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket()
   at System.Data.SqlClient.TdsParserStateObject.ReadBuffer()
   at System.Data.SqlClient.TdsParserStateObject.ReadByteArray(Byte[] buff, Int32 offset, Int32 len)
   at System.Data.SqlClient.TdsParserStateObject.ReadString(Int32 length)
   at System.Data.SqlClient.TdsParser.ReadSqlStringValue(SqlBuffer value, Byte type, Int32 length, Encoding encoding, Boolean isPlp, TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.ReadSqlValue(SqlBuffer value, SqlMetaDataPriv md, Int32 length, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ReadColumnData()
   at System.Data.SqlClient.SqlDataReader.ReadColumn(Int32 i, Boolean setTimeout)
   at System.Data.SqlClient.SqlDataReader.GetString(Int32 i)
   at Microsoft.SharePoint.Administration.SPConfigurationDatabase.FetchObject(Guid id)
   at Microsoft.SharePoint.Administration.SPConfigurationDatabase.GetObject(Guid id, Boolean checkInMemoryCache)
   at Microsoft.SharePoint.Administration.SPConfigurationDatabase.GetObject(Guid id)
   at Microsoft.SharePoint.Administration.SPPersistedObjectCollection`1.get_BackingList()
   at Microsoft.SharePoint.Administration.SPPersistedObjectCollection`1.GetEnumerator()
   at Microsoft.SharePoint.ApplicationPages.SelectWebApplicationDataSourceView.FillDataTable(DataTable table, DataSourceSelectArguments selectArguments)
   at Microsoft.SharePoint.WebControls.DataTableDataSourceView.Select(DataSourceSelectArguments selectArguments)
   at Microsoft.SharePoint.WebControls.AdministrationDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments)
   at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
   at System.Web.UI.WebControls.DataBoundControl.PerformSelect()
   at System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound()
   at System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls()
   at System.Web.UI.Control.EnsureChildControls()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


Solution:

We found that there is a table in SharePoint_Config with name Objects. We selected all rows from that table and found the same error. The reason was an uncommitted SQL query. A row in this table was not successfully committed and SQL server was failing while selecting all items. Luckily we found that item (by selecting the top items etc) with some tricks. The item ID was '05c7c555-736e-45ac-ab0a-8a47012877e3'. We did a trick and quried all items except the problematic one and it worked.

select * from objects where id <> '05c7c555-736e-45ac-ab0a-8a47012877e3'

Now we found the problem and tried to fix using below technique which worked fine.

ALTER DATABASE SharePoint_Config SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
ALTER DATABASE SharePoint_Config SET SINGLE_USER
GO
DBCC CHECKDB (SharePoint_Config, REPAIR_ALLOW_DATA_LOSS)
GO

Now repair the table.

USE SharePoint_Config;
GO
DBCC CHECKTABLE ('dbo.Objects',REPAIR_REBUILD)
GO

Repairing the table automatically deleted the uncommitted row and and we were able to select all items from that table. Magically the CA returned back and everything seems working now.


Happy SharePointing...!