Tuesday, October 25, 2011

Utilize the Managed Metadata Service application tip #8 - How to resolve error "This operation cannot be completed. The term store may be unavailable."


If you add a managed metadata column to a site, you may get the following error "This operation cannot be completed. The term store may be unavailable.". The end user will have the screen like this in the screen shot.




After looking at this issue and I’m able to reproduce this consistently on RTM version. Here is the steps to reproduce this issue.

After looking at this issue and I’m able to reproduce this consistently on RTM version. Here is the steps to reproduce this issue.

1.       Create a site collection with URL http://<server>:<port>/sites/MMD2
2.       Add a local term on one of the lists on the site. See screen shot. This will create a local term store.
3.       Delete the site collection
4.       Recreate a site collection with SAME URL http://<server>:<port>/sites/MMD2
5.       Try to add one managed metadata column with local term store


You will get the same error. SharePoint logs is listed below.

10/24/2011 13:39:45.45 w3wp.exe (0x2738)                       0x26E4  SharePoint Foundation                 Topology                                      e5mc     Medium               WcfSendRequest: RemoteAddress: 'http://sbx01:32843/cbcfc9eb8878494b84958f40d075e575/MetadataWebService.svc' Channel: 'Microsoft.SharePoint.Taxonomy.IMetadataWebServiceApplication' Action: 'http://schemas.microsoft.com/sharepoint/taxonomy/soap/IDataAccessReadOnly/GetChanges' MessageId: 'urn:uuid:dcaf0d35-ada7-437d-90dc-83dfa6ad5869'     
   
10/24/2011 13:39:45.46 w3wp.exe (0x09E4)                       0x209C  SharePoint Foundation                 Topology                                      e5mb    Medium               WcfReceiveRequest: LocalAddress: 'http://sbx01.na.qualcomm.com:32843/cbcfc9eb8878494b84958f40d075e575/MetadataWebService.svc' Channel: 'System.ServiceModel.Channels.ServiceChannel' Action: 'http://schemas.microsoft.com/sharepoint/taxonomy/soap/IDataAccessReadOnly/GetChanges' MessageId: 'urn:uuid:dcaf0d35-ada7-437d-90dc-83dfa6ad5869'          8d6fb8d3-f669-4791-abf0-4d63bfe9a9ea
 

Please note the URL has the GUID that may be poiting to the previous site colletion. This is only happens on RTM version  and it seems to be resolved on Sp1 + June CU. Here is the defference for RTM version and SPA + JUne CU if you add managed metadata columns on the recreated site colelction with same URL.

On RTM version server sbx01, you will not be able to create new managed metadata group and the old managed metadata table EMCGroup still have the old group. It seems like RTM prevent new group created with same name.
On SP1 + June CU version sbx04, we are able to create new managed metadata group and add terms. When we check the managed metadata service table EMCGroup, you will see new group created with additional "-1" appended to previous group name as in the screen shot.


So the real problem for deleting site collection is  none of the managed metadata associated with the site collelction will be deleted. The managed metadata associated with deleted site will become orphan data. If you create another site collection with same URL on RTM version, it will fail to overwrite existing data. 

Although SP1 + June CU seems to "resolve" the issue, you will see the orphan  managed metadata still in the table after site deleted. As a result, in order to resolve the issue, you would need to delete the managed metadata columns, delete the local managed term store before deleting the site collection. This way, you have clean managed metadata table.

If you have any better solution, please share. You could refer other blog on managed metadata service.


Utilize the Managed Metadata Service application tip #1 - How to resolve "The required feature is not enabled for this column type" error 

Utilize the Managed Metadata Service application tip #2 - Metadata column not visible for users other than site collection administrators

Utilize the Managed Metadata Service application tip #3 – Impact of message “Earlier versions of client programs might not support this type of column” on Document Library

Utilize the Managed Metadata Service application tip #4 – How to workaround "Deletion of this user as a contributor failed" for local term store 

Utilize the Managed Metadata Service application tip #5 – Be aware of "Deletion of this user as a contributor failed" error on AD groups for local term store

Utilize the Managed Metadata Service application tip #6 – How to fix "The default termstore for this site cannot be identified " error

Utilize the Managed Metadata Service application tip #7 – How to read managed metadata column relationship 

Utilize the Managed Metadata Service application tip #8 - How to resolve error "This operation cannot be completed. The term store may be unavailable."

Friday, October 21, 2011

Utilize the Managed Metadata Service application tip #7 – How to read managed metadata column relationship


