error with ssis package in sql server job - mysql

Help solve the problem. There is a ssis package which in visual studio runs without problems, but returns an error in the sql task. The packet in the work takes the data from sql server and writes in mysql. The error is this:
It is executed on behalf of the user: DOMAIN \ system. Microsoft (R)
SQL Server Version 10.50.6000.34 for 64-bit (C) Microsoft Windows
(Microsoft Corporation), 2010 package execution program. All rights
reserved. Start: 19:53:23 Error: 2019-06-22 19: 53: 24.10 Code:
0xC0208452 Source: Data Flow Task ADO NET Destination [1281]
Description: The destination ADO NET could not establish the
connection {5BC4C8B7-B5DD-45EF-AEF5 -66D296B28305}. The connection may
be damaged. End of error Error: 2019-06-22 19: 53: 24.10 Code:
0xC0047017 Source: Data Flow Task SSIS.Pipeline Description: Error
while checking the components "ADO NET Destination" (1281), error code
0xC0208452. End of error Error: 2019-06-22 19: 53: 24.10 Code:
0xC004700C Source: SSIS.Pipeline Data Flow Task Description: Error
checking one or more components. End of error Error: 2019-06-22 19:
53: 24.10 Code: 0xC0024107 Source: Data Flow Task Description: Errors
while checking the task. End of error DTExec: The DTSER_FAILURE (1)
package has completed. Start: 19:53:23 Done: 19:53:24 Passed: 0.421
seconds. The package could not be completed. Step completed with an
error.
Thank you in advance !

Possible error causes:
32/64 bit conflict: Make sure that the mode you are running with is relevant to the MySQL Driver installed. Try running the package in 32-bit mode in SQL job:
Running SSIS Packages in 32-bit
Connection credentials: If you are using the current user credentials to connect to MySQL then make sure that the SQL service user is granted for establishing the connection.

When you chose SSIS Package type as a step of a job, there is a 32-bit runtime check box in the Step>General>Configuration, check that box and then re-run the package through job.I think it's better that you deploy your package and run it as sql server agent service account through ssis catalog. I hope this will solve the problem.

Everything turned out to be simpler, it was necessary to add a proxy account, and it all worked. Thank you all for your help and for responding!

Related

Cannot connect to password protected MS Access 2010 database from SSIS package on SQL Server

A couple of my co-workers have been having trouble connecting to password protected MS Access 2010 database from SSIS using. I decided to make an attempt at troubleshooting this.
To simplify the situation I created a new MS Access 2010 database with one table and one row with no password protection. I copied that database, updated the data in the one row so that I could differentiate the source and then applied a password. Both databases on the same network path for which I am using the full UNC path.
I created two SSIS packages, one for each database. All the packages do is read from the one table and write the data to a CSV. For my connection to the Access database I am using the Microsoft Office 12.0 Access Database Engine OLE DB Provider. For the password protected database connection I am putting the password in the Jet OLEDB:Database Password field.
When running on my machine through Visual Studio both SSIS package work as expected and write the data from the Access database table to a CSV file at the same location as the database. However, when I upload the packages and create a SQL job for each of them the one without a password works, but the one with a password does not.
Here is the error I get (with the user Xed out)...
Executed as user: XXXXXX\XXXXXXXX. Microsoft (R) SQL Server Execute Package Utility Version 10.50.4000.0 for 32-bit Copyright (C) Microsoft Corporation 2010. All rights reserved.
Started: 1:42:02 PM
Error: 2016-07-11 13:42:03.94
Code: 0xC0202009
Source: Package1 Connection manager "TestPassword"
Description: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred.
Error code: 0x80004005. An OLE DB record is available.
Source: "Microsoft Office Access Database Engine"
Hresult: 0x80004005
Description: "Cannot open database ''. It may not be a database that your application recognizes, or the file may be corrupt.". End Error
Error: 2016-07-11 13:42:03.94
Code: 0xC020801C
Source: Data Flow Task OLE DB Source [1]
Description: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "TestPassword" 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: 2016-07-11 13:42:03.95
Code: 0xC0047017
Source: Data Flow Task SSIS.Pipeline
Description: component "OLE DB Source" (1) failed validation and returned error code 0xC020801C. End Error
Error: 2016-07-11 13:42:03.95
Code: 0xC004700C
Source: Data Flow Task SSIS.Pipeline
Description: One or more component failed validation. End Error
Error: 2016-07-11 13:42:03.95
Code: 0xC0024107
Source: Data Flow Task
Description: There were errors during task validation. End Error
DTExec: The package execution returned DTSER_FAILURE (1).
Started: 1:42:02 PM Finished: 1:42:03 PM Elapsed: 1.903 seconds. The package execution failed. The step failed.
Any suggestions?
I had a very similar issue with an ADO Net connection manager trying to connect to a remote Azure DB.
You can try assigning the full connection string including the credentials to the connection manager via an expression and variable. There are more secure ways to assign this information at run time but that is a quick way to test.
One of the major reasons that this type of deployment fails is that the password is encrypted specific to your machine when you set up the connection manager. Once the package is moved the production machine it can not decrypt the password that is saved in the connection manager. Therefore the package will never have access to your protected DB.
Our issue was fixed by running this install to update the drivers.
https://www.microsoft.com/en-us/download/details.aspx?id=13255
Have your package security set to EncryptSensitiveWithPassword
When you deploy your package ensure you have re-entered the username and password (or full connection string) for your connection.

