Failed to read from or write to database SharePoint

This SharePoint tutorial explains, how to solve an error, Failed to read from or write to database. Refresh and try again. which comes in SharePoint 2013/2016

One fine day, I got 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 the 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 a database. Refresh and try again. If the problem persists. please contact the administrator. Contact your system administrator for help in resolving this problem.

failed to read from or write to database sharepoint

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.

failed to read from or write to database managed metadata

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.

import-spterms failed to read from or write to database. refresh and try again

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 terms in any group in the Term Store.

failed to read from or write to database. refresh and try again

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 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,

import-spterms failed to read from or write to database. refresh and try again

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 Logfile 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 the 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. refresh and try again

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

You may like following SharePoint tutorials:

This SharePoint tutorial, we learned how to fix an error, failed to read from or write to database. refresh and try again.

free sharepoint training

SharePoint Online FREE Training

JOIN a FREE SharePoint Video Course (3 Part Video Series)

envelope
envelope

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).

>