SQL Server Integration Package fails with non-descript error. Works in VS2019 but not from commandline using DTEXEC - ssis

I'm having issues running a .dtsx package made in Visual Studio 2019.
In Visual Studio when using "Start without debugging" it runs perfectly with no errors, however when I try to launch the file from command line it's giving me a non-descript error and terminates the package.
It runs for some time and does execute a few of the tasks at the start of the package, however it does not get very far.
This is the "error" showing in the command prompt:
Message: <DTS:ProcessMemoryUsage xmlns:DTS="www.microsoft.com/SqlServer/Dts">DTS:PeakWorkingSetSize177860608</DTS:PeakWorkingSetSize></DTS:ProcessMemoryUsage>
When I look at the error dump, this is what I see:
This is my execution command
"C:\Program Files\Microsoft SQL Server\130\DTS\Binn\DTExec.exe" /f "C:\**PATH**\Visual Studio 2019\Projects\DataDropPrep\DataDropPrep\MSX DataDrop.dtsx" /conf "C:\**PATH**\Visual Studio 2019\Projects\DataDropPrep\Test.dtsConfig" /DECRYPT "****" /CONSOLELOG /DumpOnError /REPORTING EW
I don't understand why it works perfectly when run within Visual Studio 2019 but not in the commandline.
The package is set with target server 2016 (To match our SQL server).
I'm running the package from a local VM on my own PC, but the SQL server is deployed in Azure (cloudapp.azure.com).
I am NOT a DB admin, so I can't add the package to be run from the SQL Server itself unfortunately, wish that I could, would make my life a lot easier.
Alas I am stuck manually running this package every day from my own PC, and I'm trying to automate it with a .bat file, so I need this command working.
This is the package layout, it first truncates a staging table, then loads all items modified or created in the past 3 days, then deletes matching rows in the production table, then imports the new rows from staging. Repeat for all the different objects:
When using "Start without debugging" from Visual Studio 2019, it executes without issues:

Turns out the issue was that I was using a project parameter, which works when running from Visual Studio, but not when executing the dtsx file directly.
After converting the parameters from project to package, it executes successfully!
Without the logging and the insights that provided I wouldn't have known where to start.
Success

In the same folder as the package, SSIS generated a file SQLDUMPER_ERRORLOG.log. This pointed to a file in C:\Program Files\Microsoft SQL Server\150\Shared\ErrorDumps. This folder contains text files such as SQLDmpr0085.mdmp. When I click on this, it launches Visual Studio and gives an error message "The thread tried to read from or write to a virtual address for which it does not have the appropriate access."
After hours of experimenting and doing web searches, I discovered that I was not passing the correct package name to dtexec.exe. Once I corrected this, I was able to execute packages with no issues.

Related

dtexec run with error : Cannot load script for execution

I am trying to test run a simple SSIS script task on another machine for testing deployment. However, it gives the following error when using dtexec command line program
Description: Cannot load script for execution.
I have rebuilt the SSIS solution in Visual Studio 2019 community already. Do I need to copy the other files beside the Package.dtsx?

SSIS "The binary code or the script is not found" only on start_execution

When i launch my script from this stored procedure, it fails on the first script task.
EXEC SSISDB.catalog.start_execution #execution_id
I've got the following error:
The binary code for the script is not found. Please open the script in the designer by clicking Edit Script button and make sure it builds successfully.
I've done this multiple times without results, i have a feeling that the problem must be somewhere else because when i launch it from Integration Services Catalogs it works.
I use SQL 2012 on local development computer and SQL 2016 on server.
The error message is misleading.
I was using VS2012 to dev and deploy on SQL2016, when you do that the script component wont work.
I used VS2015 and upgraded package to SQL2016 and it worked.

SSIS executing wrong (old) package version

I have a SQL Server Agent Job executing a file-system-deployed SSIS package via CmdExec & the 32 bit DTExec. However, the most recent version of the package version is not executing.
The change I've made is within a Script Task. I've made sure to Build within the VSTA editor before closing, etc.
I've verified this is the problem by putting the expected version in the command line parameters, so the task fails: /VERIFYVERSIONID "\"{1F870663-1898-4A30-B4A8-226817D1755F}\""
Is there a cache that can be cleared?
One approach would be to change the executiontype for the SQL job to be Operating System (CMDEXE) and provide the path to the dtexec file for SSIS to use as the executable.
C:\Program Files\Microsoft SQL Server\110\DTS\Binn\dtexec.exe /FILE "c:\path\to\my\ssis\package\myssispackage.dtsx" /CHECKPOINTING OFF /REPORTING E
By calling the dtsx specifically you can point to the 32 or 64 bit version. You can also revert to a previous version of SSIS (dtexec) if you have those installed on your executing server.
I recently upgraded some of my packages to SSIS 2012 and had to use the new version for the packages to be executed by dtexec. That resolved my issue. Hope that helps.
Nothing to see here, move along..
I'm doing new child package testing on a server hosting multiple environments shared by my dev team, and we're in the process of shuffling things around. The job in question is one of a few identical ones and the path to the package got changed.
This is a 'master' package that dynamically executes child packages based on values read from a queue which is why it didn't occur to me to check the path.
Noob oversight.