SSIS package works in Visual Studio, AND Command line but not in Agent

I have an SSIS package which I have developed on the server using VS.
The package runs fine in Visual Studio, however when I add to a Job in SQL Server Agent the package fails.
I am pulling data from SAGE Line 50 v19, so the ODBC driver is 32 bit. And I am running in a 64 bit environment.
Already setup odbc as 32 bit, ensured that agent was setup to run 32 bit, but sill encountered error. I have tested running the package from command line as follows
"C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\DTExec.exe" /FILE "E:\Reporting\Projects\SSIS\SSIS2012\SSIS2012\Package1.dtsx" /DECRYPT password /CHECKPOINTING OFF /REPORTING EWCDI
This works just fine when I run it. However when I setup an sql agent job to run as a "Operating System (CmdExec)" I get the following output.
Microsoft (R) SQL Server Execute Package Utility
Version 11.0.2100.60 for 32-bit
Copyright (C) Microsoft Corporation. All rights reserved.
Started: 13:30:44
Info: 2015-02-24 13:30:44.45
Code: 0x40016044
Source: Data Flow Task Data Flow Task (SSIS.Pipeline)
Description: Attempting to upgrade "ODBC Source". The package is attempting to upgrade an extensible object.
End Info
Error: 2015-02-24 13:30:44.59
Code: 0xC0014020
Source: SSIS002_SageCompany5Import Connection manager "Sage005.Manager"
Description: An ODBC error -1 has occurred.
End Error
Error: 2015-02-24 13:30:44.59
Code: 0xC0014009
Source: SSIS002_SageCompany5Import Connection manager "Sage005.Manager"
Description: There was an error trying to establish an Open Database Connectivity (ODBC) connection with the database server.
End Error
Error: 2015-02-24 13:30:44.59
Code: 0xC00291EC
Source: Get Max(SourceID) Execute SQL Task
Description: Failed to acquire connection "Sage005.Manager". Connection may not be configured correctly or you may not have the right permissions on this connection.
End Error
Warning: 2015-02-24 13:30:44.59
Code: 0x80019002
Source: SSIS002_SageCompany5Import
Description: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
End Warning
DTExec: The package execution returned DTSER_FAILURE (1).
I can't understand why this runs fine everywhere else. Been googling for hours, tried everything I can think of with no luck.
I am doing something similar with a 32 bit DSN & I had the check the "32-bit runtime" check box in the SQL job (under the SSIS job step - advanced tab).
Looking at the Operating System (CmdExec) option it looks like there is a "/X86" switch - maybe try that if you have to run from command line or just check the box above?
Apologies if this is what you have already done when you say the agent is "set up to run 32 bit".
Not 100% sure if this applies to you but i had a similar problem, where my cmd app in the ssis project ran perfectly in VS but once deployed to ssisdb it would hang, and never complete turned out the cmd required a user input and with it being in the ssisdb it didnt display so you could not continue and it would error
Hope this helps a little

Excecuting SSIS package deployed in Integration Service Catalog

