Error running SSIS Package [duplicate] - c#

I've recently taken over a SSIS ETL based process and due to some licencing issues I had to upgraded from Data Tools 2013 to 2015.
Most of the project survived the upgrade and runs well.
However, in two packages I have a very simple C# method (Script Transformation) to parse some of the data which causes some issue.
Currently the deployment is completed by using "build" (not the newer development method via the SSIS catalog) and the SQL SERVER Job's step points directly to dtsx file.
The job was created in a SQL SERVER 2014 which schedule the ETL in steps. The server has a 64 bits configuration.
I have tried to change the SSIS project property "Run64BitRuntime" to False and force the failing step to use 32 Bit runtime.
In addition, I also tried to re-create the component with the same configuration but both did not work.
The odd part is that when I run the package from SSIS it finishes successfully but the job crushes and throw the following error message:
*"decode" is the name of transformation script component
Message
... Started: 11:32:30 PM Error: 2015-12-12 23:32:31.26 Code: 0xC0047062 Source: stg stg (decode [2]) Description: Microsoft.SqlServer.Dts.Pipeline.ComponentVersionMismatchException: The version of decode is not compatible with this version of the DataFlow. [[The version or pipeline version or both for the specified component is higher than the current version. This package was probably created on a new version of DTS or the component than is installed on the current PC.]] at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostCheckAndPerformUpgrade(IDTSManagedComponentWrapper100 wrapper, Int32 lPipelineVersion) End Error Error: 2015-12-12 23:32:31.26 Code: 0xC004801F Source: stg stg (SSIS.Pipeline) Description: The component metadata for "decode" could not be upgraded to the newer version of the component. The PerformUpgrade method failed. End Error Error: 2015-12-12 23:32:31.28 Code: 0xC004801F Source: stg SSIS.Pipeline Description: The component metadata for "decode, clsid {33D831DE-5DCF-48F0-B431-4D327B9E785D}" could not be upgraded to the newer version of the component. The PerformUpgrade method failed. End Error Error: 2015-12-12 23:32:31.28 Code: 0xC0048021 Source: stg decode [2] Description: The component is missing, not registered, not upgradeable, or missing required interfaces. The contact information for this component is "Includes and runs custom script code. For example, apply a business rule that limits the range of valid values in an "income" column or add values in two columns and calculate the average of the sum.;Microsoft Corporation; Microsoft SQL Server; Microsoft Corporation; All Rights Reserved; http://www.microsoft.com/sql/support;9". End Error Error: 2015-12-12 23:32:31.28 Code: 0xC0047017 Source: stg SSIS.Pipeline Description: decode failed validation and returned error code 0xC0048021. End Error Error: 2015-12-12 23:32:31.28 Code: 0xC004700C Source: stg SSIS.Pipeline Description: One or more component failed validation. End Error Error: 2015-12-12 23:32:31.28 Code: 0xC0024107 Source: stg Description: There were errors during task validation....

I had faced the same problem "Error Code: 0xC0048021" and solved it.
I installed this version of SSDT from here https://msdn.microsoft.com/en-us/mt429383
Then, in the SSDT solution explorer right click the Project,go to the Properties --> Configuration Properties --> TargetServerVersion = SQL SERVER 2014
Then, in the SSDT solution explorer right click the Project, go to the Properties --> Configuration Properties --> Debugging --> Run64BitRuntime = False
Referring to What's New for SSIS 2016 RC0?

In my case changing SSIS packages to 32/64 bits, and setting target SQL version have not worked.
If you have this issue even if you set SQL Target Version to 2016, make sure that you are using correct version of SQL Server Deployment Wizard.
If you are trying to deploy package on SQL2016, make sure that you have ISDeploymentWizard:
C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn Server\130\DTS\Binn\ISDeploymentWizard.exe
If not, you have to install SSMS dedicated for SQL Server 2016 (download link) which will install ISDeploymentWizard. Backward compatiliby in higher version of SSMS will not install ISDeploymentWizard.
Probably ISDeploymentWizard for higher versions upgrades SSIS package to higher version, and SQL Server cannot downgrade it.

I tried to update the only elelment which I haven't touched - SQL Server 2014, but with no impact. Eventually I decided to take full ownership of process and worked around it by pushing down the logic to the database.

