Running SSIS packages as SQL Server Agent Job failed - sql

it is the first time and my first post in "stackoverflow" and I hope, that you can help me regarding my project.
Once I start the corresponding Job in SSMS, which I have created, I get the following error message:
Executed as user: XXXX Microsoft (R) SQL Server Execute Package
Utility Version 13.0.5026.0 for 32-bit Copyright (C) 2016 Microsoft.
All rights reserved. Started: 15:36:23 Error: 2021-10-11
15:36:23.51 Code: 0xC0011007 Source:
{BE14993C-9347-4920-8C3C-97E254866D05} Description: Unable to
load the package as XML because of package does not have a valid XML
format. A specific XML parser error will be posted. End Error Error:
2021-10-11 15:36:23.51 Code: 0xC0011002 Source:
{BE14993C-9347-4920-8C3C-97E254866D05} Description: Failed to
open package file "D:\Test\XXX.dtsx" due to error 0x80070003 "The
system cannot find the path specified.". This occurs when loading a
package and the file cannot be opened or loaded correctly into the XML
document. This can be the result of specifying an incorrect file name
when calling LoadPackage or the specified XML file has an incorrect
format. End Error Could not load package "D:\Test\XXXX.dtsx" because
of error 0xC0011002. Description: Failed to open package file
"D:\Test\XXXX.dtsx" due to error 0x80070003 "The system cannot find
the path specified.". This occurs when loading a package and the file
cannot be opened or loaded correctly into the XML document. This can
be the result of specifying an incorrect file name when calling
LoadPackage or the specified XML file has an incorrect format.
Source: {BE14993C-9347-4920-8C3C-97E254866D05} Started: 15:36:23
Finished: 15:36:23 Elapsed: 0.016 seconds. The package could not be
found. The step failed.
I have already tried the following points:
The permissions which I log in on the appropriate server, etc.
I have created a "Credential" & "Proxy" and configurated/managed it
Check the "DelayValidation" in Visual Studio (is "True")
TargetServerVersion is on "SQL Server 2019"
Security => ProtectionLevel is on "EncryptSensitiveWithUserKey"
Many thanks for your assist.
Best Regards,
Safak

I see that the path of the package using is a path server server. If that's the case replace it with UNC path in format //machinename/ c$/...
The account executing package from job has no access to path. If that's the case give account access to the path

Related

SSIS Containing SQL Authentication Runs in IDE but fails in SQL Server Agent Job

I have a SSIS package which gets data from flat file and writes it to SQL. It was running fine in IDE with Windows Authentication in the OLEDB Connection. But I wanted this to be run by anyone instead of using my Windows Authentication setting, so I changed the Authentication to SQL Auth. When I run this package in SQL Job, it fails, but runs fine in IDE. What would be the issue ?
My Package level ProtectionLevel is : EncryptSensitiveWithUserKey
Do I need to change the ProtectionLevel to EncryptSensitiveWithPassword instead?
This is the error I am getting:
Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that the correct key is available.
The worst part is, I reverted to run in the Windows Auth itself as of now, but now I am getting a strange error -
Executed as user: . Microsoft (R) SQL Server Execute Package Utility Version 12.0.4100.1 for 64-bit Copyright (C) Microsoft Corporation. All rights reserved. Started: 10:46:00 AM Error: 2019-08-15 10:46:09.43 Code: 0xC0209303 Source: Import_Freight_Data Connection manager "Source Excel (xls) File" Description: The requested OLE DB provider Microsoft.Jet.OLEDB.4.0 is not registered. If the 64-bit driver is not installed, run the package in 32-bit mode. Error code: 0x00000000. An OLE DB record is available. Source: "Microsoft OLE DB Service Components" Hresult: 0x80040154 Description: "Class not registered". End Error Error: 2019-08-15 10:46:09.43 Code: 0xC020801C Source: Get Data From xls File Source - XLS file import [96] Description: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Source Excel (xls) File" failed with error code 0xC0209303. There may be error messages posted before this with more information on why the AcquireConnection method call failed. End Error Error: 2019-08-15 10:46:09.43 Code: 0xC0047017 Source: Get Data From xls File SSIS.Pipeline Description: Source - XLS file import failed validation and returned error code 0xC020801C. End Error Error: 2019-08-15 10:46:09.43 Code: 0xC004700C Source: Get Data From xls File SSIS.Pipeline Description: One or more component failed validation. End Error Error: 2019-08-15 10:46:09.43 Code: 0xC0024107 Source: Get Data From xls File Description: There were errors during task validation. End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 10:46:00 AM Finished: 10:46:09 AM Elapsed: 8.906 seconds. The package execution failed. The step failed.
When you use EncryptSensitiveWithUserKey, SSIS will decrypt sensitive values using your windows identity as a means of authentication. When this job runs in SQL agent, it is no longer running under your account and cannot decrypt the password.
You can use EncryptSensitiveWithPassword, but this means that you will need to store the package password in clear text when you call the package from SQL agent. Some more preferable options would be:
Use windows auth, but run the package under a proxy. More on that here: https://community.spiceworks.com/how_to/129293-configure-an-ssis-package-to-execute-as-a-proxy-account
Set the password at runtime using package configurations. More on that here: https://learn.microsoft.com/en-us/sql/integration-services/lesson-5-add-ssis-package-configurations-for-the-package-deployment-model?view=sql-server-2017
m
I resolved the Excel issue by forcing it to run in 32-bit environment
Now, need to work on the SQL Authentication part.
Setting the 32-bit environment in SQL Job

