SQL Server 2005 SSIS job that writes a file to another server will not run, but will run through MSDB - sql-server-2005

I have a SSIS package that writes to a csv file on another server. It will run fine when I execute it manually out of the MSDB folder, but when I try to run it through a job, it fails with the following errors:
If I run it with the file path as W:\share\file.csv (I have the other server mapped to the drive letter W:), I get:
Executed as user: NT AUTHORITY\NETWORK SERVICE. Microsoft (R) SQL Server Execute Package Utility Version 9.00.3042.00 for 32-bit Copyright (C) Microsoft Corp 1984-2005. All rights reserved. Started: 3:28:34 PM Error: 2009-09-22 15:28:36.65 Code: 0xC020200E Source: Data Flow Task Description: Cannot open the datafile " W:\share\file.csv ". End Error Error: 2009-09-22 15:28:36.67 Code: 0xC004701A Source: Data Flow Task DTS.Pipeline Description: component "FlatFileConnection" (46) failed the pre-execute phase and returned error code 0xC020200E. End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 3:28:34 PM Finished: 3:28:36 PM Elapsed: 2.484 seconds. The package execution failed. The step failed.
If I run it with the file path as \\server\share\file.csv, I get:
Executed as user: NT AUTHORITY\NETWORK SERVICE. Microsoft (R) SQL Server Execute Package Utility Version 9.00.3042.00 for 32-bit Copyright (C) Microsoft Corp 1984-2005. All rights reserved. Started: 9:28:44 AM Error: 2009-09-23 09:28:45.62 Code: 0xC001401E Source: Connection manager "Flat File Connection Manager" Description: The file name \server\share\file.csv " specified in the connection was not valid. End Error Error: 2009-09-23 09:28:45.62 Code: 0xC001401D Source: SSIS Job Description: Connection "FlatFile Connection" failed validation. End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 9:28:44 AM Finished: 9:28:45 AM Elapsed: 0.813 seconds. The package execution failed. The step failed.
I can run it successfully using both of these file formats if I run it manually through the MSDB folder. I have tried using different proxies besides NT AUTHORITY\NETWORK SERVICE, such as the system and network administrator, but still no luck, so I really don’t think it’s a permissions issue. The job will run successfully if I try to write the file to the local server.
Any ideas? I have been struggling with this one for a while so I would sure appreciate some good feedback on this.

It really seems like a permissions issue. When you execute it manually it's running as your network account. When you execute it from a job it's running as NT AUTHORITY\NETWORK SERVICE. Try changing your SQL Agent service account to run as you, i.e., your network account. Then let it execute the job running under your credentials (make sure you start and stop the service). This will verify if it is really a permissions issue.

How is your W: mapped? Make sure it is a mapping that is available at the time it is used, for the account running the package. See MSDN blog entry here. Here is some relevant notes from that article:
As explained in KB180362 article this was precisely the problem with the Agent job:
A service (or any process that is running in a different security
context) that must access a remote resource should use the Universal
Naming Convention (UNC) name to access the resource. UNC names do not
suffer from the limitations described in this article.
I was getting the same error, with SQL Server 2008 R2 running a job as sa and writing to same server. In my case, I changed the \server\dir\subdir path in my SSIS config file to e:\dir\subdir, which is what the local account would normally use. That seems to work. (My job HAD been running fine for a long time, and only recently started to fail, but not always.)

Related

Cannot create a task from xml for task Azure Blob Download Task. Error 0x80070057 the parameter is in correct