If you change Target Server Version for the project, as described in the other answers, make sure to check that you've done so for the applicable configuration(s) that you are deploying (Development, Test, Production).

Related

Getting error while running SonarScannerMSBuild on Xamarin projects

1) When I Try to use Rebuild option
MANOJs-MacBook-Air:UI_Testing2 manojdeshpande$ mono /Users/manojdeshpande/Downloads/sonar-scanner-msbuild-4.5.0.1761-net46/MSBuild.SonarQube.Runner.exe /t:Rebuild
WARNING: ------------------------------------------------------------------------
This executable is deprecated and may be removed in next major version of the SonarScanner for MSBuild. Please use 'SonarScanner.MSBuild.exe' instead.
SonarScanner for MSBuild 4.5
Using the .NET Framework version of the Scanner for MSBuild
Default properties file was found at /Users/manojdeshpande/Downloads/sonar-scanner-msbuild-4.5.0.1761-net46/SonarQube.Analysis.xml
Loading analysis properties from /Users/manojdeshpande/Downloads/sonar-scanner-msbuild-4.5.0.1761-net46/SonarQube.Analysis.xml
WARNING: Please specify the command 'begin' or 'end' to indicate whether pre- or post-processing is required. These parameters will become mandatory in a later release.
Pre-processing started.
Preparing working directories...
05:23:39.463 05:23:39.454 Unrecognized command line argument: /t:Rebuild
05:23:39.464 05:23:39.462 A required argument is missing: /key:[SonarQube project key]
05:23:39.464 Expecting at least the following command line argument:
SonarQube project key
When connecting to a SonarQube server earlier than version 6.1, the following command line arguments are also required:
SonarQube project name
SonarQube project version
The full path to a settings file can also be supplied. If it is not supplied, the exe will attempt to locate a default settings file in the same directory as the SonarQube Scanner for MSBuild.
Use '/?' or '/h' to see the help message.
05:23:39.464 Pre-processing failed. Exit code: 1
2) I get some other error with authentication problems. Any work around this.
MANOJs-MacBook-Air:UI_Testing2 manojdeshpande$ mono /Users/manojdeshpande/Downloads/sonar-scanner-msbuild-4.5.0.1761-net46/SonarScanner.MSBuild.exe begin /k:"Xamarin" /d:sonar.host.url="http://localhost:9000" /d:sonar.login="token1"
SonarScanner for MSBuild 4.5
Using the .NET Framework version of the Scanner for MSBuild
Default properties file was found at /Users/manojdeshpande/Downloads/sonar-scanner-msbuild-4.5.0.1761-net46/SonarQube.Analysis.xml
Loading analysis properties from /Users/manojdeshpande/Downloads/sonar-scanner-msbuild-4.5.0.1761-net46/SonarQube.Analysis.xml
Pre-processing started.
Preparing working directories...
05:18:52.798 Updating build integration targets...
05:18:52.833 Fetching analysis configuration settings...
05:18:52.94 Failed to request and parse 'http://localhost:9000/api/settings/values?component=Xamarin': The remote server returned an error: (401) .
05:18:52.94 Could not authorize while connecting to the SonarQube server. Check your credentials and try again.
05:18:52.941 Pre-processing failed. Exit code: 1

SonarQube MSBuild Runner defaults to h2 Database

