You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# SQL Server Agent job fails and returns error 258
10
10
11
-
This article provides troubleshooting guidance for an issue where SQL Agent jobs fail with error code 258.
11
+
This article provides troubleshooting guidance for an issue that causes Microsoft SQL Server Agent jobs to fail and generates error code 258.
12
12
13
13
## Symptoms
14
14
15
-
The [SQL Agent service](/ssms/agent/sql-server-agent#sql-server-agent-components) runs, but scheduled SQL Agent jobs don't execute. The SQL Server and Agent logs show network and authentication timeouts as well as failed sign-ins.
15
+
The [SQL Server Agent service](/ssms/agent/sql-server-agent#sql-server-agent-components) runs, but scheduled SQL Server Agent jobs don't run. The SQL Server and Agent logs show network and authentication timeouts in addition to failed sign-ins.
16
16
17
17
The following example shows the error message that's added to the logs:
18
18
@@ -27,14 +27,14 @@ Logon to server '<ServerName>' failed (ConnLogJobHistory)
27
27
28
28
This issue can be caused by any of the following underlying problems:
29
29
30
-
- Blocking on [msdb](/sql/relational-databases/databases/msdb-database) system tables that SQL Agent uses. This blocking prevents job metadata reads and writes.
30
+
- Blocking on [msdb](/sql/relational-databases/databases/msdb-database) system tables that SQL Agent uses. This blocking prevents job metadata read and write operations.
31
31
- Example system tables include `dbo.sysjobs`, `dbo.sysjobschedulers`, and `dbo.jobsteps`.
32
-
-Hangs inside important SQL Server Agent threads or other process-level problems.
33
-
- Worker thread exhaustion in SQL Server (no workers available). This exhaustion makes the Agent unable to connect or process schedules.
32
+
-Non response (hangs) in important SQL Server Agent threads or other process-level problems.
33
+
- Worker thread exhaustion in SQL Server (no workers available). This exhaustion prevents the Agent from connecting or processing schedules.
34
34
35
35
## Solution
36
36
37
-
1.Confirm that the SQL Server Agent service is running by using one of the following PowerShell commands:
37
+
1.Verify that the SQL Server Agent service is running. Use one of the following PowerShell commands:
38
38
39
39
- For default SQL instances:
40
40
@@ -62,8 +62,8 @@ This issue can be caused by any of the following underlying problems:
1. If jobs continue to fail after starting the SQL Server Agent service, continue to the next step. If jobs are completing successfully, the problem is resolved and no further action is needed.
66
-
1. Check the jobs and schedules in `msdb` by opening [SQL Server Management Studio (SSMS)](/ssms/install/install) and running the following query:
65
+
1. If jobs continue to fail after you start the SQL Server Agent service, go to the next step. If jobs are finishing successfully, the issue is resolved and no further action is required.
66
+
1. Check the jobs and schedules in `msdb`. Start [SQL Server Management Studio (SSMS)](/ssms/install/install), and run the following query:
67
67
68
68
```tsql
69
69
USE msdb;
@@ -107,7 +107,7 @@ This issue can be caused by any of the following underlying problems:
107
107
GO
108
108
```
109
109
110
-
- To identify the query associated with a blocking session run the following query in SSMS:
110
+
- To identify the query that's associated with a blocking session, run the following query in SSMS:
111
111
112
112
```tsql
113
113
SELECT
@@ -130,13 +130,13 @@ This issue can be caused by any of the following underlying problems:
130
130
OR wt.resource_description LIKE '%jobsteps%';
131
131
```
132
132
133
-
1. Resolve or terminate any blocking sessions you identified in the previous step. To terminate a session run the following query in SSMS:
133
+
1. Resolve or terminate any blocking sessions that you identified in the previous step. To terminate a session, run the following query in SSMS:
134
134
135
135
```tsql
136
136
Kill <Blocking_Session_ID>
137
137
```
138
138
139
-
Once all blocking sessions are resolved or terminated, proceed to the next step.
139
+
After all blocking sessions are resolved or terminated, go to the next step.
140
140
141
141
1. Check for any worker, thread, or resource health problems by running the following query in SSMS:
142
142
@@ -207,36 +207,36 @@ This issue can be caused by any of the following underlying problems:
207
207
ORDER BY Section, Metric;
208
208
```
209
209
210
-
Investigate the output of the health check query for any of the following problems using the given symptoms:
210
+
Investigate the output of the health check query for any of the following problems as determined by the given symptoms:
211
211
212
212
- Worker thread pressure:
213
213
- Worker exhaustion, for example `Workers: 512/512`.
214
-
- `WorkQueue` is greater than zero, indicating that tasks are waiting and the system is overloaded.
214
+
- `WorkQueue` is greater than zero. This value indicates that tasks are waiting and the system is overloaded.
215
215
- CPU pressure:
216
-
- `RunnableTasks` is greater than zero, indicating there's a CPU bottleneck.
216
+
- `RunnableTasks` is greater than zero. This value indicates that a CPU bottleneck exists.
217
217
- Memory pressure:
218
-
- `Memory state` is `LOW`, indicating the overall system is low on memory.
219
-
- A low value for `AvailableMB`, indicating high memory usage for SQL Server.
220
-
- A `PLE` value less than 300, indicating high memory churn.
221
-
1. If you identified any worker, CPU, or memory problems in the previous step, reduce your current workload to resolve them. If you didn't identify any problems, proceed to the next step.
218
+
- `Memory state` is `LOW`. This value indicates that the overall system is low on memory.
219
+
- A low value for `AvailableMB`. This value indicates high memory usage for SQL Server.
220
+
- A `PLE` value of less than 300. This value indicates high memory churn.
221
+
1. If you identified any worker, CPU, or memory issues in the previous step, reduce your current workload to resolve the issues. If you didn't identify any issues, go to the next step.
222
222
1. Restart the SQL Server Agent by running one of the the following PowerShell commands:
223
223
224
224
> [!IMPORTANT]
225
225
> Restarting the SQL Server Agent interrupts any currently running jobs.
226
226
227
-
- For default SQL instances:
227
+
- For default SQL Server instances:
228
228
229
229
```powershell
230
230
Restart-Service -Name "SQLSERVERAGENT"
231
231
```
232
232
233
-
- For named SQL instances:
233
+
- For named SQL Server instances:
234
234
235
235
```powershell
236
236
Restart-Service -Name "SQLAgent$<InstanceName>"
237
237
```
238
238
239
-
1. After SQL Server Agent restarts, verify that jobs are now running by using the [Job Activity Monitor](/ssms/agent/monitor-job-activity#job-activity-monitor).
239
+
1. After SQL Server Agent restarts, verify that jobs are now running. Use the [Job Activity Monitor](/ssms/agent/monitor-job-activity#job-activity-monitor).
0 commit comments