SQL agent job failed with an error 0x80131904 - sql-server

I have one SQL agent job that executing the SSIS package. When the job is running through schedule then it is giving an error:
Failed to execute IS server package because of error 0x80131904. Server: XXXXX Package path: "XXXX" Environment reference Id: 2. Description: The operation failed because the execution timed out.
But when I manually running the job by right clicking on it then the job runs successfully.
Could anyone help me on this to find out the root cause and solution of the issue.
Thank you so much in Advance!!

Problem is that SQL Agent Service user don't have rights to execute package.
Two solutions:
Change SQL Server Agent service user
read where sql management studio
Make a proxy account for SQL Agent JOB Step ssis proxy account
Go for the 2, because if You have more than one JOB or some policies.....

Related

Login failed while trying to save SSIS package

While running the import/export wizard in SQL Server Management Studio, I am running into a problem when trying to save the SSIS package. I am using SQL Server authentication. I used the username/password to both log in to SSMS, as well as in the "destination" step of the import/export wizard. However, I can't get past the "Save SSIS Package" step, because of the following error:
The ExistsOnSQLServer method has encountered OLE DB error code 0x80004005 (Login failed for user 'crsdnonprodadmin'.). The SQL statement issued has failed.
I'm using the same username/password as I did in previous steps, and it has admin privileges. I can run the job immediately, without saving it, so I know the task works and I have permissions to do it. Hoping for some insight, please and thank you!
(Using SSMS version 18.11.1)

SQL Server Agent SSIS Package AcquireConnection Error

I have a basic SSIS package that pulls data from a Redshift database ODBC DSN connection and puts it in a SQL Server database using an OLEDB connection. When I test the connections in Visual Studio everything is successful. When I run the package in Visiual Studio and the SSIS instance from SQL Server, they both are successful. However, when I try to run it from a SQL Sever agent job it fails with the AcquireConnection method failed error.
The VS solution/project is targeted to SQL Server 2014 same as the server.
The VS solution/project 64bitRunTime property is set to false so it will run as 32bit.
The configuration for the job step in SQL Agent is also set to 32bit.
Both the job owner and the step's login to the package are set to "sa" (just to test).
Still not working. Any ideas?
The difference between cases is the user credentials. When you run the package - it runs under your credentials, when SQL Server Agent runs it - it (by default) runs under service account.
Ways to test and fix:
Create a SQL Credential, SSIS execution proxy and configure Job step to use it in run as dropdown.
For testing - create a credential mapped to your account.
Change account under which SQL Agent starts or add privileges to the service account.
I opt for the first method, since it is more granular and affects only your job.

execute sql server agent job task in ssis error : Failed to lock variable"RunIs" for read access with error 0xC0010001

I am using SQL Server 2016 and SSIS. I have a package in which I am calling a sql server job.
My job have just one step as PowerShell command for transfering all files from one directory to another directory between two servers.
When I run my job from SQL server, it works well.
When I run my package from VisualStudio, every things is ok, but after deploying my project to sql server, when I want to run this package from SQL Server, I have this error :
Execute SQL Server Agent Job Task: Error: Failed to lock variable "RunId" for read access with error 0xC0010001 "The variable cannot be found. This occures when an attempt is made to retrive a variable from the Variable collection on a container during execution of package, and the variable is not there. The variable name may have changed or the variable is not being created.".
I deleted the Execute sql server agent job task from my package and I redeployed my project and now I do't have this error. It is clear that error is about Execute sql server agent job task.
I have more than 2000 files in source directory and it takes several minutes to transfer all files to destination directory.
Edit1 : I have several Task and component in my package and the last ones is Execute sql server agent job task and i don't have Execute T-SQL Statement Task.

SQL Job unknown user or bad password

We currently have a SQL Server 2012 job that fails and unable to figure out the problem. The SQL job calls a SSIS package and if I run the package via Integration Services it runs successfully. However when running the job it returns the following in Windows Event Viewer:
SQL Error : Logon failure: unknown user name or bad password.
SQL Job History Error:
Error: 2017-04-28 09:43:40.17
Code: 0x00000006
Source: Create Temp Tables 1
Description: The script returned a failure result.
End Error
DTExec: The package execution returned DTSER_FAILURE (1).
There doesn't appear to be any information that helps resolve the issue. We don't appear to have any proxies setup. All other jobs that reference a SSIS package run successfully.
I found the cause of the error as there was a variable set in the package that was referencing a secondary server. Changed the connection string and job is back up and running.
To run SSIS package through JOB you need to set a password in the package
And when informing the package will be requested the password so that you can include in the job

Package that runs perfect on SSIS, but fails on SQL - server job activity

I wonder if you can help me, I am having a problem which I can't figure out for the last few days... I get these errors when I run a package, that runs perfect on SSIS, on SQL - server job activity:
Error: There were errors during task validation
Error: .. failed validation and returned error code 0xC0208449
Error: One or more component failed validation
ADO NET source has failed to acquire the connection {...} with the following error message "exception from HRESULT: 0x80131937
Some additional info:
I am using project deployment mode
my Sql server version is 2014
My protection level in SSIS is DontSaveSensitives both in project and packages, but I think that it doesn't matter when I deploy anyway.
The package I get this error about run on SSIS but not on SQL-server job activity
When runnin within Sql Agent Job, your package is failing to acquire connections. First review your package/job connections, and make sure they have deployed properly.
Then rule out access permissions issues by testing the package using a Sql Server user/password account. If it works this way then most likely you need to use a Sql Server Proxy account.
If you are still unable to access then check connectivity between the machine you are running the job and the one(s) where your data is located (addresses, ports and instances,..). Also make sure that all involved machines can use the same transport (named pipe, tcp,...) in Sql Server Configuration Manager.

Resources