SQL Agent can't run package with WMI Event Watcher Task - sql-server

I created a SSIS package that watches for files being created on another server using a WMI Event Watcher Task. This package works fine when I run it in VS. It works fine when I manually Execute it from the Integration Services Catalog. When I try to run it as a scheduled SQL Agent Job I get
Error: Watching for the Wql query caused the following system exception: "Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))". Check the query for errors or WMI connection for access rights/permissions.
My question is why does this not run as a SQL Agent Job when I can run it successfully several different ways? Based on the error code seems to be a COM/DCOM security issue.
So far I have:
Tried many web sites most are more or less like this
https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-troubleshooting?redirectedfrom=MSDN I have followed all the instructions on these websites with no change.
Gone back and gave even more permissions then specified by the website to the COM Limits and DCOM Config of the Windows Management and Instrumentation.
Have restarted the WMI service on the other server several times after each change.
Tried SA and myself as owner of the Job.
Tried my usual SQL Agent Proxy account and the default Server Agent Service Account (which is a Managed Service Account) as the Run As for the package.
Tried running as a 32 and 64 bit runtimes.
Have made the SQL Agent Proxy account and Server Agent Service Account Admins on the other server.
Tried hard coding my user name and password into the Connection Manager and used Windows Authentication.
* New tests *
Tested the SQL Agent Job using the File System as the package source instead of the SSIS Catalog, still failed with same error.
Tested running package using the Execute Package Utility and it worked!

The AgentSqlServer user does not have rights to launch WMI Querys on server, You should create a proxy account and join it à to the step on the SQL Job.

Related

SSIS package failing via Credential account