How to run an SSIS package having excel source on a server where excel is not installed using SQL Server Agent Job

I have an SSIS package that reads data using a custom query and stores it into a target excel source. I am able to run the SSIS package successfully on a server where no excel is installed by doing a right click and selecting the Run Package option. When I add the same SSIS package to Integration services and run the package, it still executes successfully. But, when I schedule the package using SQL Server agent job, it fails with the below error:
"Executed as user: Username. Microsoft (R) SQL Server Execute Package Utility Version 10.50.2500.0 for 32-bit Copyright (C) Microsoft Corporation 2010. All rights reserved. Argument "Excel" for option "connection" is not valid. The command line parameters are invalid. The step failed."
Specification of SQL Server: SQL SERVER 2008 R2
Executing as SQL Server Agent Job.
Tried the following:
1) Checked the 'Use 32 bit' check box under Execution options tab in Step menu and unchecked all the check boxes in Datasources tab. Got the below error:
"Executed as user: Username. Microsoft (R) SQL Server Execute Package Utility Version 10.50.2500.0 for 32-bit Copyright (C) Microsoft Corporation 2010. All rights reserved. Started: 9:44:03 PM Error: 2015-06-08 21:44:04.21 Code: 0xC002F304 Source: File System Task File System Task Description: An error occurred with the following error message: "The device is not ready. ". End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 9:44:03 PM Finished: 9:44:04 PM Elapsed: 1.219 seconds. The package execution failed. The step failed."
2) Created a proxy account that had sysadmin, public, serveradmin roles. Modelled the package to run as proxy account. Got the below error:
"Executed as user: Username. The process could not be created for step 1 of job (reason: 1314). The step failed."
The command line looks almost similar to the below:
/DTS "\File System\PackageName" /SERVER SERVERNAME /CONNECTION "InputFileConn.xlsx";"F:\Folder\InputFile.xlsx" /CONNECTION "OutputFileConn.xlsx 1";"F:\Folder\Output\OutputFile.xlsx" /CONNECTION "Excel Connection Manager 1";"\"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=F:\Folder\Output\OutputFile.xlsx;Extended Properties=""EXCEL 12.0;HDR=YES"";\"" /CONNECTION "SERVERINSTANCE.DBName";"\"Data Source=ServerInstance;Initial Catalog=DatabaseName;Provider=SQLNCLI10.1;Integrated Security=SSPI;Auto Translate=False;Application Name=SSIS-Package-{D4E09BF5-DF25-3DE7-BCAE-B667C38F85B7}SERVERNAME\SQLSERVER.DatabaseName;\"" /X86 /CHECKPOINTING OFF /REPORTING E
Is it necessary to install excel in the server to make the SQL Server agent job work?
Based on the discussion above, the job was referring to F drive but F is a different drive to expected when running on the server.

Installing SSMS 2014 giving error of DLL required

