Execute Script task throws error "The package execution returned DTSER_FAILURE (1)"

I have a SSIS package that will load data from a set of excel files then archive those files to a specified folder.

The excel files are stored in a folder and inside that folder I have the archive folder.

Below is my script task code for reference.

public void Main()
        {
            // TODO: Add your code here
            string sourceDir =  Dts.Variables["User::strFilePath"].Value.ToString();
            string destDir = Dts.Variables["User::strArchivePath"].Value.ToString();

            DirectoryInfo di = new DirectoryInfo(sourceDir);
            string[] sDirFiles = Directory.GetFiles(sourceDir);
            FileInfo[] fi = di.GetFiles("*.xls");
            int fileCnt = fi.Length;
                for (int i = 0; i < fileCnt; i++)
                {
                    String filename = fi[i].Name;
                    string[] splitFilename = filename.Split('.');

                    DateTime dt = DateTime.Now;
                    string ArchiveDate = String.Format("{0:ddMMMyyyy}", dt);

                    string sourceFileName = filename;
                    string sourceFilePath = sourceDir + filename;
                    string destinationFileName = splitFilename[0] + '_' + ArchiveDate + '.' + splitFilename[1];
                    string destinationPath = destDir + destinationFileName;


                    //MessageBox.Show("Source File " + sourceFilePath + " to destination " + destinationPath);
                    if (File.Exists(destinationPath))
                        File.Delete(destinationPath);
                    // To move a file or folder to a new location:
                    System.IO.File.Move(sourceFilePath, destinationPath);
                }
            Dts.TaskResult = (int)ScriptResults.Success;
        }

The sourceDir and destDir are variables that provides the path of source files folder and archive folder. The package works fine when I run it from visual studio.

I have deployed it to run as a job using deployment utility by creating manifest file. When I run the job I'm getting error in my archive script task. Below is the screenshot of it.

I searched for solution in stackoverflow however the provided solutions does not solve my problem.

Problem using SQL Agent to run SSIS Packages - fails with DTSER_FAILURE(1)

DTSX package runs in Visual Studio but not when called from a Database Job

I have granted read write access to SQL server for both the folders. Still getting the same error? Also have verified the excel runtime and it has been set to 32Bit.

Any help is highly appreciated.


September 6th, 2015 10:03am

There should be a job history for step failed rather than the general error. can you p
Free Windows Admin Tool Kit Click here and download it now
September 6th, 2015 4:57pm

Can you check the manage connections from SSIS package whether something like we have it in maintainance plan is causing the issue as once it happened to me in maint. plan and manage connections was the issue .

Also since this is running from VB .. just check whether the same SSIS can be run / started remotely to make sure permissions are not any issue .

September 6th, 2015 8:32pm

Hi, Please find the log below

Date,Source,Severity,Step ID,Server,Job Name,Step Name,Notifications,Message,Duration,Sql Severity,Sql Message ID,Operator Emailed,Operator Net sent,Operator Paged,Retries Attempted

09/07/2015 12:53:19,DemoDT,Error,,LTP,DemoDT,,,The job failed.  The Job was invoked by User LTP\karthik.  The last step to run was step 1 (SSISPackageCall).,00:01:20,0,0,,,,0

09/07/2015 12:53:23,DemoDT,Error,1,LTP,DemoDT,SSISPackageCall,,Executed as user: LTP\Karthik. Microsoft (R) SQL Server Execute Package Utility  Version 11.0.2100.60 for 32-bit  Copyright (C) Microsoft Corporation. All rights reserved.    Started:  12:53:23 PM  Error: 2015-09-07 12:54:39.06     Code: 0x00000001     Source: Archive Files      Description: Exception has been thrown by the target of an invocation.  End Error  DTExec: The package execution returned DTSER_FAILURE (1).  Started:  12:53:23 PM  Finished: 12:54:39 PM  Elapsed:  75.5 seconds.  The package execution failed.  The step failed.,00:01:16,0,0,,,,0

09/06/2015 20:31:18,DemoDT,Error,,LTP,DemoDT,,,The job failed.  The Job was invoked by User LTP\karthik.  The last step to run was step 1 (Execute).,00:00:16,0,0,,,,0