Why are SSIS custom tasks not showing in SSIS Toolbox?

I have some custom control flow and data flow tasks that are not showing up in the SSIS Toolbox. When I open a package in SSDT containing the custom tasks I get several errors loading the package.
Error loading MyModuleTemplate1.dtsx: Cannot create a task from XML for task "__ECT Fetch Configuration", type "MyEncryptedConfiguration, MyCustomTasks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=2bdffe791d57af79" due to error 0x80070057 "The parameter is incorrect.".
I've followed Russ' and Matt's replies from the following post http://social.msdn.microsoft.com/Forums/sqlserver/en-US/5fdf9243-7e38-401e-bf4a-9251738877f9/how-to-browse-the-installed-custom-task-in-sql-server-2012-ssis-ie-custom-ssis-control-flow-task, however, the tasks still don't show.
I'm using SQL Server 2012 x64 with SSDT on Windows Server 2008 R2 x64. I have verified that the tasks are in the GAC and that the assemblies are in the appropriate SQL Server\110\DTS directories. The assemblies have been compiled as 32-bit since I kept getting a warning about targeting Any CPU while referencing 32-bit assemblies (the SQL reference assemblies).
I'm able execute the packages with the custom tasks, on the target server successfully through command line. Additionally, these tasks work fine on my development machine. I can see the tasks in the SSIS Toolbox and can open packages with the tasks without issue. My dev machine is nearly identical to the target machine except that I have full installation of Visual Studio 2010.
Am I missing something?
This problem is the result of WiX installer not properly installing the custom tasks. Below is what I did to verify this.
For test purposes I created an empty custom task and manually deployed it to the target server by copying the files and the DTS\Tasks directory. This worked so I added the .cs file of one of the tasks that was throwing errors, to the test custom task and re-deployed. I was able to see both tasks. After cleaning the solution with the original custom tasks, I manually deployed the original custom task to the target server, like the test custom tasks and was able see the tasks in the SSIS toolbox. I then uninstalled the custom tasks and deployed them to the target server using a WiX installer -- the problem resurfaced. So the problem is with the installer. My previous attempts at manually installing the custom tasks failed because I was using the assemblies installed from the WiX installer, although I don't know why.

SSIS Package Execution using dtexec utility

I have made a SSIS package to create an XML file, which works fine in Visual Studio, but when I try to run in cmd prompt using dtexec /f "C:\OakeyCreek.dtsx" it throws an error
SSIS Package "TestOakey" failed with exit code: 1
In the package a sqltask gives resultset as XML and a script task creates the xml file.
I did some research, same package without script task run fine both studio and cmd prompt. I am suspecting problem with script task, because I have both VS2005 and VS2008 on the same machine.
Any idea how to resolve this problem ?
Exact error ms popup is ...
Registration information for this application needs to be updated.To update, log on as an administrator and run this command.
"C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\VSTA.exe" /HostID SSIS_ScriptTask /setup
My operating system is Vista
Note: Edited to provide the answer!
So you've set up a SQL Server Agent job, and now you can't write to the file system. This is expected behavior, since SQL Server Agent uses SQL Server credentials to launch the job, not Windows credentials. So, what you'll have to do is this:
Under the Security folder in the Database Server in SQL Server Management Studio, find the Credentials folder.
Right click Credentials and hit New Credential.
Set up the Credential as you.
Expand SQL Server Agent, and right click Proxies, and hit New Proxy.
Set up the Proxy as you, using the Credential you just created.
Enable the Proxy to have the SSIS subsystem (if it's admin, check all of them).
Go edit the step on your job that calls the SSIS package.
Change the Run As field from SQL Server Agent to the Proxy that you just set up (if you did it right, it will be the only other choice in the dropdown).
You should be good to go!
Cheers,
Eric
You are creating the package using SSIS 2005, but running it using DTEXEC from SSIS 2008 - you probably have both SSIS 2005 and 2008 installed, and DTEXEC 2008 appears first in the path.
To use DTEXEC 2005, specify full path, like
"c:\program files\Microsoft Sql Server\90\dts\binn\dtexec.exe" /f Package.dtsx
In theory, DTEXEC 2008 should also be able to run the package (it should upgrade it on the fly to SSIS 2008 format), but there might be bugs and incompatibilities between the versions. Also it seems something is wrong with script task setup in SSIS 2008. Why would not you follow the instructions in the error message: logon as administrator and (using elevated command prompt) run -
"C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\VSTA.exe" /HostID SSIS_ScriptTask /setup