Failed to read from or write to database error while adding new terms in Term Store Management in SharePoint 2013 or SharePoint 2016

term store management SharePoint 2013 central administration
Check out Best Alternative to InfoPath


Hello Folks,
One fine day, you get an email from your customer stating that he/she is unable to add hashtags (Eg: #MSIgnite) in the SharePoint OOB Newsfeed web part added in the intranet homepage. Here is below error we get once we try to add the Hashtag. The error says:


Something went wrong.
This couldn’t be posted because we’re having some issues at the moment.

Do you want us to retry?

SharePoint returned the following error: Failed to read from or write to database. Refresh and try again. If the problem persists. please contact the administrator. Contact your system administrator for help in resolving this problem.


term store management SharePoint 2013 central administration
term store management SharePoint 2013 central administration

But once we start troubleshooting we found out that we were able to add the #Hashtags which we have created already but not a new one.

what is term store in SharePoint 2013
what is term store in SharePoint 2013

Basically, the hashtags are part of the Managed Metadata Service. So we checked the service in the Central Administration and it was in an online state. We stopped and restarted once again but that didn’t help.

sharepoint 2013 term store best practices
sharepoint 2013 term store best practices

So I decided to take help from the Social tech-community Forums but didn’t get a solution to solve the issue.

After a while, we went to the term store management and checked the hashtag term and tried creating a new hashtag through GUI, we got the below error. The same error we got while trying to add/delete term in any group in the Term Store.

sharepoint term store management add term
sharepoint term store management add term

Now as per the error statement, the issue seems like there is something wrong in the database.
Open the Web Front End Server check if the Managed Metadata Service Database is Read and Write Enabled

This piece of PowerShell helps in the getting the Database Info of the Managed Metadata Service
$mms = Get-SPServiceApplication -Name Managed_Metadata_Service
$mms.Database.Name
$mms.Database.IsReadOnly

Once we run the above PowerShell script we get the database name of the Managed Metadata Service and the read/write status of the database
PS C:\Users\sp13_farm> $mms = Get-SPServiceApplication -Name Managed_Metadata_Service
$mms.Database.Name
$mms.Database.IsReadOnly
Managed_Metadata_Service_DB
False

Now it’s time to check the Database Server.

Go to the DB server > Open SQL Server Management Studio > Check the Managed_Metadata_Service_DB

The permissions are fine for the DB. Ok as a first troubleshooting step, we tried creating a table via GUI, we get the below error,

SharePoint 2016 term store
SharePoint 2016 term store

Finally, we identified that the issue is with the Transaction Log File which is actually full.

Go to the Properties of the Database > Click on Files > under the Log file type check the Initial Size, Auto growth Column which has got exceeded and the auto growth was restricted which means the DB won’t allow being modified.

We can’t make any changes to existing configuration for the log file size. We can only add a new log file and map to the DB. Check out this Microsoft Documentation on how to do that.

Failed to read from or write to database
Failed to read from or write to database

Once you are done mapping the new transaction log file, the term store management returns back to the normal state.


You May Also like the Following SharePoint Online Tutorials:

About Prabhu Nehru

I'm a SharePoint Consultant with extensive experience in SharePoint/Office 365 and related technologies and I'm currently based out of Coimbatore (India).

View all posts by Prabhu Nehru →