I am using Win Server 2012, Developer Command Prompt for VS2013, SonarQube v5.1.2, SonarQube Scanner for MSBuild 1.1.
I have my Sonar instance running off this same server, but connected to an Oracle database. Using the default sonar runner, i can analyze projects properly and see them appear in the dashboard using this method. That cannot be said for using the recommended MSBuild.SonarQube.Runner.exe approach.
I have tried with the csharp and vbnet examples, as well as our actual code. Oddly, i want to say each of these have worked at least once, but fail to do so now. Today, I tried using the vbnet example project for the first time and discovered and it worked as intended when using the MSBuild runner. I deleted the project from the dashboard, and ran it again. At this point i do not remember it it worked or not, but the third time for sure it stopped working and began producing the error below (wherein it tries to connect to the default h2 database instead of the oracle one that SonarQube is connected to).
I tried deleting the examples folder, extracting it again, giving it a slightly different name, and running the Sonar on it giving THOSE a different name/key/version, but now it is consistently giving me the db error.
Any idea what could be going on here, and why it would go from working to not, without me making any changes to the runner, msbuild, or the code?
Running the begin step:
c:\sonar-examples-master\projects\languages\vbnet>msbuild.sonarqube.runner.exe b
egin /v:vbnet1 /k:vbnet1 /n:vbnet1
SonarQube Scanner for MSBuild 1.1
Default properties file was found at c:\sonarqube\bin\SonarQube.Analysis.xml
Loading analysis properties from c:\sonarqube\bin\SonarQube.Analysis.xml
Pre-processing started.
Preparing working directories...
Checking for updates...
MSBuild SonarQube Runner Pre-processor 1.0.2.0
17:40:49.625 Loading analysis properties from c:\sonarqube\bin\SonarQube.Analys
is.xml
17:40:49.656 Updating build integration targets...
17:40:49.656 Fetching analysis configuration settings...
17:40:50.813 Generating rulesets...
Pre-processing succeeded.
MSBuild ran, but nothing worthwhile to post from it..
Running the end step:
c:\sonar-examples-master\projects\languages\vbnet>msbuild.sonarqube.runner.exe e
nd
SonarQube Scanner for MSBuild 1.1
Default properties file was found at c:\sonarqube\bin\SonarQube.Analysis.xml
Loading analysis properties from c:\sonarqube\bin\SonarQube.Analysis.xml
Post-processing started.
MSBuild SonarQube Runner Post-processor 1.0.2.0
WARNING: File is not under the project directory and cannot currently be analyse
d by SonarQube. File: C:\Users\ts3conusr\AppData\Local\Temp\.NETFramework,Versio
n=v4.5.AssemblyAttributes.vb, project: c:\sonar-examples-master\projects\languag
es\vbnet\ConsoleApplication1\ConsoleApplication1.vbproj
The SONAR_RUNNER_HOME environment variable is not required and will be ignored.
SONAR_RUNNER_OPTS is not configured. Setting it to the default value of -Xmx1024
m
Calling the sonar-runner...
c:\sonar-examples-master\projects\languages\vbnet\.sonarqube\bin\sonar-runner\bi
n\..
SonarQube Runner 2.4
Java 1.7.0_79 Oracle Corporation (32-bit)
Windows Server 2008 R2 6.1 x86
SONAR_RUNNER_OPTS=-Xmx1024m
INFO: Error stacktraces are turned on.
INFO: Runner configuration file: c:\sonar-examples-master\projects\languages\vbn
et\.sonarqube\bin\sonar-runner\bin\..\conf\sonar-runner.properties
INFO: Project configuration file: c:\sonar-examples-master\projects\languages\vb
net\.sonarqube\out\sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: c:\sonar-examples-master\projects\languages\vbnet\.sonarqu
be\out\.sonar
INFO: SonarQube Server 5.1.2
17:41:04.563 INFO - Load global repositories
17:41:04.751 INFO - Load global repositories (done) | time=188ms
17:41:04.751 INFO - Server id: 20160120154951
17:41:04.751 INFO - User cache: C:\Users\ts3conusr\.sonar\cache
17:41:04.766 INFO - Install plugins
17:41:04.860 INFO - Install JDBC driver
17:41:04.860 INFO - Create JDBC datasource for jdbc:h2:tcp://localhost/sonar
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 1.047s
Final Memory: 3M/15M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
Of note: I feel that it is worth mentioning that the vbnet report didn't actually have any content in it, but did at least properly get generated in the Sonar dashboard. I have tried running the commands against both that and the csharp example with now neither of them being added to the dashboard.
In the MSBuild.SonarQube.Runner install folder, there is a SonarQube.Analysis.xml. Do you have the correct server details on the below line in there?
<Property Name="sonar.host.url">http://{host}:{port}/{optionalPath}</Property>
This property value should point to your Sonar server.
Couple other things to try. Do you see tables being populated with analysis data in your oracle database? When was the last time it got any record?
Also, are you seeing below warning on your SonarQube application pages (say default dashboard)? If yes, then oracle configuration is not being picked up.
So i upgraded to the latest SonarQube version (5.3) and upgraded a few of the extensions while i was at it and preliminary testing is showing positive results. Ill try it a few more times but im closing the question for now. Thank you all that helped!

SSIS C# script is not compatible