I have one package which loads data from excel using ace.oledb.12.0 driver to SQL server(same server where SQL agent service is running.).
When I ran this Step from SQL Agent using Infrastructure Service account it succeed.
When I ran this step using a credential account it is stopping the job as a failure 'Unexpected Termination'.
Funny part is this is running exactly fine for files with data size low(100kb-300kb) when run from both Infrastructure Service account and a Credential account.
But for my current file having size 4.5 mb it is failing via Credential account.
Is there a way I can capture why the job is getting terminated?
Disclaimer: I work for ZappySys
Looks like you need to find out detailed error message to know more. Did you deploy package using SSIS Project Mode in SSISDB or running as File System Package? When you run SSIS Package via Agent Job you will see very limited error message and many times its useless. So better to run package under SSIS Catalog so you see full execution log. If that is not possible then try to Add Some SSIS Log Provider (see below) for better logging on error messages.
How to add SSIS Log Provider in your package
How to view execution log in SSIS Catalog (See Step#10 in this link)

SQL Server Agent Job will not complete, no indication job even started, no error messages

Agent in SQL Server 2016, running on Server 2014.
SSIS project developed in VS 2015, runs as expected. Single node executes simple SQL.
Package is deployed via DeploymentManifest, deployed to ‘SQL Server’. Deployed package runs as expected when started in Integration Services > Deployed Packages > MSDB
Have created Credential and Proxy, no changes to problem, no error messages, nothing logged.
Run without Credential and Proxy, same outcome.
Package Security ProtectionLevel is EncryptSensitiveWithPassword, have tried other ProtectionLevels with same outcome.
It appears that nothing is even beginning to execute, no error messages, no completion. How to check that package is actually deployed and agent can access?
I stopped the service that runs agent jobs: "SQL Server Agent". Restarted it with a different logon, a logon that is used to build and deploy the ssis project. Restarted the service. The original service was run under the "NT Service\SQLSERVERAGENT" account , which seems to be a default account.

SSL Error Encountered When Executing SSIS Package (Containing Call to Python Code) from SQL Server Agent Job

My SSIS package consists of an Execute Process Task which executes some compiled python code which downloads files from a Web API.
The code works.
The package executes succesfully from Visual Studio.
Once deployed to my localhost sql server 2012 instance SSISDB, I can right click execute it and it works fine.
However, as soon as I try to invoke the package from a SQL Server Agent job, it fails with. I do not understand this but I suspect this is because I don't understand what's happening with the SSL handshake. Does SQL Server Agent reference it's own store? If so, does this mean that my store is inactivated (do I need to enable SSL for my sql server agent?) or missing a certificate?
It feels like I have tried every possible workaround - I have ensured that my sql server agent is owned by my credential, rather than a generic credential - I've even created a proxy and explicitly instructed the sql server agent job step to run under that proxy but I guess this isn't the issue. The issue is the SSL certification step.
How can I fix this?

SSIS Login Error When Scheduling Package

I created a SSIS package in Visual Studio 2010 (BIDS). It's using an OLE DB Source and an OLE DB Destination. Both the source and destination use Windows authentication (a domain user) to connect and both are local to the Package.
In VS the connection is successful and I'm able to execute the package.
Now, I'm trying to schedule it in SSMS using SQL Server Agent.
I first connected to SSIS in SSMS and imported the package from my file system into MSDB. Then, I created a new job with one step to execute the SSIS package. I see my package level connections, so everything appears ok. I also used Windows Authentication for this step as well
However when I try to run the I got login errors.
First, it said the login 'Domain\InstanceName$' failed.
So I switched the windows authentication in the step within the job to sql server authentication. Now I get another error (it's slightly different) stating the login 'Domain\UserName' failed.
How do I get this to work as a schedule?
The answer was creating a SSIS proxy and then running the job under that proxy account instead of the SQL Server Agent account.
First need to create a credential tied to a Windows domain account. Then create a proxy and tie that proxy to the credential. Last, apply that proxy to job instead of using the SQL Server Agent account.

Error authenticating proxy while running agent job

I am trying to schedule a SSIS2014 package via SQL Server Agent job. Both SSIS and SSMS are running on my local machine in the same domain. I am running SSMS with the same user Domain\Admin which is the creator of the SSIS package. SSMS 32-Bit and SSIS 32-Bit are running on Windows 7 64-Bit machine. I can run the package within SSIS without problems.
Using Microsofts KB article http://support.microsoft.com/kb/918760 and tutorial video http://technet.microsoft.com/en-us/library/dd440760%28v=sql.100%29.aspx I tried a couple of methods (proxy, configuration file, EncryptSensitiveWithPassword) but none of them worked for me.
When I use a proxy account to run the job step, the following message occurs:
Unable to start execution of step 1 (reason: Error authenticating proxy
`Domain\Admin`, system error: Logon failure: unknown user name or bad password.).
The step failed.
The proxy account uses the credentials identity Domain\Admin. Since the password fields for credential properties in SSMS cannot be left blank, I typed any password although my corresponding windows account has no password. So as mentioned above it's the same user account that created the SSIS package since Domain\Admin is stated in the CreatorName property of the SSIS package.
With this proxy, I tried to run SSIS jobs using the package ProtectionLevel's EncryptSensitiveWithUserKey and EncryptSensitiveWithPassword. Running the package manually within SSDT without problems, but from SSMS agent job the same error message appears. I tried the package sources "File System" and, after importing the package to MSDB, "SQL Server" and "SSIS Package Store". But exactly the same error message appears with each method.
Task manager shows that SSMS is running in administrator mode. Using Windows Component Services I added DCOM permissions for Domain\Admin to start and activate "Microsoft SQL Server Integration Services 12.0" from local. But the same error message appears. So in my opinion it's a problem with SSMS user account permissions (???) but unfortunately I don't know what exactly to do here. I tried the following:
In the system database MSDB (full path: Databases / System Databases / MSDB / Security / Logins) I assigned all available role memberships (Including db_ssisoperator, db_ssisltduser, db_ssisadmin) to Domain\Admin.
In server security (full path: Security / Logins) I assigned all available server roles. In the tab User Mapping, I assigned the MSDB database.
Still the same error message appears when I try to run the job. Does anybody have some ideas what I can try?

Resources