I have edited my entire question, first my question was how to execute the SSIS Package, but now I have got the solution to execute it via SQL Server Agent job but when I am trying to execute the SQL Server Agent job, I am getting error , when I viewed in history then following message is shown
Job failed. Job was evoked by the user. Last step to run was step 1.
please note the table where I am inserting the data into database via SSIS package in SQL Express, is it SQL Express creating problem.
---------Updated Error Message-------------
The following error message is seen when I expand log file of SQL Server Agent job,
Executed as user: NT Service\SQLAgent$SQL_Server_Evalu. Microsoft(R) SQL Server Execute Package utility Version 11.0.2100.60 for 64 bit copyright (C) Microsoft Corporation. All right reserved started: 16:11:39 Package Execution on IS Server failed. Execution ID:4, Execution Status:4.
Below is the screen shot how I execute the SQL Server Agent job,
------------Updated error message------------
Below is the screen shot of the error message that are given while execution of the deployed package.
Errors are as follows:
1) Data Flow Task Error: There were errors during task validation.
2) Data Flow Task Error: OLE DB Destination failed validation and return error code 0XC020801C.
3) Data Flow Task Error: One more component failed.
4) Data Flow Task Error: SSIS Error Code
DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER
The AcquireConnection method call to the connection manager "RESHMAJADHAV\SQLEXPRESS.Adventureworks2012" failed with error code 0XC0202009.
5) Package Error: SSIS Error Code DTS_E_OLEDBERROR. An OLEDB error has occured. Error Code: 0X80004005. An OLE DB record is available. source: "Microsoft SQL Server Native Client 11.0" Hresult: 0X80004005 Description:"Login failed for user 'NTSERVICE\SQLAgGENT$SQL_SERVER_EVALU'.". An OLE DB record is available. Source: "Microsoft SQL Server Native Client 11.0" Hresult: 0X80004005 Description:"Cannot open Database" AdventureWorks2012"
requested by login. The login failed"
Is it because of the connection string
"Data Source=RESHMAJADHAV\SQLEXPRESS;Initial Catalog=AdventureWorks2012;Provider=SQLNCLI11.1;Integrated Security=SSPI;Auto Translate=False;"
That I have defined in environmental variables in Integration Service Catalog I am unable to open the database..?
Any help will be greatly apprecaiated...
Data Source=RESHMAJADHAV\SQLEXPRESS;User ID=XXXXXXX;Password=XXXXXXXXX;Initial Catalog=AdventureWorks2012;Provider=SQLOLEDB;
for the destination connection. I think job is not getting the end user name and password.
It might help. I f not can you please post the exact error message. I am no able to see anything form the picture..
Thanks

Error while executing SSIS package from JOB

Message
Executed as user: UKDBT91DB05V\SYSTEM. Microsoft (R) SQL Server
Execute Package Utility Version 10.50.2500.0 for 64-bit Copyright
(C) Microsoft Corporation 2010. All rights reserved. Started:
14:58:34 Error: 2013-04-01 14:58:34.45 Code: 0xC0016016
Source: Description: Failed to decrypt protected XML node
"DTS:Property" 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:
2013-04-01 14:58:34.76 Code: 0xC001000E Source:
ReceiveDGDinformation Description: The connection "stock" is not
found. This error is thrown by Connections collection when the
specific connection element is not found. End Error Error:
2013-04-01 14:58:34.80 Code: 0xC0202009 Source:
ReceiveDGDinformation Connection manager "Stock" 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 'DOTCOM\UKDBT91DB05V$'.". End Error Error:
2013-04-01 14:58:34.80 Code: 0xC020801C Source: Populate
Staginng Table Populate DGD Staging table [34] Description: SSIS
Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The
AcquireConnection method call to the connection manager "Stock" 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: 2013-04-01 14:58:34.80 Code: 0xC0047017
Source: Populate Staginng Table SSIS.Pipeline Description:
component "Populate DGD Staging table" (34) failed validation and
returned error code 0xC020801C. End Error Error: 2013-04-01
14:58:34.80 Code: 0xC004700C Source: Populate Staginng Table
SSIS.Pipeline Description: One or more component failed
validation. End Error Error: 2013-04-01 14:58:34.80 Code:
0xC0024107 Source: Populate Staginng Table Description: There
were errors during task validation. End Error DTExec: The package
execution returned DTSER_FAILURE (1). Started: 14:58:34 Finished:
14:58:34 Elapsed: 0.624 seconds. The package execution failed. The
step failed.
Meaningful bits of the error message
Failed to decrypt protected XML node "DTS:Property" 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
Login failed for user 'DOTCOM\UKDBT91DB05V$'
This is probably a problem with your ProtectionLevel setting and how you are configuring the job.
If ProtectionLevel is at the default "EncryptSensitiveWithUserKey" setting, then the development environment is encrypting things like your connection string database password using a key that depends on the user who is doing the development. After you deploy it to the production server and schedule a SQL Server Agent job, it will most likely run under a different user account, and then it will be unable to decrypt the database password. You will get this error.
One possibility would be to make sure the development user and the job execution user are the same user account, but this is not a good idea. Usually you want your production user accounts to be separate from your development user accounts.
Instead, you should set ProtectionLevel to "DontSaveSensitive". Then the password won't get saved with the SSIS package at all. You create a configuration file for the connection string, but the password won't get saved to the configuration file either. You will have to edit the configuration file manually if you want it to include a password. But the best way to do this is to configure the password when you schedule the job that executes the SSIS package. That keeps the password in a safe place, and it isn't floating around all over the place with the SSIS package.
Some useful links here and here.
Good luck!

