It was a typical Monday like you would expect it. I got word that the Managed Metadata Service is not working correctly. The Managed Metadata Service Application Proxy is inaccessible.
I got this beautiful message when I tried to manage my Managed Metadata Service Application.
I’m sure most of you are familiar with this message. So I started digging the logs for an explanation.
ULS Log Entries
WcfSendRequest: RemoteAddress: 'http://[URL]/MetadataWebService.svc' Channel: 'Microsoft.SharePoint.Taxonomy.IMetadataWebServiceApplication' Action: 'http://schemas.microsoft.com/sharepoint/taxonomy/soap/IDataAccessReadOnly/GetSessionDataWithTermStoreId' MessageId: 'urn:[URN]' [GUID] Entering monitored scope (ExecuteWcfServerOperation). Parent No WcfReceiveRequest: LocalAddress: 'http://[URL]/MetadataWebService.svc' Channel: 'System.ServiceModel.Channels.ServiceChannel' Action: 'http://schemas.microsoft.com/sharepoint/taxonomy/soap/IDataAccessReadOnly/GetSessionDataWithTermStoreId' MessageId: 'urn:[URN]' [GUID] MetadataWebServiceApplication.GetSessionData called on 'Managed Metadata Service Application' starting. [GUID] MetadataWebServiceApplication.GetSessionData called on 'Managed Metadata Service Application' completed. [GUID] Leaving Monitored Scope (ExecuteWcfServerOperation). Execution Time=2,27473044758482 [GUID] Failed to get term store for proxy 'Managed Metadata Service Application'. Exception: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. at Microsoft.SharePoint.Taxonomy.Internal.XmlDataReader.GetDateTime(String name) at Microsoft.SharePoint.Taxonomy.Internal.SharedTermStore.Initialize(IDataReader dataReader, Guid termStoreIdValue, Boolean fromPersistedData) at Microsoft.SharePoint.Taxonomy.Internal.SharedTermStore..ctor(IDataReader dataReader, Guid termStoreId, Boolean fromPersistedData) at Microsoft.SharePoint.Taxonomy.Internal.DataAccessManager.GetTermStoreData(MetadataWebServiceApplicationProxy sharedServiceProxy, Boolean& partitionCreated) [GUID] The Managed Metadata Service 'Managed Metadata Service Application' is inaccessible. [GUID]
… The given key was not present in the dictionary. I haven’t seen this one before.
So I went on and checked the usual suspects…
- Managed Metadata Web Service (running?) – check
- IIS configuration – check
- Accounts – check
… and I found everthing in perfect condition.
A new challenge asks for a new solution.
I created a totally new Managed Metadata Service Application just to prove that the configuration is correct and it worked perfectly fine like expected.
Now I was sure that there must be a problem with the old ApplicationPool or the Managed Metadata Service Database!
The Database? Nooooo, they are too robust to break. 😉
Because of the error message I was pretty sure that there was a problem with the ApplicationPool. To prove my theory and to get my Managed Metadata Service Application back to work, I recreated it with this script.
$meta = New-SPMetadataServiceApplication -Name "Managed Metadata Service Application" -ApplicationPool "Managed Metadata Service Application Pool" -DatabaseName "[Old Metadata DB Name]" New-SPMetadataServiceApplicationProxy -Name "Managed Metadata Service Application Proxy" -ServiceApplication $meta -DefaultProxyGroup
If the old ApplicationPool was dedicated to the old Managed Metadata Service Application you should delete it. You can use this script to do so.
$metaapppool = Get-SPServiceApplicationPool -Identity "[ApplicationPool Name]" $metaapppool.Delete()
TechNet Page Get-SPServiceApplicationPool
I still don’t know how or why this happened, so I would appreciate your hints and ideas.