Find Us Online:

You are here:Home»Managed Metadata Error: Failed to read from or write to database. Refresh and try again. If the problem persists, please contact the administrator

Managed Metadata Error: Failed to read from or write to database. Refresh and try again. If the problem persists, please contact the administrator

Since Managed Metadata Service is one of my fav’s from all the 14 SharePoint Service Applications, if you come across the error below there can be many reasons and the best way to figure it out have the ULSViewer opened and look at all the logs with “Taxonomy” category.

TermStoreOperationException was caught:

Failed to read from or write to database. Refresh and try again. If the problem persists, please contact the administrator

Here is how the logs were looking for me

The code I was using is simply to create terms programmatically as below:

Term newTerm = ts.CreateTerm(row.Code.ToString(), 1033, new Guid());

newTerm.CreateLabel(row.Value.ToString(), 1033, false);

Looking from the log I got to know the mistake I was doing a new Guid() and the term already existed on the CommitAll of the term store.

On the CommitAll if you get the TaxonomyOperationException means there is something wrong in the code or the term. I changed my code to create a term as below and worked like a charm! Hope this saves you a day