What is preventing Agent Service from starting after:

  1. Failing to install CU.
  2. Running a successful repair after disabling HIPS.

Background: Installing CU's for Microsoft SQL Server I found I have an issue with the security software on my system.

After disabling the offending security software preventing my installation of patches and the repair process afterwards, I now have an issue with restarting the agent service.

Error during repair states:

Microsoft SQL Server #### Setup
The Following error has occured:
The process cannot access the file 'C:\windows\system32\perf-MSSQL13.MSSQLSERVER-sqlagtctr.dll'
because it is being used by another process.
Click 'Retry' to retry the failed action, or click 'Cancel' to cancel this action and continue setup.

I am thinking I do not need to repair the service just yet, but something will need to be fixed.

New thoughts?

  • I so want to ask the question, "How do I fix a failed installation of MS SQL CU Patches?" and answer with after looking at all the great guidance from Microsoft to 1. Backup system 2. Backup Databases 3. Install during off hours Then add to all the forums out there, disable the offending security software during patch installation. Feb 21, 2021 at 23:30
  • What is the security software that prevents you from installing CUs? In what way does it prevent install? Are there errors logged when you start Agent? What makes you think the install is corrupt? Did the install fail with errors, or succeed?
    – AMtwo
    Feb 21, 2021 at 23:35
  • I think it should include all security software in general. Regarding the install, I am updating my question with some information, and I may have a solution. Feb 22, 2021 at 0:25
  • So did not find a solution, but found another bread crumb trail. Feb 22, 2021 at 0:42
  • I've not had an issue with antivirus/security software preventing a CU install in the last decade. Details on what the software is, and how it is preventing CU install are very relevant to your question. Please update your question with details on the nature of the CU install failure, including any errors during CU install, or messages from your security software.
    – AMtwo
    Feb 22, 2021 at 5:49

1 Answer 1


Continuing to troubleshoot I did a search for sql repair perf-mssql13.mssqlserver-sqlagtctr.dll being used by another process and found the following article: Knowledgebase article: File in use by another process

The repair continued after I applied the same advice to the file in question.

When repair completed I was not able to start the agent service. I did a search for the following from the "Event Viewer": failed to initialize sql agent log (reason access is denied) and found the following article: MSSQLTIPS: SQL Server Agent Service Won't Start Due to Access Denied

What I found out: when SQL is installed, it places a security lockdown on the log directory. It changes owners and restricts access to only the agent service account. The DBA that installed the system used default settings to install SQL Server, and then changed the service accounts to domain accounts. In this case, I found it curious the Engine Service account had access to the directory, but not the Agent Log files.

Solution: Check the permissions on the Log Directory and look for errors regarding the files.

  1. Rename the file from the error during repair.
  2. Added the Agent Service Account permission to the log in question and log directory.
  • I am not sure if HIPS is a part of the problem or not, as the HIPS log shows a blocked action during install. However, I had a permission issue on the directories, so I think if someone has a similar issue, they should consider identifying whether HIPS exceptions are necessary during Patching SQL. Feb 24, 2021 at 20:17
  • HIPS is not the cause of the issue in this thread. The cause of the issue at hand was permissions. Mar 8, 2021 at 18:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.