I've recently taken over a SSIS ETL based process and due to some licencing issues I had to upgraded from Data Tools 2013 to 2015.
Most of the project survived the upgrade and runs well.
However, in two packages I have a very simple C# method (Script Transformation) to parse some of the data which causes some issue.
Currently the deployment is completed by using "build" (not the newer development method via the SSIS catalog) and the SQL SERVER Job's step points directly to dtsx file.
The job was created in a SQL SERVER 2014 which schedule the ETL in steps. The server has a 64 bits configuration.
I have tried to change the SSIS project property "Run64BitRuntime" to False and force the failing step to use 32 Bit runtime.
In addition, I also tried to re-create the component with the same configuration but both did not work.
The odd part is that when I run the package from SSIS it finishes successfully but the job crushes and throw the following error message:
*"decode" is the name of transformation script component
Message
... Started: 11:32:30 PM Error: 2015-12-12 23:32:31.26 Code: 0xC0047062 Source: stg stg (decode [2]) Description: Microsoft.SqlServer.Dts.Pipeline.ComponentVersionMismatchException: The version of decode is not compatible with this version of the DataFlow. [[The version or pipeline version or both for the specified component is higher than the current version. This package was probably created on a new version of DTS or the component than is installed on the current PC.]] at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostCheckAndPerformUpgrade(IDTSManagedComponentWrapper100 wrapper, Int32 lPipelineVersion) End Error Error: 2015-12-12 23:32:31.26 Code: 0xC004801F Source: stg stg (SSIS.Pipeline) Description: The component metadata for "decode" could not be upgraded to the newer version of the component. The PerformUpgrade method failed. End Error Error: 2015-12-12 23:32:31.28 Code: 0xC004801F Source: stg SSIS.Pipeline Description: The component metadata for "decode, clsid {33D831DE-5DCF-48F0-B431-4D327B9E785D}" could not be upgraded to the newer version of the component. The PerformUpgrade method failed. End Error Error: 2015-12-12 23:32:31.28 Code: 0xC0048021 Source: stg decode [2] Description: The component is missing, not registered, not upgradeable, or missing required interfaces. The contact information for this component is "Includes and runs custom script code. For example, apply a business rule that limits the range of valid values in an "income" column or add values in two columns and calculate the average of the sum.;Microsoft Corporation; Microsoft SQL Server; Microsoft Corporation; All Rights Reserved; http://www.microsoft.com/sql/support;9". End Error Error: 2015-12-12 23:32:31.28 Code: 0xC0047017 Source: stg SSIS.Pipeline Description: decode failed validation and returned error code 0xC0048021. End Error Error: 2015-12-12 23:32:31.28 Code: 0xC004700C Source: stg SSIS.Pipeline Description: One or more component failed validation. End Error Error: 2015-12-12 23:32:31.28 Code: 0xC0024107 Source: stg Description: There were errors during task validation....
I had faced the same problem "Error Code: 0xC0048021" and solved it.
I installed this version of SSDT from here https://msdn.microsoft.com/en-us/mt429383
Then, in the SSDT solution explorer right click the Project,go to the Properties --> Configuration Properties --> TargetServerVersion = SQL SERVER 2014
Then, in the SSDT solution explorer right click the Project, go to the Properties --> Configuration Properties --> Debugging --> Run64BitRuntime = False
Referring to What's New for SSIS 2016 RC0?
In my case changing SSIS packages to 32/64 bits, and setting target SQL version have not worked.
If you have this issue even if you set SQL Target Version to 2016, make sure that you are using correct version of SQL Server Deployment Wizard.
If you are trying to deploy package on SQL2016, make sure that you have ISDeploymentWizard:
C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn Server\130\DTS\Binn\ISDeploymentWizard.exe
If not, you have to install SSMS dedicated for SQL Server 2016 (download link) which will install ISDeploymentWizard. Backward compatiliby in higher version of SSMS will not install ISDeploymentWizard.
Probably ISDeploymentWizard for higher versions upgrades SSIS package to higher version, and SQL Server cannot downgrade it.
I tried to update the only elelment which I haven't touched - SQL Server 2014, but with no impact. Eventually I decided to take full ownership of process and worked around it by pushing down the logic to the database.
If you change Target Server Version for the project, as described in the other answers, make sure to check that you've done so for the applicable configuration(s) that you are deploying (Development, Test, Production).

