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.

The Managed Metadata Service or Connection is currently not available. The Application Pool or Managed Metadata Web Service may not have been started. Please Contact your Administrator.
I’m sure most of you are familiar with this message. So I started digging the logs for an explanation.
EventLog
ULS Log Entries
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
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.
1 2 |
$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 |
TechNet Pages New-SPMetadataServiceApplication and New-SPMetadataServiceApplicationProxy
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.
1 2 |
$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.