SSIS package will succeed with one table, but not all?

Forgive my inexperience with this subject as this is the very first SSIS package I have created. The goal is to basically copy the schema/data from an Access DB into SQL Server. I use the import/export wizard in BIDS to create (there are 470 tables total). If I script it to do only one table, the job runs and executes the package, and is successful. When I try all tables I am given this error:
Executed as user: DOMAIN\USER. Microsoft (R) SQL Server Execute Package Utility Version 10.50.2500.0 for 32-bit Copyright (C) Microsoft Corporation 2010. All rights reserved. Started: 11:47:53 AM Error: 2012-07-16 11:48:03.65 Code: 0xC0202009 Source: Data Flow Task 1 Destination - Account [55] Description: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E37. An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80040E37 Description: "Invalid object name 'dbo.Account'.". End Error Error: 2012-07-16 11:48:03.65 Code: 0xC0202040 Source: Data Flow Task 1 Destination - Account [55] Description: Failed to open a fastload rowset for "[dbo].[Account]". Check that the object exists in the database. End Error Error: 2012-07-16 11:48:03.65 Code: 0xC004706B Source: Data Flow Task 1 SSIS.Pipeline Description: "component "Destination - Account" (55)" failed validation and returned validation status "VS_ISBROKEN". End Error Error: 2012-07-16 11:48:03.65 Code: 0xC004700C Source: Data Flow Task 1 SSIS.Pipeline Description: One or more component failed validation. End Error Error: 2012-07-16 11:48:03.65 Code: 0xC0024107 Source: Data Flow Task 1 Description: There were errors during task validation. End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 11:47:53 AM Finished: 11:48:03 AM Elapsed: 10.562 seconds. The package execution failed. The step failed.
The first step in the job drops all tables from the DB.
EXEC sp_msforeachtable 'DROP TABLE ?'
The second step executes the package.
I've looked all over online and haven't been able to find a solution. Any help would be appreciated, thanks!
You have to set delay validation property to true for the second execute SQL task.
This took me ages - over a period of months - to nut out.
I was running three SQL tables of data into three Excel sheets in a single workbook. I had all manner of problems with corrupted data - between sheets, even - and OLE errors along with many of the other intermittent errors that people have search for in these threads.
In the end, the issue was that I had the three data flows embedded within a single Data Flow. In hindsight, I guess it was obvious that this would be a problem, but me, being new to SSIS, figured that the processing would be ironed out deeper down. Wrong.
Once I separated the flows into three consecutive Data Flows, everything was fine.
Postscript: After messing about with SSIS over the course of this project I'm convinced that it's probably one of the ropiest pieces of MS product I've come across. Sooooooo much manual configuration - and re-configuration when SSIS suddenly undoes all your tedious work! - changing of data types, connecting this to that. Just horrible. Recommendation: Avoid if possible.