We have implemented an SSIS package which downloads the file from Azure blob storage. The package works when we execute from local development box. But it's failing on TEST environment.
This was working earlier both local and TEST environment. We couldn't figure out what went wrong recently.
Can somebody help us here?
Following are the software components we have installed.
SQL Server Version: 2016
SSDT : Microsoft SQL Server Data Tool Visual Studio 2017
Service Feature Pack: SQL Server 2016 Integration Services Feature Pack for Azure (x64)
Management Studio: Microsoft SQL Server Management Studio - 17.9
Following are the properties we have setup.
Component: Azure Blob Download Task.
Properties: AzureStorageConnection.
LocalDirectory:
BlobContainer:
FileName
Following are the error message we are seeing in the execution context.
Azure Blob Download Task:Error: There were errors during task validation.
Azure Blob Download Task:Error: The task has failed to load. The contact information for this task is "".
Azure Blob Upload Task:Error: Failed to load task "Azure Blob Upload Task", type "". The contact information for this task is "".
Loop through records:Error: Cannot create a task from XML for task "Azure Blob Upload Task", type "SSIS.ReplacementTask, {8B8C4D3B-F53C-4DCC-8D7D-6E197EE31125}" due to error 0x80070057 "The parameter is incorrect.".
Azure Blob Download Task:Error: Failed to load task "Azure Blob Download Task", type "". The contact information for this task is "".
Loop through records:Error: Cannot create a task from XML for task "Azure Blob Download Task", type "SSIS.ReplacementTask, {8B8C4D3B-F53C-4DCC-8D7D-6E197EE31125}" due to error 0x80070057 "The parameter is incorrect.".
For the first error, please refer to Maintenance Plan Error
https://blog.sqlauthority.com/2018/02/16/sql-server-maintenance-plan-error-cannot-create-task-xml-task-eue-error-0x80070057-parameter-incorrect-onpreexecute/
Error: The task with the name "Data Flow Task"
https://social.msdn.microsoft.com/Forums/ie/en-US/0b57adfa-0872-4cd4-85d8-40bfaa520285/error-when-executing-ssis-package?forum=sqlintegrationservices
Just for clarification : Have you could try following options:
1. Try using DTexce tool to execute the package to check if this issue persist.
2. Register the Azure Blob Task into GAC manually.
3. Check if the account has permission to upload file to Azure.
Azure Blob Download Task
https://learn.microsoft.com/en-us/sql/integration-services/control-flow/azure-blob-download-task?view=sql-server-2017
Kindly let us know if the above helps or you need further assistance on this issue.

Where is the.cs files when a script task is run from the SSISDB using the agent?

I have an SSIS job that contains a script task.
There is also a connection to another server within the package that can only be executed accessed by a specific user and the agent cannot be given read rights to the other server.
So the solution to this is have the SQL job be run as the required user.
The problem with this is this user does not have full control over the folder/file where the script task will be temporarily located while the code runs so I get a failure on the script task but if I run it in visual studio or with the normal agent account the script task executes successfully.
I have tried giving the user access to all major drives on the server but this has not solved the problem
Is the script doing something on the folder?
Or does it just need permission to execute script?
I would anyway advise you to implement error handling in script:
https://learn.microsoft.com/en-us/sql/integration-services/extending-packages-scripting/task/logging-in-the-script-task?view=sql-server-2017
Make sure it works in visual studio, so that when you get that error you are sure that the error is caused by permissions/environment.
You could also take a look at this article:
article

What might be causing this error message during the execution of my SSIS Package?

I am using SQL Server 2014 and I have created an SSIS package in SSMS using the Import Data Wizard.
The package imports a table from the database of a linked server and creates a copy on the main database. The SSMS wizard executed all the steps correctly and during one of the steps, I saved the settings as an SSIS package in the File System.
I then created a SQL Server Agent job to execute the package on a daily basis. The job failed to execute with the following error message:
(Import Data into PickUp Table).,00:00:01,0,0,,,,0
06/20/2018 17:18:00,PickUp Table,Error,2,XXXX\XXXXXX,PickUp Table,Import Data into PickUp Table,,Executed as user: XXXXXX\sql_bisvcs. Microsoft (R) SQL Server Execute Package Utility Version 12.0.5000.0 for 64-bit Copyright (C) Microsoft Corporation. All rights reserved.
Started: 5:18:01 PM
Error: 2018-06-20 17:18:01.16
Code: 0xC0010018
Source: PickUp
Description: Error loading value "
End
Error
Could not load package "C:\Users\Administrator\Documents\Visual Studio 2013\projects\PickUp\PickUp.dtsx" because of error 0xC0010014. Description: The package failed to load due to error 0xC0010014 "One or more error occurred. There should be more specific errors preceding this one that explains the details of the errors. This message is used as a return value from functions that encounter errors.".
This occurs when CPackage::LoadFromXML fails.
Source: PickUp
Started: 5:18:01 PM Finished: 5:18:01 PM Elapsed: 0.157 seconds.
The package could not be loaded. The step failed.
I tried to open the package in SSDT, but it failed giving me the same error messages as mentioned above.
What might be causing this error?
You can have a look at the value of Run64BitRuntime debug parameter and try different value True or False.
Depending of your environment, some DLL of third party software can be in conflict.
Also, if your SQL Server instance is on an other server than the computer on wich you want to run the job, you may not be able to execute the package with features you have not installed on this machine.
SSDT, Connector to each remote database / file etc..
Have a look at your SSDT version, if the package is generated via SSMS, it can have a version wich is not recognize by your local machine.