As we mentioned before, the Managed Metadata Service application is one of the most important and interesting new service applications in SharePoint Server 2010.  However, it’s very frustrating for SharePoint users and administrations when error comes up especially if you migrated the site from one environment to another with local term store, delete the term, migrate site from one webapp to another one with different Managed Metadata Service application.  
The major issues is that it’s very difficult to understand what are the relationship between all the different parts. In this blog, I’ll dive deep into the relationships between terms, hidden site, local term store, and global Managed Metadata Service application database. You should be able to understand what you should look for if you understand the relationships. We are hoping we could use this knowledge to fix some issues encountered using Managed Metadata terms.
In order to understand the details of the Managed Metadata Service application and the relationships, let’s clarify a number of concepts that you will need to familiarize yourself with. Term Store This is the database in which our managed metadata is stored in. Term is a word or a phrase that can be associated with an item in SharePoint Server 2010. Term set is a collection of related terms.  
We setup one list called TestMMD on site MMTest3. Then add a managed metadata column and create term store and terms as follows. Click list TestMMD -> List Ribbon -> Create Column -> Select managed metadata -> Click Customize your term set -> Enter Term Set Name “Metadate” -> Create two terms “Term1” and “Term2”. The URL for the list is http://<servername>:<port>/sites/MMTest3/Lists/TestMMD/AllItems.aspx. See screen shot for the list with two items.
The local term store will be created when creating the term managed metadata list column. You could see the managed metadata local term sets as follows.
Site Actions -> Site Settings -> Term store management. You will noticed term store group created as “Site Collection - sbx01-12726-sites-MMTest3”. Term Set Name “Metadate”. Two term “Term1” and “Term2” as in the following screen shot.
Now view the hidden list with URL http://<server>:<port>/sites/MMTest3/Lists/TaxonomyHiddenList/AllItems.aspx that keep the relationship of the terms as in the following screen shot. We have modified the view to add columns "ID",  "IdForTerm",  "IdForTermSet", and  "IdForTermStore".
I would recommend you to  pay attention to the TaxonomyHiddenList since it is the key to explain the relationship of the terms. You could click list on the Ribbon and click “Open with Access”. You can click “Database Tool” and click “Relationships” from the ribbon. Now you will see the relationships for the terms as in the following screen.
  
Now you will see the hidden column “Taxonomy Catch All Column” is a look up column pointing to TaxonomyHiddenList to look for terms. The TaxonomyHiddenList columns "IdForTerm",  "IdForTermSet", and  "IdForTermStore" are pointing to managed metadata service application database tables.
1.       IdForTermStore value e2c31d84-3f0a-4c92-9acb-8929f59d075b is point to the database table GUID that will change for different managed metadata services or if you migrate from one farm to another.
2.       IdForTerm values 25DEEB80-3336-42EB-A19D-696ED11B976B and 476BAE73-C78C-4F9C-81CF-387631DE78F6 can be queried form table ECMTerm
Table ECMTerm
UniqueId
25DEEB80-3336-42EB-A19D-696ED11B976B
476BAE73-C78C-4F9C-81CF-387631DE78F6
3.       IdForTermSet value 63BB6778-545C-4284-8E3C-D4395A292222 can be queried from table ECMTermSet.
Table ECMTermSet
UniqueId                                                                             Owner                  Name
63BB6778-545C-4284-8E3C-D4395A292222            NA\harryc           1033|Metadate
You could see all these relationships from the database table screen shot.
 
Now, you will understand the following issues you might have.
1.       If you move one list from different site collection to another, the term will break since it will not find the lookups from the correct TaxonomyHiddenList. The previous lookup GUID will point to old lookup value.
2.       If you delete the site collection and backup it again. The term will have the same lookups to TaxonomyHiddenList. However, the new site collection will have new local term store GUID.
3.       If you delete the managed service application and recreate again, the term store HUID changed.
4.       If you migrate the site content DB and managed metadata database from one farm to another, you might still have links broken somewhere.
We are in the progress to evaluate all the proposal suggested to finalize the procedure how to link back the local terms to managed metadata database. We will keep you posted whence we have the good approach. Please refer to other blog on managed metadata service.

Utilize the Managed Metadata Service application tip #1 - How to resolve "The required feature is not enabled for this column type" error 

Utilize the Managed Metadata Service application tip #2 - Metadata column not visible for users other than site collection administrators

Utilize the Managed Metadata Service application tip #3 – Impact of message “Earlier versions of client programs might not support this type of column” on Document Library

Utilize the Managed Metadata Service application tip #4 – How to workaround "Deletion of this user as a contributor failed" for local term store 

Utilize the Managed Metadata Service application tip #5 – Be aware of "Deletion of this user as a contributor failed" error on AD groups for local term store

Utilize the Managed Metadata Service application tip #6 – How to fix "The default termstore for this site cannot be identified " error

Utilize the Managed Metadata Service application tip #7 – How to read managed metadata column relationship 

Utilize the Managed Metadata Service application tip #8 - How to resolve error "This operation cannot be completed. The term store may be unavailable."