SSIS Package failing because "script task is failing because the script is not precompiled"

I developed a pretty straight forward SSIS package (in VS2005 w/ .Net Framework V 2.0.50727 SP2) that gets a list of users to email, starts a for-each loop container and then executes a script task to retrieve user specific data and email it out to the user. When I run it on my dev box everything works great and runs as it should. However when I deploy the package to our production server running (Microsoft SQL Server 2005 - 9.00.5000.00 (X64) Standard Edition (64-bit) on Windows NT 5.2 (Build 3790: Service Pack 2) ) the task fails.
The original error message is:
Executed as user: xxxxx. Microsoft (R) SQL Server Execute Package Utility Version 9.00.5000.00 for 64-bit Code: 0x00000009 Source: PackageName Description: The task cannot execute in 64-bit environment because the script is not pre-compiled. Please turn on the option to pre-compile the script in the task editor. End Error ... Error DTExec: The package execution returned DTSER_FAILURE (1).
After researching that extensively the interwebs suggested that I try:
running the package in 32bit by changing the execution property in the SQL job and by changing my RunIn64BitMode property from true to false
which fails because " Option "/X86" is not valid."
install the Microsoft Hotfix
which doesn't apply since I am already running on SP2
So after more research I find that I need to turn on "Please turn on the option to pre-compile the script in the task editor." SOURCE: ssis-dtsx DOT blogspot DOT com/2010/03/cannot-execute-in-64-bit-environment.html
Which entails:
Make sure that each script task has PreCompile = True
Open Script Task Editor, switch to Script tab and make sure that
PrecompileScriptIntoBinaryCode = True
Click on Design Script to open code editor (Visual Studio for Applications) and then choose it using File > Close and Return (VSA will recompile and store binary code in the package).
Build Project and copy to target location
However when I execute the package I immediately get the error:
Executed as user: xxxx. ...0.5000.00 for 64-bit Code: 0x00000008 Source: PackageName Description: The task is configured to pre-compile the script, but binary code is not found. Please visit the IDE in Script Task Editor by clicking Design Script button to cause binary code to be generated. End Error Code: 0x00000008 Source: GET PO infor and Email Description: Script could not be recompiled or run: Retrieving the COM class factory for component with CLSID...
So my final step was to turn DelayValidation property from False to True in the SSIS pkg, go into the design script to cause it to be rebuilt, then redeploy, and rerun and I still get the same error.
On searching the error I am directed to Microsoft HOT FIX which suggested that I download another hotfix.
I have not yet downloaded the hotfix, and would prefer not to if I can avoid it (our OPs team doesnt like running hotfixes mid day on production servers).
Go to the package, open the script component, then within Visual Studio (while looking at the code) click on BUILD. This will compile the package, if there are no issues preventing it from compiling. Then SAVE, go back and ensure that you click on "OKAY" and not "cancel", if you click on cancel then the whole thing reverts back.

SSIS Object Model - Excel Connection Manager Error On 64bit Machine

I have a SSIS package which reads an Excel File (Data Flow Source) and transfer the data to SQL Server using OLEDB Destination Data Flow Item.This package is executed by .Net Application using the SSIS Object model. The package stored in a file system within the application subfolder.
The package works fine on my development/test machine both.Both these machine has win2k3 32bit. The SSIS was build in BIDS 32bit Environment.
When I deploye this application on production machine which has win2k3 x64 standard edition i get the error
An OLE DB error has occurred. Error code: 0x80040154. An OLE DB record is available. Source: "Microsoft OLE DB Service Components" Hresult: 0x80040154 Description: "Class not registered".
The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009.
component "Excel Source" (630) failed validation and returned error code 0xC020801C.
I have read in other posts that setting the Run64BitRuntime property of the project(during design time) solves the problem when running it from the BIDS.
How do i set this property through SSIS object model.
Here is the part of the code that executes the package
_application = New Application()
_package = New Package()
_package = _application.LoadPackage(packageName, Nothing)
_updateResult = _package.Execute()
Thanks
Masood
The Run64BitRuntime property only applies to the packaged running inside of BIDS. There is no need to set this property when running outside of BIDS.
I believe that you issue is that when running in code, the package is executing in 64 bit mode, however, Excel does not support this. In order to make this work you will need to shell out to launch the 32-bit version of DTExec.

Categories

Resources