SSIS: Working package fails after upgrade to SQL Server 2012

I have a SSIS package that was running fine on SQL2008R2 using Environmental Variables pointing to a configuration file for connection strings. Using VS2010 Shell, I upgraded the package for our SQL Server 2012 database. The package is still in package deployment model. The ProtectionLevel of the package is set to DontSaveSensitive. Run64BitRuntime = False. When I try and execute the package in VS, I am getting the following errors:
[OLE DB Destination [2]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "DB_Connection" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed.**
[SSIS.Pipeline] Error: OLE DB Destination failed the pre-execute phase and returned error code 0xC020801C.**
With full logging on, I see the first failure here:
Diagnostic,[ComputerName],OFFICE\username,DB_Connection,{5AD75239-D546-4AAF-963E-E195FC2F0C1E},{9EC48106-DDBD-40E9-8FBB-942BCF025EEE},3/26/2013 10:35:21 AM,3/26/2013 10:35:21 AM,0,(null),ExternalRequest_post: 'ITransactionJoin::JoinTransaction failed'. The external request has completed.**
The part that is really throwing me is that earlier in the package, the same "DB_Connection" manager is used successfully in a number of Execute SQL Tasks. So, it seems the connection strings are being read from the configurations correctly.
I have tried deleting\recreating the Connection Manager. I have verified that DTC is configured properly on both my local and the server. I have other packages connecting to the same SQL2012 DB using the same configuration method using Data Flow Tasks without a problem.
Any help anyone can give to point me in the right direction will be much appreciated. I would prefer to not have to move to a project deployment model at this time if I do not have to.
I was able to get my package to run locally. While I had checked the TransactionOption on my tasks to make sure they were set to Supported, it turned out that one of my sequence containers was set to Required. Not sure why this worked in SQL2008R2, but not in SQL2012. I changed my container to Supported and the package runs now.

I Need Assistance with executing an SSIS package

I've tried with this for over 48 hours and no luck. I then create a simple package, one FTP task to download text files. I deployed the package using the option "SQL Server Deployment". I see the package in SSIS but when I try to run from command line with the command
dtexec /ser svrprod05 /sq Package
I get the error
Microsoft (R) SQL Server Execute Package Utility
Version 9.00.3042.00 for 32-bit
Copyright (C) Microsoft Corp 1984-2005. All rights reserved.
Started: 10:56:39 PM
Could not load package "Package" because of error 0xC0014062.
Description: The LoadFromSQLServer method has encountered OLE DB error code 0x80
004005 (Login timeout expired). The SQL statement that was issued has failed.
Source:
Started: 10:56:39 PM
Finished: 10:56:55 PM
Elapsed: 15.625 seconds
I tried passing a username and password of the following
1. Local Administrator
2. Domain Administrator
3. Ent Administrator
4. SQL Server SA
My original objective is mentioned here. I don't know what else to try.
In my view SSIS is programming - every time something needs to be done in SSIS in our company a programmer is called to do it.
Here are a few things to try.
Try 1:
Add
127.0.0.1 crl.microsoft.com
to the hosts file on the server.
Try 2:
providing the db_dtsoperator role to the executing user
Try 3:
Make sure you are not using the 32 bit version of DTExec on a 62 bit OS.