I'm installing SSMS 2014 but while installing I'm getting below error:-
"There is a problem with this Windows Installer package. A DLL required
for this installation to complete could not be run. Contact your
support personnel or package vendor."
Can anyone tell me what is the problem?
Here is the error log:
Detailed results:
Feature: Management Tools - Complete
Status: Failed: see logs for details
Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail.
Next Step: Use the following information to resolve the error, and then try the setup process again.
Component name: SQL Server Native Client Access Component
Component error code: 1723
Component log file: C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20150528_153228\sqlncli_Cpu64_1.log
Error description: There is a problem with this Windows Installer package. A DLL required for this installation to complete could not be run. Contact your support personnel or package vendor.
Error help link: http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=sqlncli.msi%40RollbackCleanup%401723
Feature: Client Tools Connectivity
Status: Failed: see logs for details
Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail.
Next Step: Use the following information to resolve the error, and then try the setup process again.
Component name: SQL Server Common Files
Component error code: 2331
Component log file: C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20150528_153228\sql_common_core_Cpu64_1.log
Error description: The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2331.
Error help link: http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=sql_common_core.msi%40Do_LogInstallStart_64%402331
Feature: Client Tools SDK
Status: Failed: see logs for details
Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail.
Next Step: Use the following information to resolve the error, and then try the setup process again.
Component name: SQL Server Native Client Access Component
Component error code: 1723
Component log file: C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20150528_153228\sqlncli_Cpu64_1.log
Error description: There is a problem with this Windows Installer package. A DLL required for this installation to complete could not be run. Contact your support personnel or package vendor.
Error help link: http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=sqlncli.msi%40RollbackCleanup%401723
Feature: Client Tools Backwards Compatibility
Status: Failed: see logs for details
Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail.
Next Step: Use the following information to resolve the error, and then try the setup process again.
Component name: SQL Server Common Files
Component error code: 2331
Component log file: C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20150528_153228\sql_common_core_Cpu64_1.log
Error description: The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2331.
Error help link: http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=sql_common_core.msi%40Do_LogInstallStart_64%402331
Feature: Management Tools - Basic
Status: Failed: see logs for details
Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail.
Next Step: Use the following information to resolve the error, and then try the setup process again.
Component name: SQL Server Native Client Access Component
Component error code: 1723
Component log file: C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20150528_153228\sqlncli_Cpu64_1.log
Error description: There is a problem with this Windows Installer package. A DLL required for this installation to complete could not be run. Contact your support personnel or package vendor.
Error help link: http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=sqlncli.msi%40RollbackCleanup%401723
Feature: SQL Client Connectivity
Status: Failed: see logs for details
Reason for failure: An error occurred during the setup process of the feature.
Next Step: Use the following information to resolve the error, and then try the setup process again.
Component name: SQL Server Native Client Access Component
Component error code: 1723
Component log file: C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20150528_153228\sqlncli_Cpu64_1.log
Error description: There is a problem with this Windows Installer package. A DLL required for this installation to complete could not be run. Contact your support personnel or package vendor.
Error help link: http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=sqlncli.msi%40RollbackCleanup%401723
Feature: SQL Client Connectivity SDK
Status: Failed: see logs for details
Reason for failure: An error occurred during the setup process of the feature.
Next Step: Use the following information to resolve the error, and then try the setup process again.
Component name: SQL Server Native Client Access Component
Component error code: 1723
Component log file: C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20150528_153228\sqlncli_Cpu64_1.log
Error description: There is a problem with this Windows Installer package. A DLL required for this installation to complete could not be run. Contact your support personnel or package vendor.
Error help link: http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=sqlncli.msi%40RollbackCleanup%401723
I solved this problem by NOT putting in a DEFAULT target server URL when prompted. It is an optional field, so leave it blank, click next, and the installation completes without issue. You can add that link later once the application installs.
Try installing it as administrator. Right click on setup.exe file and click run as administrator.

SSIS Package Failing on Executing Job

