This blog would be useful for those who are recovering from a disaster and are trying to rebuild system databases for SQL Server. In this blog, we would learn how to fix permission related error which I observed during the rebuild of system databases using SQL Setup. The error message in the log was: While updating the permission setting for the folder, the permission setting update failed for the file. Today we will discuss an error about REBUILDDATABASE.
I wrote a blog earlier which one of my clients followed about an error in the rebuild database. SQL SERVER – REBUILDDATABASE Error: 0x851A0012 – Missing sa Account Password. The sa Account Password is Required for SQL Authentication Mode
The same command was tried by my clients, but it was failing with different error:
Final result: Failed: see details below
Exit code (Decimal): -2066808828
Start time: yyyy-mm-dd hh:mm:ss
End time: yyyy-mm-dd hh:mm:ss
Requested action: RebuildDatabase
Feature: Database Engine Services
Status: Failed: see logs for details
Reason for failure: An error occurred during the setup process of the feature.
Next Step: Use the following information to resolve the error, and then try the setup process again.
Component name: SQL Server Database Engine Services Instance Features
Component error code: 0x84CF0004
Error description: While updating permission setting for folder ‘F:\MSSQL\MSSQLSERVER\Data\MSSQL11.MSSQLSERVER\MSSQL\JOBS’ the permission setting update failed for file ‘F:\MSSQL\MSSQLSERVER\Data\MSSQL11.MSSQLSERVER\MSSQL\JOBS\Check DB_20190521170029.txt’. The folder permission setting were supposed to be set to ‘D:P(A;OICI;FA;;;BA)(A;OICI;FA;;;SY)(A;OICI;FA;;;CO)(A;OICI;FA;;;S-1-5-80-4075806543-296798423-764872590-3661508593-3560600922)’.
When I searched for an error message, I found Microsoft KB,
but it was not applicable to us there were no mount points involved here. Also, the file name mentioned in the message was a file which was a job history created long ago. After deleting the file, we ran setup again and it failed for a different file.
It looks like, due to some unknown reason, SQL Setup was not able to set permission to files. The quick solution which worked for me was to move JOBS folder to somewhere else (outside “Program Files”) and created empty folder with same name. It looks like it was due to some kind of corruption in the file permission.
Have you seen such error while doing rebuild database or some other setup activity?
Reference: Pinal Dave (https://blog.sqlauthority.com)