SSIS FTP Task Variable Remote Path invalid

I am working on the SSIS FTP Task that transfer file from one FTP server to local location, rename the file name, and finally transfer the renamed file to another FTP server. So I defined 2 FTP tasks.

For the FTP file receive operation, I need the remote path to be updated by a script and pass to the user define variable. So I set TRUE to IsRemotePathVariable. In the RemoteVariable, I set User::FTPSourcePath where the variable is set in the script with "/DMFTP/filename1.jpg"

For the FTP file send operation, I set TRUE to IsRemotePathVariable. In the RemoteVariable, I set User::FTPDestPath where the variable is set in the script with "/DestFTP/"

After all the setting, the FTP Task box show me the error as "Variable "FTPSourcePath" doesn't start with "/". Another FTP box show me "Variable "FTPDestPath" doesn't start with "/"

Can anyone help me on this problem? Thanks.

[981 byte] By [spTin] at [2007-12-22]
# 1

Did you try escaping the '/' with something like this?

"//DestFTP//"

-Walter

Walti at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 2
Since you set the variable in a script task, and the value is only available during execution - set DelayValidation property of the FTP task to true.
MichaelEntin-MSFT at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 3

i'm at my wits end with this FTP task problem and need some really reliable advice, please! I don't know if this should be another thread or not but here it is...

I'm doing a simple FTP delete file command using FTP task.

I'm connecting from a windows to a unix box. Creating a FTPConectionMgr and testing connection is successful.

I'm aware that when i'm logged into the server, i'm taken by default to my '/home/user/' directory.

i put in the full path to the file i want to delete ie. /Dev/2.0/Extracts/W.XYZ

When i run the package, it gives me the File Represented by /Dev/2.0/Extracts/W.XYZ does not exist.

If i log into the unix box using ftp.exe i don't have any problem.

Why?

Fyi, i've tried entering the path with '//' and also '////' but doesn't work. What should the path convention be?

Enzoe at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 4

Sigh. I tried using a 3rd party tool from IP*Works for ftp process and it works without problems. I can't use it for in my project due to business requirements, so i'm stuck writing my own ftp scripts.

Is there some reason why a smaller company can get ftp working right and microsoft can't?

Enzoe at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 5

Setting this value gets you through validation, but still fails at execution time.

Is this a known bug? I basically have a variabled dated file that I need to grab and load everyday.. I am populating my variable with the following and it works fine. SELECT '//'+replace(CONVERT(varchar(10), GETDATE(), 121),'-','')+'accounting_log.txt.pgp' AS DatedFileName

I have my remote path set as variable, but it continues to complain here is the output.

===================================

Package Validation Error (Package Validation Error)

===================================

Error at FTP Daily Transaction File [FTP Task]: Variable "DatedFileName" doesn't start with "/".

Error at FTP Daily Transaction File: There were errors during task validation.

(Microsoft.DataTransformationServices.VsIntegration)


Program Location:

at Microsoft.DataTransformationServices.Project.DataTransformationsPackageDebugger.ValidateAndRunDebugger(Int32 flags, DataWarehouseProjectManager manager, IOutputWindow outputWindow, DataTransformationsProjectConfigurationOptions options)
at Microsoft.DataTransformationServices.Project.DtsPackagesFolderProjectFeature.ExecuteTaskOrPackage(ProjectItem prjItem, String taskPath)

IRBTechnician at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 6
Is anyone from Microsoft going to suggest a fix for this? This seems to be a bug becasue the "/" has been supplied. The solution above is not a solution since it only bypasses the validation phase, but it still fails at runtime. I can live with it being a bug, becasue I know it will be worked and solved in the future.
IRBTechnician at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 7

Enzoe,

I had the same issue going against the Unix FTP site to attempt to delete files and so I wrote a little function in C# library that I use from a script task to accomplish what I want. You could probably do this inline to a script task but it would not be reusable.

public static void FtpDeleteFiles(ScriptObjectModel dts, string connectionName, string[] remoteFiles)
{
ConnectionManager mgr = dts.Connections[connectionName];
FtpClientConnection conn = new FtpClientConnection(mgr.AcquireConnection(null));

if (conn != null)
{
conn.Connect();

try {
conn.DeleteFiles(remoteFiles);
}
finally {
conn.Close();
}
}
}

This allows me to create the FTP connection and configure it through the normal SSIS methods and then invoke the FTP process from those connections myself. There are some area's to improve on so that if the connection is NULL an exception is thrown or logged and maybe return a boolean.

Pretty simple...

Fred

FredH at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 8

You are dynamically populating the variable - so its value in unknown until execution. Obviously this package can't be validated until the variable value is set by the previous task, this is why DelayValidate exists and should be used in this case. There is no bug here.

If the package fails at execution time - check that the variable is assigned correct value, use the breakpoints and Watch window.

MichaelEntin-MSFT at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 9

Michael, i've tried entering a fully qualified path and it doesn't work.

I've tried delaying validation and it doesn't work.

If there are some 'special' way of using the FTP task, it should be made known either in the designer or in BOL. Otherwise, the task should work as would be generally expected, as per basic rules of user usability.

Anyway, i've given up on the FTP Task. I wrote my own assembly to perform the task.

Enzoe at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 10

Enzoe, I am encountering the same error and unable to use the FTP task to recieve a dated file (For example, File_Name_mmddyyyy.txt.pgp) via FTP in my SSIS package. I started looking for the solution to this error last week and after seeing your response, it looks like I will have to do the same thing you did. Could you throw some light on how you achieved this?

I would really appreciate, if you can help and pass the sample code.

Thanks.

msavalia at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 11

Look above and there is some sample code to achieve this. This is a bug specific to Unix FTP servers and the SSIS FTP task only.

Fred

FredH at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 12
Would you PLEASE fix this Microsoft? The FTP Task is totally useless when trying to Delete remote files on a Unix FTP server. I notice there was a bug submitted for this but it was closed as "could not repro". Please help!
bizhaoqi at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 13

You can try the SSIS FTP Task from /n software - http://www.nsoftware.com/ssis/

-Eric

EricMadariaga at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 14
I am having the same problem. This is a bug. I can ftp the file using almost any other utility including the Microsoft client. This killed my timeline.
lcj at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Integration Services...

SQL Server

Site Classified