Good Day,
I imported a package from SSIS to SQL to run as a Job.
if i manually execute the Package in SSIS in MSSMS it executes successful
as soon as i run it as a job i get the following error:
Executed as user: NT AUTHORITY\LOCAL SERVICE. Microsoft (R) SQL Server
Execute Package Utility Version 10.50.1600.1 for 64-bit Copyright
(C) Microsoft Corporation 2010. All rights reserved. Started:
12:10:22 PM Error: 2014-08-14 12:10:22.07 Code: 0xC0016016
Source: Description: Failed to decrypt protected XML node
"DTS:Password" with error 0x8009000B "Key not valid for use in
specified state.". You may not be authorized to access this
information. This error occurs when there is a cryptographic error.
Verify that the correct key is available. End Error Error:
2014-08-14 12:10:22.24 Code: 0xC0202009 Source:
TritonFuelImport Connection manager "41.160.218.141.CCManager.sa"
Description: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has
occurred. Error code: 0x80040E4D. An OLE DB record is available.
Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80040E4D
Description: "Login failed for user 'sa'.". End Error Error:
2014-08-14 12:10:22.24 Code: 0xC020801C Source: Data Flow Task
OLE DB Destination [15] Description: SSIS Error Code
DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The
AcquireConnection method call to the connection manager
"41.160.218.141.CCManager.sa" failed with error code 0xC0202009.
There may be error messages posted before this with more information
on why the AcquireConnection method call failed. End Error Error:
2014-08-14 12:10:22.24 Code: 0xC0047017 Source: Data Flow Task
SSIS.Pipeline Description: component "OLE DB Destination" (15)
failed validation and returned error code 0xC020801C. End Error
Error: 2014-08-14 12:10:22.24 Code: 0xC004700C Source: Data
Flow Task SSIS.Pipeline Description: One or more component failed
validation. End Error Error: 2014-08-14 12:10:22.24 Code:
0xC0024107 Source: Data Flow Task Description: There were
errors during task validation. End Error DTExec: The package
execution returned DTSER_FAILURE (1). Started: 12:10:22 PM
Finished: 12:10:22 PM Elapsed: 0.187 seconds. The package execution
failed. The step failed.
Can someone Please assist to help me solve this problem?
When you execute the package from Visual Studio, it is run under your user principal. When it's run through the SQL Agent, it's executed under the account SQL Server is set up with (either Local Service or a domain account set up for this purpose). Now, one part of your package (probably a connection manager) has properties called EncryptSensitive and ProtectionLevel (https://msdn.microsoft.com/en-us/library/ms141747.aspx) and by default this is set to your user account.
When SQL Agent tries to execute, it can't decrypt the sensitive data on the connection manager (probably the password) using its own keys. There are two ways of resolving:
Set the Protection level to something different
Create an SQL Agent Proxy with your credentials and set up the job to use that when executing this package (https://technet.microsoft.com/en-us/library/ms189064(v=sql.105).aspx)
There is a property you need to change in visual studio data tools. Have a look in the properties tab, there is an option for encryption of passwords. There are 3 different options from memory. If that doesn't work, try going to security in SQL server management studio then credentials. Then click add credential and add the credential of the user that successfully runs the job. Then in your job step, go into the step and set "run as" to the credential you created. I would also check the advanced tabs of the job step, to make sure the properties for the username and password are correct, sometimes they don't get deployed from data tools and you have to manually add them to the job step run by the agent.

SSIS Package working in BI Studio but not working in SQLServer 2008

I have the SSIS package which iterates all excel files in the particular folder and import rows into the SQL 2008 database. I use 4 Package Scope Variables for files and folders paths.
I could run the package and import all data in excel files if I run the package in BI Studio.
But when I move the package and set up the job in the SQL 2008 server, I could not run the package and it shows me the following message.
Executed as user: xxxxx Microsoft (R) SQL Server Execute Package Utility Version 10.0.4000.0 for 32-bit. Started: 16:19:23 Error: 2011-05-26 16:19:23.53 Code: 0xC0202009 Source: PCounter Connection manager "Excel Connection Manager" Description: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft JET Database Engine" Hresult: 0x80004005 Description: "The Microsoft Jet database engine cannot open the file ''. It is already opened exclusively by another user, or you need permission to view its data.". End Error Error: 2011-05-26 16:19:23.53 Code: 0xC020801C Source: Data Flow Task Excel Source 1 Description: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed. End Error Error: 2011-05-26 16:19:23.53 Code: 0xC0047017 Source: Data Flow Task SSIS.Pipeline Description: component "Excel Source" (1) failed validation and returned error code 0xC020801C. End Error Error: 2011-05-26 16:19:23.53 Code: 0xC004700C Source: Data Flow Task SSIS.Pipeline Description: One or more component failed validation. End Error Error: 2011-05-26 16:19:23.53 Code: 0xC0024107 Source: Data Flow Task Description: There were errors during task validation. End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 16:19:23 Finished: 16:19:23 Elapsed: 0.547 seconds. The package execution failed. The step failed.
I am sure that the files are not opened by anyone and my SSIS Proxy account do has the permission to access that folder. It still shows me this error however I tried.
Please give me suggestions.
You are using a variable to set the excel file via your Excel Connection Manager. Unless you have DelayValidation set to true at the package level, the connection manager will fail when it can't find the file you originally specified when you set up the Excel Connection Manger. Try setting DelayValidation on both the package and the connection manager to true - or make sure that the file you used to set up the connection manager is accessible by your sql server/sql agent account.