"Invalid command line parameters" error when running package from job - reporting-services

I'm having an issue scheduling a .dtsx package to execute as a SQL Server Agent job. I've Googled the problem, but can't find the required solution for my particular issue.
The SQL Server version is 2012 Business Intelligence Edition.
The package runs fine within Visual Studio.
The job is set to run under the "SQL Server Agent Service Account".
The file is on the same server as the DB.
The error log in part is:
...complete End Progress Progress: 2013-01-09 20:51:48.58
Source: Inheader File Import Validating: 33% complete End
Progress Progress: 2013-01-09 20:51:48.58 Source: Inheader File
Import Validating: 66% complete End Progress Progress:
2013-01-09 20:51:48.59 Source: Inheader File Import
Validating: 100% complete End Progress Progress: 2013-01-09
20:51:48.59 Source: Product File Import ... The command line
parameters are invalid... The step failed.
This looks similar to the log generated when running the package within VS, so it doesn't appear to be a permissions issue - it looks to be processing the script.
I haven't changed the command line parameters from those generated when configuring the step, they are(I've altered sensitive data):
/FILE "\"C:\...filepath...\package.dtsx\"" /CHECKPOINTING OFF /REPORTING E
A lot of the links I have found don't really mention the file type packages, and I'm a bit stuck so any help would be much appreciated.
I'm also confused as to why the error wouldn't occur prior to the execution of the package.

Assuming this is accurate:
/FILE "\"C:\...filepath...\package.dtsx\"" /CHECKPOINTING OFF /REPORTING E
then the backslash and quote before the start of the path, and the backslash and quote after the .dtsx extention, are the likely culprits.
Things should look more like this:
/FILE "C:\...filepath...\package.dtsx" /CHECKPOINTING OFF /REPORTING E

Related

SSIS editing a script task and saving it doesn't work

Note: I am not an SSIS developer and have a very limited knowledge on it, so may be missing on very small details, please read carefully.
I have an existing SSIS package which has script task in one of the steps.
I had to update one single value in script task, so I opened it in notepad++ and updated the value and saved it. Now when the scheduled SSIS job runs, it still picks up the old value and not the updated one.
I realized script task is a VB file, so probably would need to re-compile it for the binaries. I read about it and found out, if you open it through VS and save it, VS automatically compiles it and you don't have to do anything further. I can be wrong here.
I can't do project deployment on the server, so I would just need the updated package file to replace it on the server.(I am taking this updated package file from the Visual studio project that I created to edit the SSIS package. I am not sure, if there is another way to get the package or even if this is a right package.
Now the problem is,
when I updated the old package using notepad++, it didn't throw any error when it was running through scheduled job, but it took the old value
Now when I am putting the new package that I edited using Visual studio, it throws below error
Executed as user: sampleUser(nameupdated). Microsoft (R) SQL Server Execute Package Utility Version 13.0.5026.0 for 32-bit Copyright (C) 2016 Microsoft. All rights reserved. Started: 5:08:09 PM Error: 2021-11-02 17:08:10.83 Code: 0xC0016016 Source: OraclePackage 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: 2021-11-02 17:08:11.26 Code: 0x00000005 Source: Rename files in archive folder to _yyyymmddhhmm Rename files in archive folder to _yyyymmddhhmm Description: Failed to migrate scripts contained in the package to the VSTA 14.0 format. Move the scripts to a new Script task. End Error Error: 2021-11-02 17:08:14.19 Code: 0x00000005 Source: Script Task Script Task Description: Failed to migrate scripts contained in the package to the VSTA 14.0 format. Move the scripts to a new Script task. End Error Error: 2021-11-02 17:08:17.17 Code: 0x00000001 Source: Script Task Description: Exception has been thrown by the target of an invocation. End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 5:08:09 PM Finished: 5:08:17 PM Elapsed: 7.25 seconds. The package execution failed. The step failed.
I read about this error and found that package's security level can cause this issue, so update the protection level of the package from "EncryptSensitiveWithUserKey" to "DontSaveSensitive"
Now when I am running the project I get below error
Executed as user: sampleuser(nameUpdated). Microsoft (R) SQL Server Execute Package Utility Version 13.0.5026.0 for 32-bit Copyright (C) 2016 Microsoft. All rights reserved. Started: 5:31:44 PM Error: 2021-11-02 17:31:53.93 Code: 0x00000001 Source: Script Task Description: Exception has been thrown by the target of an invocation. End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 5:31:44 PM Finished: 5:31:53 PM Elapsed: 9.047 seconds. The package execution failed. The step failed.
Please let me know if there is another way to edit the script task directly and compile it in place so that it takes the updated values else, if there is something else I can do.
Thanks in advance.
I found a solution(more of an error or less knowledge from my side actually)
Updating the security from "EncryptSensitiveWithUserKey" to "DontSaveSensitive"
When you open an existing SSIS package in Visual studio, the read and write variables are wiped out from script task for some reason. Reassigning them resolved the problem.
How did I find out if that was the problem, I put some exception handling in the script task to notify me of further issues.
Hope this helps to someone in the similar problem.