09/06/2015 20:31:19,DemoDT,Error,1,LTP,DemoDT,Execute,,Executed as user: LTP\karthik. Microsoft (R) SQL Server Execute Package Utility  Version 11.0.2100.60 for 32-bit  Copyright (C) Microsoft Corporation. All rights reserved.    Started:  8:31:19 PM  Error: 2015-09-06 20:31:34.41     Code: 0x00000001     Source: Archive Files      Description: Exception has been thrown by the target of an invocation.  End Error  DTExec: The package execution returned DTSER_FAILURE (1).  Started:  8:31:19 PM  Finished: 8:31:34 PM  Elapsed:  14.796 seconds.  The package execution failed.  The step failed.,00:00:15,0,0,,,,0

09/06/2015 20:21:26,DemoDT,Error,,LTP,DemoDT,,,The job failed.  The Job was invoked by User LTP\karthik.  The last step to run was step 1 (Execute).,00:01:59,0,0,,,,0

09/06/2015 20:21:26,DemoDT,Error,1,LTP,DemoDT,Execute,,Executed as user: LTP\karthik. Microsoft (R) SQL Server Execute Package Utility  Version 11.0.2100.60 for 32-bit  Copyright (C) Microsoft Corporation. All rights reserved.    Started:  8:21:27 PM  Error: 2015-09-06 20:23:24.32     Code: 0x00000001     Source: Archive Files      Description: Exception has been thrown by the target of an invocation.  End Error  DTExec: The package execution returned DTSER_FAILURE (1).  Started:  8:21:27 PM  Finished: 8:23:24 PM  Elapsed:  117.656 seconds.  The package execution failed.  The step failed.,00:01:59,0,0,,,,0

09/06/2015 20:01:36,DemoDT,Error,,LTP,DemoDT,,,The job failed.  The Job was invoked by User sa.  The last step to run was step 1 (Execute).,00:00:03,0,0,,,,0

09/06/2015 20:01:39,DemoDT,Error,1,LTP,DemoDT,Execute,,Non-SysAdmins have been denied permission to run DTS Execution job steps without a proxy account.  The step failed.,00:00:00,0,0,,,,0

09/04/2015 10:02:43,DemoDT,Error,,LTP,DemoDT,,,The job failed.  The Job was invoked by User sa.  The last step to run was step 1 (Execute).,00:01:07,0,0,,,,0

09/04/2015 10:02:45,DemoDT,Error,1,LTP,DemoDT,Execute,,Executed as user: NT Service\SQLSERVERAGENT. Microsoft (R) SQL Server Execute Package Utility  Version 11.0.2100.60 for 32-bit  Copyright (C) Microsoft Corporation. All rights reserved.    Started:  10:02:46 AM  Error: 2015-09-04 10:03:48.66     Code: 0x00000001     Source: Archive Files      Description: Exception has been thrown by the target of an invocation.  End Error  DTExec: The package execution returned DTSER_FAILURE (1).  Started:  10:02:46 AM  Finished: 10:03:48 AM  Elapsed:  62.141 seconds.  The package execution failed.  The step failed.,00:01:04,0,0,,,,0

09/03/2015 19:09:10,DemoDT,Error,,LTP,DemoDT,,,The job failed.  The Job was invoked by User sa.  The last step to run was step 1 (Execute).,00:00:15,0,0,,,,0

09/03/2015 19:09:10,DemoDT,Error,1,LTP,DemoDT,Execute,,Executed as user: NT Service\SQLSERVERAGENT. Microsoft (R) SQL Server Execute Package Utility  Version 11.0.2100.60 for 32-bit  Copyright (C) Microsoft Corporation. All rights reserved.    Started:  7:09:10 PM  Error: 2015-09-03 19:09:25.32     Code: 0x00000001     Source: Archive Files      Description: Exception has been thrown by the target of an invocation.  End Error  DTExec: The package execution returned DTSER_FAILURE (1).  Started:  7:09:10 PM  Finished: 7:09:25 PM  Elapsed:  15.187 seconds.  The package execution failed.  The step failed.,00:00:15,0,0,,,,0

Free Windows Admin Tool Kit Click here and download it now
September 7th, 2015 3:37am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics