December 4, 2017 at 11:46 pm
I have a couple of SQL Server Agent jobs configured to run as "sa"
However, they fail with the error "Description: The Execute method on the task returned error code 0x80131904 (Login failed for user 'sa'.)."
Does SQL Server save a password with a job (e.g. if it is using an old password for the "sa" account) ? I can't find any setting in the Job Properties about the password for the account.
December 5, 2017 at 12:41 am
Hi,
our job-owner is the SA account, but the account is disabled. So you need no active sa account, or the password of the sa account to run jobs.
Can you script some of the failed jobs, are there proxy or something like that, where the ower tries to leave the sql-server?
Kind regards,
Andreas
December 5, 2017 at 1:18 am
does the sa account still exist?
Does it have a password on the account? is password expiration enabled?
December 5, 2017 at 2:34 am
DimPerson - Tuesday, December 5, 2017 1:17 AMdoes the sa account still exist?
Does it have a password on the account? is password expiration enabled?
Yes, the account exists and I can login to the account with a valid password.
However, as soon as I run the SQL Server Agent Job (or even as a Maintenance Plan), the account gets locked.
December 5, 2017 at 2:55 am
First off; what do the jobs do? Do they execute T-SQL queries, stored procedures, SSIS packages, PowerShell scripts or something else?
Regards
Lempster
December 5, 2017 at 8:40 am
The error 0x80131904 is not a pure login failure - it's usually associated more often with a connection failure.
What is in the SQL Server error log and Is this job running a Maintenance Plan?
Sue
December 5, 2017 at 10:40 pm
andreas.kreuzberg - Tuesday, December 5, 2017 12:41 AMHi,
our job-owner is the SA account, but the account is disabled. So you need no active sa account, or the password of the sa account to run jobs.
Can you script some of the failed jobs, are there proxy or something like that, where the ower tries to leave the sql-server?
Kind regards,
Andreas
At least one of the failing jobs is a TSQL script.
UPDATE : I've found the error in the TSQL script and have fixed it. Thanks for the hint to look at Scripts versus Maintenance Plans separately.
December 5, 2017 at 10:41 pm
Lempster - Tuesday, December 5, 2017 2:55 AMFirst off; what do the jobs do? Do they execute T-SQL queries, stored procedures, SSIS packages, PowerShell scripts or something else?
Regards
Lempster
One of them is TSQL script to Backup Database. The TSQL script has been fixed, there was a syntax error.
The others are built from Maintenance Plans to Backup Database or Logs.
So, now, the issue is with jobs built from Maintenance Plans.
December 5, 2017 at 10:46 pm
Sue_H - Tuesday, December 5, 2017 8:40 AMThe error 0x80131904 is not a pure login failure - it's usually associated more often with a connection failure.
What is in the SQL Server error log and Is this job running a Maintenance Plan?Sue
Both Maintenance Plan and TSQL script are failing. UPDATE : The TSQL script had a syntax error and I have fixed that now.
So the errors below relate to Jobs built from Maintenance Plans.
The errors in the SQL Server log are
Login failed for user 'sa'. Reason : Password did not match that for the login provided [Client : <local machine>]
Error : 18456. Severity 14. State 8
December 5, 2017 at 11:26 pm
Hi,
please check your connection settings in the maintenance plan.
Maybe you try to connect to a "foreign" sql server with your sa account.
Kind regards,
Andreas
December 6, 2017 at 8:32 am
I believe that the maintenance plans will actually run under the service account for the SQL Server Agent.
This account must have read/write access to the drive where the backups are being put.
December 6, 2017 at 10:22 am
I think this is in issue with the connection settings for the maintenance plans as Andreas has posted.
In the maintenance plans, go up to Manage Connections, try setting it to Local server connection and Use Windows NT Authentication.
Sue
December 6, 2017 at 8:11 pm
thanks everyone.
It does look like the Maintenance Plan based job has an issue with connection settings.
In the meantime, I have re-written everything to run as T-SQL jobs. These run fine.
Hemant
December 7, 2017 at 1:11 am
Well done for solving it. I stopped using Maintenance Plans long time ago; it's relatively simple to 'roll your own' or use something like Ola Hallengren's maintenance scripts.
Regards
Lempster
Viewing 14 posts - 1 through 13 (of 13 total)
You must be logged in to reply to this topic. Login to reply