DTExec: The package execution returned DTSER_FAILURE (1) in SSIS package execution

I've got this question within a project in ssis. I had to divide the original project into different packages because this was to big and sometimes it could provoke some problems with the memory.
So, in order to link the different packages I'm using the "Execute Package Task" to refer one to each other.
If I execute the package directly from SSIS it works perfect, there's not problem.
But if I use a scheduler to program the time of execution I'm getting this error message:
Error: 2015-09-22 14:54:37.98 Code: 0xC00220E6 Source: Execute Package
Task Description: There is no project to reference. End Error Error:
2015-09-22 14:54:37.99 Code: 0xC0024107 Source: Execute Package Task
Description: There were errors during task validation. End Error
DTExec: The package execution returned DTSER_FAILURE (1).
I wonder what can be happening with the project and its execution.
Regards
I'm not sure what scheduler you are using, or how it's configured, but you can debug your way through this by simulating the scheduler with DTExec. It sounds like you've crossed your Setup and Execution Method (see below for those definitions).
Here's the summary.
Option 1: For the Setup, use Project References and for the Execution Method, use Project/Package.
Option 2: For the Setup, for each child package, use External References and for Execution Method, use File.
(It sounds like you're using a combination of Project References and File, which in turn sends the There is no project to reference error off of the child packages.)
Option 1
Setup
Open your parent package in SSDT, and then double click a child package. It should look like this:
Execution Method
This setting means you need to execute the package via the Project/Package method via DTExec. So build your project - this generates an ispac file. And to execute via dtexec, it would look like:
dtexec /Proj Path\To\MyProject.ispac /Pack Path\To\The\ParentPackage.dtsx
Note: If you specify the dtsproj file instead of the ispac file in the /Proj parameter, you will receive a File contains corrupted data error!
Option 2
Setup
Open your parent package in SSDT, and then double click a child package. Change it to look like this:
This is done by
1. Changing the Reference Type to External Reference
2. Changing the Location to File system (SQL Server is another option)
3. Select <New connection...> to create a new file connection for the child package to run (or a SQL server connection)
Execution Method
This setting means you can now use the File method, which is likely the way you're attempting to execute the package.
dtexec /f Path\To\My\ParentPackage.dtsx

dtexec error "The connection xxx is not found" with Project deployment model

When running DTEXEC I am getting "The connection xxxx is not found".
I beleieve this is because the connection managers are located at Project level and not within the package itself.
When running DTEXECUI - these connection managers are not displayed.
Is the only way to move them into the package - seems a bit weird as what is the point of allowing them a project level if you then have to move them to use them with DTEXEC.
Thanks
Here is the command line syntax you asked for:
C:\Users\Administrator>dtexec /FILE "\"F:\SSIS Projects\HESA\HESA\01 - Upload Metadata Files To Oracle.dtsx\"" /SET "\Package.Variables[User::varYear.Properties
[Value]";"1999" /CHECKPOINTING OFF /REPORTING EW /CONSOLELOG SMT
Your assumption that
the connection managers are located at Project level and not within the package itself
is exactly the problem. But there is a solution:
build the project to get a .ispac file
instead of invoking dtexec with /FILE you have to invoke it with /Project and /Package, like this:
/Project "path to you .ispac file, resulting from building the project"
/Package "Name of your package.dtsx"
Please, be aware that if you provide the whole path to your .dtsx package the execution will fail with very criptic SQLDUMPER error messages.

SQL Server Agent Error on running an SSIS package

When trying to execute an SSIS package I get the following error:
Date 14/08/2013 15:02:42 Log Job History (test)
Step ID 1 Server YGAL1-MOBL1 Job Name test Step Name ssis
Duration 00:00:00 Sql Severity 0 Sql Message ID 0 Operator
Emailed Operator Net sent Operator Paged Retries Attempted 0
Message Executed as user: GER\YGAL1-MOBL1$. Microsoft (R) SQL Server
Execute Package Utility Version 10.50.1600.1 for 64-bit Copyright
(C) Microsoft Corporation 2010. All rights reserved. Started:
15:02:42 Error: 2013-08-14 15:02:42.84 Code: 0xC0011007
Source: {0AF31012-7A56-4B28-92EF-BE439E68E6F0} 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: 2013-08-14 15:02:42.84 Code: 0xC0011002 Source:
{0AF31012-7A56-4B28-92EF-BE439E68E6F0} Description: Failed to
open package file "C:\Users\ygal1\Documents\Visual Studio
2008\Projects\Integration Services Project2\Integration Services
Project2\Package.dtsx" due to error 0x80070005 "Access is denied.".
This happens when loading a package and the file cannot be opened or
loaded correctly into the XML document. This can be the result of
either providing an incorrect file name was specified when calling
LoadPackage or the XML file was specified and has an incorrect format.
End Error Could not load package "C:\Users\ygal1\Documents\Visual
Studio 2008\Projects\Integration Services Project2\Integration
Services Project2\Package.dtsx" because of error 0xC0011002.
Description: Failed to open package file
"C:\Users\ygal1\Documents\Visual Studio 2008\Projects\Integration
Services Project2\Integration Services Project2\Package.dtsx" due to
error 0x80070005 "Access is denied.". This happens when loading a
package and the file cannot be opened or loaded correctly into the XML
document. This can be the result of either providing an incorrect file
name was specified when calling LoadPackage or the XML file was
specified and has an incorrect format. Source:
{0AF31012-7A56-4B28-92EF-BE439E68E6F0} Started: 15:02:42 Finished:
15:02:42 Elapsed: 0.046 seconds. The package could not be found.
The step failed.
Any ideas on how can I solve it?
i had a similar problem and what i did to get my package to run was:
a. Open Job properties in SQL Server
b. On the Steps page in the Package field: I used the entire folder name instead of the mapped name, for example: \share\allusers\myuserid\mypackage.dtsx instead of A:\mypackage.dtsx
Best.
It looks to me like the Service account for the SQL Agent doesn't have permissions to read package.dtsx.
Maybe check which account is running the SQL Agent & give it NTFS read permissions to C:\Users\ygal1\Documents\Visual Studio 2008\Projects\Integration Services Project2\Integration Services Project2
Or store the DTSX file in a location the SQL Agent account can access?

How to debug SQL Server Agent Jobs?

I two SSIS packages that both run fine on my local machine. I can import them to SSIS on the server and execute them both with no problems. However, I need to run them in series every night at 3AM. Thus, I created a SQL Server Agent Job with two steps. The first step runs the first package successfully. The second step should run the second package but it fails with this error message:
Message
Executed as user: IT-DEV\itdev. Microsoft (R) SQL Server Execute Package Utility Version 11.0.2100.60 for 64-bit Copyright (C)
Microsoft Corporation. All rights reserved. Started: 1:27:21 PM
Error: 2013-05-30 13:27:21.53 Code: 0x00000001 Source: Create
text files on IT DEV Description: Exception has been thrown by
the target of an invocation. End Error DTExec: The package execution
returned DTSER_FAILURE (1). Started: 1:27:21 PM Finished: 1:27:21
PM Elapsed: 0.375 seconds. The package execution failed. The step
failed.
Both packages move some files from one directory to another and do some work. They both run in the same security context using the same proxy. I can see the work completed successfully from step 1, but again step 2 fails. I have looked through all possible step settings for each and see no differences. Thus, how can I get a more descriptive message so I know what the real issue is. I'm guessing its permissions but again both packages do similar work in similar locations requiring the same permissions. One runs, the other doesn't. Please help. Thanks in advance.
FYI I've also turned SSIS logging on and write everything to a file but the message below is the only error I see.
UPDATE
I ended up writing to a text file all over inside the script task to try to identify the problem. I seem to be getting stuck here:
string connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + myPath + ";Extended Properties=\"text;HDR=NO;FMT=TabDelimited\"";
OleDbDataAdapter adapter = new OleDbDataAdapter("SELECT * FROM MYFILE.txt", connStr);
outfile.WriteLine("Adapter Created");
DataTable dtFiles = new DataTable();
adapter.Fill(dtFiles);
outfile.WriteLine("Filled DataTable");
I never see "Filled DataTable" in the file I'm writing to... the last entry says "Adapter Created".
Turns out I needed to replace this: Microsoft.Jet.OLEDB.4.0 with this: Microsoft.ACE.OLEDB.12.0 because I'm running the agent job on Windows Server 2008 64 bit.