SQL Server Error while trying to delete Job: Cannot perform this operation while SQLServerAgent is starting

Posted: October 29, 2024  |  Categories: SQL Server

Today, while installing a brand new BizTalk Server environment and after the first attempt to configure BizTalk Server failed, I encountered this error while trying to clean up the artifacts created by the failed configuration of BizTalk Server, in this particular case, the BizTalk Server SQL Jobs:

Drop failed for Job ‘Backup BizTalk Server (BizTalkMgmtDb)’. (Microsoft.SqlServer.Smo)
Additional information:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

Cannot perform this operation while SQLServerAgent is starting. Try again later. (Microsoft SQL Server, Error: 14258)

Cause

The SQL Server Error 14258, indicating “SQLServerAgent is starting,” often appears when SQL Server Agent is in a state where it can’t be started or stopped properly. Here are some possible causes:

  • This error typically appears if SQL Server Agent is stuck in a “starting” state due to a previous ungraceful shutdown.
  • Sometimes, scheduled jobs or processes may be conflicting and causing SQL Server Agent to stall.
  • If there are connectivity issues between SQL Server and SQL Server Agent, the agent may have difficulty starting.
  • High CPU or memory usage on the server can sometimes prevent SQL Server Agent from starting.

Sometimes, it is just a matter of waiting a few seconds for the SQL Server Agent to start completely.

Solution

Depending on the root cause of your problem, this can be solved in different ways:

  • Restart the SQL Server Agent service or, if it’s still unresponsive, try restarting the SQL Server service itself. You can do this through SQL Server Configuration Manager.
  • Check the system resources and make sure there is enough memory and CPU availability for SQL Server and SQL Server Agent.
  • SQL Server Agent needs appropriate permissions to start. If the account running the agent doesn’t have the necessary privileges, it may fail to start correctly.

In my case, it was simple; I just had to wait a few seconds and try again.

I hope you find this helpful! If you liked the content or found it useful and want to help me write more, you can buy (or help me buy) my son a Star Wars Lego! 

Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

Leave a Reply

Your email address will not be published. Required fields are marked *

turbo360

Back to Top