Showing posts with label ssis. Show all posts
Showing posts with label ssis. Show all posts

Thursday, March 29, 2012

FTP Task Send error

I cannot seem to get the FTP task to send files. I tested the process manually (not using ssis) and it works fine. I have tried many ways to transfer the files, using variables, including full paths, partial paths, etc. but I keep getting a "550 permission denied" error. I have rechecked all variables. Has anybody else had trouble sending files with the FTP task?

Do you have access (or can someone GET access) to the FTP logs on the server to see who it thinks you are connecting as?|||

I am checking with them but it seems strange. I have set the user and password using a configuration file and I am getting the following error:

[Connection manager "MyFTPConnection"] Error: An error occurred in the requested FTP operation. Detailed error description: 200 Type set to IMAGE. 227 Entering Passive Mode (xx,xx,xxx,xxx,xx,xx). 550 permission denied .

I have tested the configuration file to make sure the server name was being set correctly from the file and it was. I am assuming the password would be also. I can connect manually.

This really should not be such a struggle. I remember DTS did not have an upload FTP component. Maybe I need a 3rd party component. Does anybody know of one?

|||

Looks like I'm connecting but the required slash is causing a permissions problem on the server. Anybody know how to solve this? The task won't let me send a file without a slash.

[FTP Task] Error: Variable "RemoteFile" doesn't start with "/".

sql

FTP Task in SSIS

Hello,

I m having an FTP Task in SSIS project, from where I have downloaded .csv file.

And also having a Processed Folder in which the processed .csv files are kept.

Main task is to download file from FTP and check , if the date of downloaded file is newer than file in processed folder, then only process that file. Else skip the processing

Can anyone help me out how to process about.

plz reply as early as possible.

Thanks & Kind regards ....

Aparna

I do not know if this is the best way to do this, but I would personally use the Foreach Loop container and the Script task. Loop over the folder into which the FTP task is dropping files, storing the file name in a package variable.

Then, inside a Script task contained within the Foreach Loop, use the System.IO.File class to compare the files retrieved by the FTP task with the matching files in the processed folder. Based on the comparison, set a package variable flag ("Newer"/"Older" or true/false or the like) in your script.

Then, back in your package's control flow, edit the properties of your precedence constraint(s) to execute the later tasks only if the flag variable is set to the correct value.

Does this help?

sql

FTP Task in a SQL Server Agent Scheduled Job - Corrupts Excel file?

We are not certain if this has happened due to the SSIS FTP Task, but incidently the Excel file that is being copied from the FTP site using an SSIS FTP Task got corrupted a couple hours after the package was scheduled as a SQL Server Agent Job on SQL Server 2005.

I had a SQL Server 2000 DTS package doing the same thing, but it was never an issue then. I was using the FTP Task there along with an Excel Data source in that and has been working for a couple years atleast with never any corruption related issues.

In the SSIS SQL Server 2005 package I am using an FTP Task with an Excel Connection Manager and Excel source and the Excel file got corrupted within a couple hours of the package being scheduled as a SQL Server Agent job.

Has anyone experienced this issue? Any inputs will be appreciated.

Just as an fyi, the excel file has a lot of vlookups.

Thanks,

MShah

The FTP task does not delete existing file when downloading new one with the same name (we have recently found it and planning to fix for SP2). So if the downloaded file is smaller than existing one, it overwrites the beginning of existing file with new content, but the remaining file content might be from previous file.

The workaround is to use File System Task to delete existing file before downloading new one.

FTP Task for SSIS missing

Hi Everyone,

When I first installed BI Studio everything was working fine, but I went into it today and I noticed that the FTP task seems to be missing, I can't see it in the toolbox, everything else appears to be their but not that.

Any idea how I can get this back, I really don't wont to uninstall and reinstall at the moment, and I'm not even sure if that would work.

ThanksRight-click the toolbox, Choose Items. Select the SSIS Control Flow page and have a look for any missing tasks, those not checked.

FTP Task and Temporary Internet Files

I have created a package within SQL Server SSIS which includes an FTP Task, deployed it to our SQL Server (2005 SP1) msdb database and am running this job under SQL Agent on Windows Server 2003. Due to company security requirements this job has to be run under a service account within SQL Agent. The problem with this is that even though a directory is specified within the FTP Task to place any downloaded files into, the files are first written to the TIF (Temporary Internet Files) directory of "Default User" which is on the system drive. Based on corporate standards the system drive (C:) on our servers are only configured with enough space for the OS and other system files. All of the files being transferred are compressed, but some are still well over 1GB in size. The result is that many of our downloads are failing due to the system drive running out of space.

I have attempted to run IE by using "Run As" with the service account credentials, and have changed the location of the TIFs to a different drive, rebooted and verified the settings. When the SQL Agent job was run again, the files were still being written to the "Default User" directory on the system drive. I also created a new template account with the TIFs pointing to a non-system drive and used the User Profiles functionality of System Properties to copy the new template account to "Default User", but still the files are being written to the system drive.

My questions are:

    is there a way to stop the FTP Task from using TIF (i.e. just directly write the file to the location specified) is there a best practice around how to setup a service account and have it create a proper user profile that can be managed separate from "Default User" short of specifying during the OS install, is there a way to move the "Default User" profile directory to a different drive

In case anyone else runs into this situation, I thought I would describe what ended up happening.

The page file was moved off of the system drive; otherwise the server was locking up when the system drive ran out or space. Now that the page file is on a separate drive, once the system drive runs completely out of space during a download the FTP Task (or whatever is managing the FTP transfer in the background) just starts writing the file being downloaded to the specified location (apparently it's smart enough to stop caching without crashing once there is no space left). Once the file that filled up the system drive completes downloading then it is removed from the TIF; normally the files aren't removed from the TIF until the entire package finishes execution.

The only downside to this is that the time period between the system drive becoming full and the file download completing, there are difficulties with logging into the machine. The difficulty is that some error messages are displayed and not being able to use your user profile - the Default User profile is used instead.

|||I am experiencing a similar problem. Does anybody out there know how to address this issue please?

Chris Lund, Software Installation Limited, Manchester UKsql

Tuesday, March 27, 2012

FTP Task - Delete remote files always fails

Hello,

I have two FTP Tasks configured in my SSIS package. One is for "Receive files" and the other is set for "Delete remote files." Both use variables for the source/destination paths. My remote path variable contains a wild card in the name field such as /usr/this/is/my/path/*.ext and it is working to FTP all the .ext files to my working directory. I then rename the files and want to remove the original files from the FTP server. I use the same variable as the remote path variable in the delete as I do in the receive.

Using the same FTP connection manager for both tasks I am always getting a failure on the delete. The FTP connection manger is setup to use the root user. Using a terminal I am able to open an FTP connection to the server and remove the files manually. There doesn't seem to be any detailed documentation on the FTP Task configured for Delete remote files so I'm hoping someone might have some insight to the problem.

I receive the same message for each of the files that was downloaded:

Error: 0xC001602A at MyPackage, Connection manager "FTP Connection Manager": An error occurred in the requested FTP operation. Detailed error description: 550 \usr\this\is\my\path\datafile1.ext: No such file or directory.

The attempt to delete file "\usr\this\is\my\path\datafile1.ext" failed. This may occur when the file does not exist, the file name was spelled incorrectly, or you do not have permissions to delete the file.

With the root user/working manually I'm not understanding the permission reason, the file does exist and is spelled correctly.

Dan

Has anyone been able to remotly delete mutliple files? I'm convinced this isn't an ftp permission error as I can ftp using the same credentials in an ftp session and issue a del command to each of the files that is listed in the Output. Each one deletes.

I see there is one other unanswered post about a problem remotly deleting a file, but no answers.

|||

I am experiencing a similar problem and have not found a resolution. In my situation I am able to successfully delete files from Windows FTP servers but have not been able to delete files from Unix FTP servers. I know that this is not a permissions problem because I can go through any number of other FTP clients and delete files without a problem from both servers. I also have no problems downloading files from either the Windows or Unix FTP servers.

Any suggestions or other information would be welcome.

|||

I submitted a bug to the product feedback center. If you want to vote on it/add a comment to perhaps start getting a little more visability for this.

http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=4cd7df40-bf26-41b0-835b-3369db79284b

I was able to find a workaround for my situation. I was also able to access the directory via a Samba share. So using the full UNC path to the directory I was able to use a Foreach file in directory loop with a FileSystemTask to delete the files. It runs pretty quick too. Obviously I can't compare the speed with the FTP task though.

As an FYI, my CIO had mentioned to me that he thinks he had the same problem with DTS. By the time I started working here I just adopted his custom script to perform the FTP so I never really tried it myself on DTS.

|||

Were you able to delete a single file using the FTP Task without using a wildcard?

Donald Farmer

|||

I setup a simple package with just the FTP Task and a variable to just one file (no wildcard).

SSIS package "Package.dtsx" starting.

Error: 0xC001602A at Package, Connection manager "FTP Connection Manager": An error occurred in the requested FTP operation. Detailed error description: 550 \usr\my\path\tmp\test1.dts: No such file or directory.

The attempt to delete file "\usr\my\path\tmp\test1.dts" failed. This may occur when the file does not exist, the file name was spelled incorrectly, or you do not have permissions to delete the file.

.

Error: 0xC002918E at FTP Task, FTP Task: Unable to delete remote files using "FTP Connection Manager".

Task failed: FTP Task

Warning: 0x80019002 at Package: The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.

SSIS package "Package.dtsx" finished: Failure.

|||

I am getting exactly the same problem,

howerver this was part of my investigation of why I can FTP recieve files in development but the same task fails when run thru' sql agent.

any help on either will be appreciated.

Terry

|||

What is your error? How are you saving the connection information in the package (Package ProtectionLevel)? Are you using Configurations?

|||MS has closed this bug saying they cannot reproduce the error. If they require proof, I can provide them with a server and a SSIS package that reproduces this error. I have an FTP site that can be made available to them, and a SQL server with the SSIS package they can run.

Jarret|||

Well I hope they might consider your offer. I unfortunatly can't expose my ftp server to the internet. I really can't imagine how they arn't reproducing it unless they arn't using a UNIX server.

Out of curiousity, what is the OS of your server? Mine is running on SCO.

|||

In case anyone else runs into the situation where the FTP Task will not delete files from Unix FTP sites, I have been using the following as a work-around. I'm using it in a For Each loop to delete individual files on each pass, but it could be modified to delete wild-cards. The first step is to create a Script Task and set the read-only variables to the following (in my package most of these are coming from a Package Configurations file and are mapped to local variables):

FTP_file_name, FTP_server, FTP_root, FTP_port, FTP_username, FTP_password

Then use the following code within the Script Task:

' Microsoft SQL Server Integration Services Script Task
' Write scripts using Microsoft Visual Basic
' The ScriptMain class is the entry point of the Script Task.

Imports System
Imports System.Data
Imports System.Math
Imports System.Net
Imports Microsoft.SqlServer.Dts.Runtime

Public Class ScriptMain

' The execution engine calls this method when the task executes.
' To access the object model, use the Dts object. Connections, variables, events,
' and logging features are available as static members of the Dts class.
' Before returning from this method, set the value of Dts.TaskResult to indicate success or failure.
'
' To open Code and Text Editor Help, press F1.
' To open Object Browser, press Ctrl+Alt+J.

Public Sub Main()

Dts.TaskResult = Dts.Results.Success

Try

If FileExists(Dts.Variables("FTP_file_name").Value.ToString) Then
DeleteFile(Dts.Variables("FTP_file_name").Value.ToString)
End If

'Dts.Events.FireWarning(0, "Done", Dts.Variables("FTP_file_name").Value.ToString, String.Empty, 0)

Catch ex As Exception
Dts.Events.FireWarning(0, "Exception", "Message: " & ex.Message & vbCrLf & vbCrLf & "Stack: " & ex.StackTrace, String.Empty, 0)
Dts.TaskResult = Dts.Results.Failure
End Try

End Sub

Private Function FileExists(ByVal fileName As String) As Boolean

Dim retVal As Boolean = False
Dim remoteServer As String = Dts.Variables("FTP_server").Value.ToString
Dim remotePath As String = Dts.Variables("FTP_root").Value.ToString + fileName

Try

Dim fWebRequest As FtpWebRequest = CreateWebRequest(WebRequestMethods.Ftp.GetFileSize, remoteServer, remotePath)
Dim fWebResponse As FtpWebResponse = CType(fWebRequest.GetResponse(), FtpWebResponse)

If fWebResponse.StatusCode = FtpStatusCode.FileStatus Then
retVal = True
End If

Catch ex As WebException
If CType(ex.Response, FtpWebResponse).StatusCode <> FtpStatusCode.ActionNotTakenFileUnavailable Then
Dts.Events.FireWarning(0, "WebException", "Status Code: " & CType(ex.Response, FtpWebResponse).StatusCode & " Status Description: " & CType(ex.Response, FtpWebResponse).StatusDescription & " Message: " & ex.Message & " Stack: " & ex.StackTrace, String.Empty, 0)
End If
End Try

Return retVal

End Function

Private Sub DeleteFile(ByVal fileName As String)

Dim remoteServer As String = Dts.Variables("FTP_server").Value.ToString
Dim remotePath As String = Dts.Variables("FTP_root").Value.ToString + fileName

Try

Dim fWebRequest As FtpWebRequest = CreateWebRequest(WebRequestMethods.Ftp.DeleteFile, remoteServer, remotePath)
Dim fWebResponse As FtpWebResponse = CType(fWebRequest.GetResponse(), FtpWebResponse)

Dts.Events.FireWarning(0, "DeletedFile " & remotePath, "Status Code: " & fWebResponse.StatusCode & " Status Description: " & fWebResponse.StatusDescription, String.Empty, 0)

Catch ex As WebException
Dts.Events.FireWarning(0, "WebException", "Status Code: " & CType(ex.Response, FtpWebResponse).StatusCode & " Status Description: " & CType(ex.Response, FtpWebResponse).StatusDescription & " Message: " & ex.Message & " Stack: " & ex.StackTrace, String.Empty, 0)
End Try

End Sub

Private Function CreateWebRequest(ByVal method As String, ByVal uriHost As String, ByVal uriPath As String) As FtpWebRequest

Dim uBuilder As UriBuilder = New UriBuilder()

uBuilder.Scheme = Uri.UriSchemeFtp
uBuilder.Host = uriHost
uBuilder.Path = uriPath
uBuilder.Port = DirectCast(Dts.Variables("FTP_port").Value, Int32)

Dim fWebRequest As FtpWebRequest = CType(FtpWebRequest.Create(uBuilder.Uri), FtpWebRequest)

fWebRequest.Method = method
fWebRequest.UseBinary = False
fWebRequest.KeepAlive = False
fWebRequest.Timeout = -1
fWebRequest.Proxy = Nothing
fWebRequest.Credentials = New NetworkCredential(Dts.Variables("FTP_username").Value.ToString, Dts.Variables("FTP_password").Value.ToString)

Return fWebRequest

End Function

End Class

|||Has anyone from MS looked at this issue? I'm seeing it as well - seems like an error when attempting to delete multiple files via the FTP task.

[Connection manager "FTP"] Error: An error occurred in the requested FTP operation. Detailed error description: 550 \\results47747.zip: No such file or directory The attempt to delete file "\\results47747.zip" failed. This may occur when the file does not exist, the file name was spelled incorrectly, or you do not have permissions to delete the file. 550 \\test_10_16_2006.zip: No such file or directory The attempt to delete file "\\test_10_16_2006.zip" failed. This may occur when the file does not exist, the file name was spelled incorrectly, or you do not have permissions to delete the file. .|||

Still this script is not helping as its throwing exception back... Has anyone found other workaround please?

Regards,
paddy

|||Paddy -
I used a script fairly similar to the one above to work around this issue - what's the exception you're seeing?

Arjun|||

Hello Arjun,

I recieved the error 550 No such file or directory or do not have permissions but the same account works fine when used some client FTP software like SmartFTP and able to delete the files from there...

Thanks,
paddy

FTP Task - Delete remote files always fails

Hello,

I have two FTP Tasks configured in my SSIS package. One is for "Receive files" and the other is set for "Delete remote files." Both use variables for the source/destination paths. My remote path variable contains a wild card in the name field such as /usr/this/is/my/path/*.ext and it is working to FTP all the .ext files to my working directory. I then rename the files and want to remove the original files from the FTP server. I use the same variable as the remote path variable in the delete as I do in the receive.

Using the same FTP connection manager for both tasks I am always getting a failure on the delete. The FTP connection manger is setup to use the root user. Using a terminal I am able to open an FTP connection to the server and remove the files manually. There doesn't seem to be any detailed documentation on the FTP Task configured for Delete remote files so I'm hoping someone might have some insight to the problem.

I receive the same message for each of the files that was downloaded:

Error: 0xC001602A at MyPackage, Connection manager "FTP Connection Manager": An error occurred in the requested FTP operation. Detailed error description: 550 \usr\this\is\my\path\datafile1.ext: No such file or directory.

The attempt to delete file "\usr\this\is\my\path\datafile1.ext" failed. This may occur when the file does not exist, the file name was spelled incorrectly, or you do not have permissions to delete the file.

With the root user/working manually I'm not understanding the permission reason, the file does exist and is spelled correctly.

Dan

Has anyone been able to remotly delete mutliple files? I'm convinced this isn't an ftp permission error as I can ftp using the same credentials in an ftp session and issue a del command to each of the files that is listed in the Output. Each one deletes.

I see there is one other unanswered post about a problem remotly deleting a file, but no answers.

|||

I am experiencing a similar problem and have not found a resolution. In my situation I am able to successfully delete files from Windows FTP servers but have not been able to delete files from Unix FTP servers. I know that this is not a permissions problem because I can go through any number of other FTP clients and delete files without a problem from both servers. I also have no problems downloading files from either the Windows or Unix FTP servers.

Any suggestions or other information would be welcome.

|||

I submitted a bug to the product feedback center. If you want to vote on it/add a comment to perhaps start getting a little more visability for this.

http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=4cd7df40-bf26-41b0-835b-3369db79284b

I was able to find a workaround for my situation. I was also able to access the directory via a Samba share. So using the full UNC path to the directory I was able to use a Foreach file in directory loop with a FileSystemTask to delete the files. It runs pretty quick too. Obviously I can't compare the speed with the FTP task though.

As an FYI, my CIO had mentioned to me that he thinks he had the same problem with DTS. By the time I started working here I just adopted his custom script to perform the FTP so I never really tried it myself on DTS.

|||

Were you able to delete a single file using the FTP Task without using a wildcard?

Donald Farmer

|||

I setup a simple package with just the FTP Task and a variable to just one file (no wildcard).

SSIS package "Package.dtsx" starting.

Error: 0xC001602A at Package, Connection manager "FTP Connection Manager": An error occurred in the requested FTP operation. Detailed error description: 550 \usr\my\path\tmp\test1.dts: No such file or directory.

The attempt to delete file "\usr\my\path\tmp\test1.dts" failed. This may occur when the file does not exist, the file name was spelled incorrectly, or you do not have permissions to delete the file.

.

Error: 0xC002918E at FTP Task, FTP Task: Unable to delete remote files using "FTP Connection Manager".

Task failed: FTP Task

Warning: 0x80019002 at Package: The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.

SSIS package "Package.dtsx" finished: Failure.

|||

I am getting exactly the same problem,

howerver this was part of my investigation of why I can FTP recieve files in development but the same task fails when run thru' sql agent.

any help on either will be appreciated.

Terry

|||

What is your error? How are you saving the connection information in the package (Package ProtectionLevel)? Are you using Configurations?

|||MS has closed this bug saying they cannot reproduce the error. If they require proof, I can provide them with a server and a SSIS package that reproduces this error. I have an FTP site that can be made available to them, and a SQL server with the SSIS package they can run.

Jarret
|||

Well I hope they might consider your offer. I unfortunatly can't expose my ftp server to the internet. I really can't imagine how they arn't reproducing it unless they arn't using a UNIX server.

Out of curiousity, what is the OS of your server? Mine is running on SCO.

|||

In case anyone else runs into the situation where the FTP Task will not delete files from Unix FTP sites, I have been using the following as a work-around. I'm using it in a For Each loop to delete individual files on each pass, but it could be modified to delete wild-cards. The first step is to create a Script Task and set the read-only variables to the following (in my package most of these are coming from a Package Configurations file and are mapped to local variables):

FTP_file_name, FTP_server, FTP_root, FTP_port, FTP_username, FTP_password

Then use the following code within the Script Task:

' Microsoft SQL Server Integration Services Script Task
' Write scripts using Microsoft Visual Basic
' The ScriptMain class is the entry point of the Script Task.

Imports System
Imports System.Data
Imports System.Math
Imports System.Net
Imports Microsoft.SqlServer.Dts.Runtime

Public Class ScriptMain

' The execution engine calls this method when the task executes.
' To access the object model, use the Dts object. Connections, variables, events,
' and logging features are available as static members of the Dts class.
' Before returning from this method, set the value of Dts.TaskResult to indicate success or failure.
'
' To open Code and Text Editor Help, press F1.
' To open Object Browser, press Ctrl+Alt+J.

Public Sub Main()

Dts.TaskResult = Dts.Results.Success

Try

If FileExists(Dts.Variables("FTP_file_name").Value.ToString) Then
DeleteFile(Dts.Variables("FTP_file_name").Value.ToString)
End If

'Dts.Events.FireWarning(0, "Done", Dts.Variables("FTP_file_name").Value.ToString, String.Empty, 0)

Catch ex As Exception
Dts.Events.FireWarning(0, "Exception", "Message: " & ex.Message & vbCrLf & vbCrLf & "Stack: " & ex.StackTrace, String.Empty, 0)
Dts.TaskResult = Dts.Results.Failure
End Try

End Sub

Private Function FileExists(ByVal fileName As String) As Boolean

Dim retVal As Boolean = False
Dim remoteServer As String = Dts.Variables("FTP_server").Value.ToString
Dim remotePath As String = Dts.Variables("FTP_root").Value.ToString + fileName

Try

Dim fWebRequest As FtpWebRequest = CreateWebRequest(WebRequestMethods.Ftp.GetFileSize, remoteServer, remotePath)
Dim fWebResponse As FtpWebResponse = CType(fWebRequest.GetResponse(), FtpWebResponse)

If fWebResponse.StatusCode = FtpStatusCode.FileStatus Then
retVal = True
End If

Catch ex As WebException
If CType(ex.Response, FtpWebResponse).StatusCode <> FtpStatusCode.ActionNotTakenFileUnavailable Then
Dts.Events.FireWarning(0, "WebException", "Status Code: " & CType(ex.Response, FtpWebResponse).StatusCode & " Status Description: " & CType(ex.Response, FtpWebResponse).StatusDescription & " Message: " & ex.Message & " Stack: " & ex.StackTrace, String.Empty, 0)
End If
End Try

Return retVal

End Function

Private Sub DeleteFile(ByVal fileName As String)

Dim remoteServer As String = Dts.Variables("FTP_server").Value.ToString
Dim remotePath As String = Dts.Variables("FTP_root").Value.ToString + fileName

Try

Dim fWebRequest As FtpWebRequest = CreateWebRequest(WebRequestMethods.Ftp.DeleteFile, remoteServer, remotePath)
Dim fWebResponse As FtpWebResponse = CType(fWebRequest.GetResponse(), FtpWebResponse)

Dts.Events.FireWarning(0, "DeletedFile " & remotePath, "Status Code: " & fWebResponse.StatusCode & " Status Description: " & fWebResponse.StatusDescription, String.Empty, 0)

Catch ex As WebException
Dts.Events.FireWarning(0, "WebException", "Status Code: " & CType(ex.Response, FtpWebResponse).StatusCode & " Status Description: " & CType(ex.Response, FtpWebResponse).StatusDescription & " Message: " & ex.Message & " Stack: " & ex.StackTrace, String.Empty, 0)
End Try

End Sub

Private Function CreateWebRequest(ByVal method As String, ByVal uriHost As String, ByVal uriPath As String) As FtpWebRequest

Dim uBuilder As UriBuilder = New UriBuilder()

uBuilder.Scheme = Uri.UriSchemeFtp
uBuilder.Host = uriHost
uBuilder.Path = uriPath
uBuilder.Port = DirectCast(Dts.Variables("FTP_port").Value, Int32)

Dim fWebRequest As FtpWebRequest = CType(FtpWebRequest.Create(uBuilder.Uri), FtpWebRequest)

fWebRequest.Method = method
fWebRequest.UseBinary = False
fWebRequest.KeepAlive = False
fWebRequest.Timeout = -1
fWebRequest.Proxy = Nothing
fWebRequest.Credentials = New NetworkCredential(Dts.Variables("FTP_username").Value.ToString, Dts.Variables("FTP_password").Value.ToString)

Return fWebRequest

End Function

End Class

|||Has anyone from MS looked at this issue? I'm seeing it as well - seems like an error when attempting to delete multiple files via the FTP task.

[Connection manager "FTP"] Error: An error occurred in the requested FTP operation. Detailed error description: 550 \\results47747.zip: No such file or directory The attempt to delete file "\\results47747.zip" failed. This may occur when the file does not exist, the file name was spelled incorrectly, or you do not have permissions to delete the file. 550 \\test_10_16_2006.zip: No such file or directory The attempt to delete file "\\test_10_16_2006.zip" failed. This may occur when the file does not exist, the file name was spelled incorrectly, or you do not have permissions to delete the file. .
|||

Still this script is not helping as its throwing exception back... Has anyone found other workaround please?

Regards,
paddy

|||Paddy -
I used a script fairly similar to the one above to work around this issue - what's the exception you're seeing?

Arjun
|||

Hello Arjun,

I recieved the error 550 No such file or directory or do not have permissions but the same account works fine when used some client FTP software like SmartFTP and able to delete the files from there...

Thanks,
paddy

FTP Task - Delete remote files always fails

Hello,

I have two FTP Tasks configured in my SSIS package. One is for "Receive files" and the other is set for "Delete remote files." Both use variables for the source/destination paths. My remote path variable contains a wild card in the name field such as /usr/this/is/my/path/*.ext and it is working to FTP all the .ext files to my working directory. I then rename the files and want to remove the original files from the FTP server. I use the same variable as the remote path variable in the delete as I do in the receive.

Using the same FTP connection manager for both tasks I am always getting a failure on the delete. The FTP connection manger is setup to use the root user. Using a terminal I am able to open an FTP connection to the server and remove the files manually. There doesn't seem to be any detailed documentation on the FTP Task configured for Delete remote files so I'm hoping someone might have some insight to the problem.

I receive the same message for each of the files that was downloaded:

Error: 0xC001602A at MyPackage, Connection manager "FTP Connection Manager": An error occurred in the requested FTP operation. Detailed error description: 550 \usr\this\is\my\path\datafile1.ext: No such file or directory.

The attempt to delete file "\usr\this\is\my\path\datafile1.ext" failed. This may occur when the file does not exist, the file name was spelled incorrectly, or you do not have permissions to delete the file.

With the root user/working manually I'm not understanding the permission reason, the file does exist and is spelled correctly.

Dan

Has anyone been able to remotly delete mutliple files? I'm convinced this isn't an ftp permission error as I can ftp using the same credentials in an ftp session and issue a del command to each of the files that is listed in the Output. Each one deletes.

I see there is one other unanswered post about a problem remotly deleting a file, but no answers.

|||

I am experiencing a similar problem and have not found a resolution. In my situation I am able to successfully delete files from Windows FTP servers but have not been able to delete files from Unix FTP servers. I know that this is not a permissions problem because I can go through any number of other FTP clients and delete files without a problem from both servers. I also have no problems downloading files from either the Windows or Unix FTP servers.

Any suggestions or other information would be welcome.

|||

I submitted a bug to the product feedback center. If you want to vote on it/add a comment to perhaps start getting a little more visability for this.

http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=4cd7df40-bf26-41b0-835b-3369db79284b

I was able to find a workaround for my situation. I was also able to access the directory via a Samba share. So using the full UNC path to the directory I was able to use a Foreach file in directory loop with a FileSystemTask to delete the files. It runs pretty quick too. Obviously I can't compare the speed with the FTP task though.

As an FYI, my CIO had mentioned to me that he thinks he had the same problem with DTS. By the time I started working here I just adopted his custom script to perform the FTP so I never really tried it myself on DTS.

|||

Were you able to delete a single file using the FTP Task without using a wildcard?

Donald Farmer

|||

I setup a simple package with just the FTP Task and a variable to just one file (no wildcard).

SSIS package "Package.dtsx" starting.

Error: 0xC001602A at Package, Connection manager "FTP Connection Manager": An error occurred in the requested FTP operation. Detailed error description: 550 \usr\my\path\tmp\test1.dts: No such file or directory.

The attempt to delete file "\usr\my\path\tmp\test1.dts" failed. This may occur when the file does not exist, the file name was spelled incorrectly, or you do not have permissions to delete the file.

.

Error: 0xC002918E at FTP Task, FTP Task: Unable to delete remote files using "FTP Connection Manager".

Task failed: FTP Task

Warning: 0x80019002 at Package: The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.

SSIS package "Package.dtsx" finished: Failure.

|||

I am getting exactly the same problem,

howerver this was part of my investigation of why I can FTP recieve files in development but the same task fails when run thru' sql agent.

any help on either will be appreciated.

Terry

|||

What is your error? How are you saving the connection information in the package (Package ProtectionLevel)? Are you using Configurations?

|||MS has closed this bug saying they cannot reproduce the error. If they require proof, I can provide them with a server and a SSIS package that reproduces this error. I have an FTP site that can be made available to them, and a SQL server with the SSIS package they can run.

Jarret|||

Well I hope they might consider your offer. I unfortunatly can't expose my ftp server to the internet. I really can't imagine how they arn't reproducing it unless they arn't using a UNIX server.

Out of curiousity, what is the OS of your server? Mine is running on SCO.

|||

In case anyone else runs into the situation where the FTP Task will not delete files from Unix FTP sites, I have been using the following as a work-around. I'm using it in a For Each loop to delete individual files on each pass, but it could be modified to delete wild-cards. The first step is to create a Script Task and set the read-only variables to the following (in my package most of these are coming from a Package Configurations file and are mapped to local variables):

FTP_file_name, FTP_server, FTP_root, FTP_port, FTP_username, FTP_password

Then use the following code within the Script Task:

' Microsoft SQL Server Integration Services Script Task
' Write scripts using Microsoft Visual Basic
' The ScriptMain class is the entry point of the Script Task.

Imports System
Imports System.Data
Imports System.Math
Imports System.Net
Imports Microsoft.SqlServer.Dts.Runtime

Public Class ScriptMain

' The execution engine calls this method when the task executes.
' To access the object model, use the Dts object. Connections, variables, events,
' and logging features are available as static members of the Dts class.
' Before returning from this method, set the value of Dts.TaskResult to indicate success or failure.
'
' To open Code and Text Editor Help, press F1.
' To open Object Browser, press Ctrl+Alt+J.

Public Sub Main()

Dts.TaskResult = Dts.Results.Success

Try

If FileExists(Dts.Variables("FTP_file_name").Value.ToString) Then
DeleteFile(Dts.Variables("FTP_file_name").Value.ToString)
End If

'Dts.Events.FireWarning(0, "Done", Dts.Variables("FTP_file_name").Value.ToString, String.Empty, 0)

Catch ex As Exception
Dts.Events.FireWarning(0, "Exception", "Message: " & ex.Message & vbCrLf & vbCrLf & "Stack: " & ex.StackTrace, String.Empty, 0)
Dts.TaskResult = Dts.Results.Failure
End Try

End Sub

Private Function FileExists(ByVal fileName As String) As Boolean

Dim retVal As Boolean = False
Dim remoteServer As String = Dts.Variables("FTP_server").Value.ToString
Dim remotePath As String = Dts.Variables("FTP_root").Value.ToString + fileName

Try

Dim fWebRequest As FtpWebRequest = CreateWebRequest(WebRequestMethods.Ftp.GetFileSize, remoteServer, remotePath)
Dim fWebResponse As FtpWebResponse = CType(fWebRequest.GetResponse(), FtpWebResponse)

If fWebResponse.StatusCode = FtpStatusCode.FileStatus Then
retVal = True
End If

Catch ex As WebException
If CType(ex.Response, FtpWebResponse).StatusCode <> FtpStatusCode.ActionNotTakenFileUnavailable Then
Dts.Events.FireWarning(0, "WebException", "Status Code: " & CType(ex.Response, FtpWebResponse).StatusCode & " Status Description: " & CType(ex.Response, FtpWebResponse).StatusDescription & " Message: " & ex.Message & " Stack: " & ex.StackTrace, String.Empty, 0)
End If
End Try

Return retVal

End Function

Private Sub DeleteFile(ByVal fileName As String)

Dim remoteServer As String = Dts.Variables("FTP_server").Value.ToString
Dim remotePath As String = Dts.Variables("FTP_root").Value.ToString + fileName

Try

Dim fWebRequest As FtpWebRequest = CreateWebRequest(WebRequestMethods.Ftp.DeleteFile, remoteServer, remotePath)
Dim fWebResponse As FtpWebResponse = CType(fWebRequest.GetResponse(), FtpWebResponse)

Dts.Events.FireWarning(0, "DeletedFile " & remotePath, "Status Code: " & fWebResponse.StatusCode & " Status Description: " & fWebResponse.StatusDescription, String.Empty, 0)

Catch ex As WebException
Dts.Events.FireWarning(0, "WebException", "Status Code: " & CType(ex.Response, FtpWebResponse).StatusCode & " Status Description: " & CType(ex.Response, FtpWebResponse).StatusDescription & " Message: " & ex.Message & " Stack: " & ex.StackTrace, String.Empty, 0)
End Try

End Sub

Private Function CreateWebRequest(ByVal method As String, ByVal uriHost As String, ByVal uriPath As String) As FtpWebRequest

Dim uBuilder As UriBuilder = New UriBuilder()

uBuilder.Scheme = Uri.UriSchemeFtp
uBuilder.Host = uriHost
uBuilder.Path = uriPath
uBuilder.Port = DirectCast(Dts.Variables("FTP_port").Value, Int32)

Dim fWebRequest As FtpWebRequest = CType(FtpWebRequest.Create(uBuilder.Uri), FtpWebRequest)

fWebRequest.Method = method
fWebRequest.UseBinary = False
fWebRequest.KeepAlive = False
fWebRequest.Timeout = -1
fWebRequest.Proxy = Nothing
fWebRequest.Credentials = New NetworkCredential(Dts.Variables("FTP_username").Value.ToString, Dts.Variables("FTP_password").Value.ToString)

Return fWebRequest

End Function

End Class

|||Has anyone from MS looked at this issue? I'm seeing it as well - seems like an error when attempting to delete multiple files via the FTP task.

[Connection manager "FTP"] Error: An error occurred in the requested FTP operation. Detailed error description: 550 \\results47747.zip: No such file or directory The attempt to delete file "\\results47747.zip" failed. This may occur when the file does not exist, the file name was spelled incorrectly, or you do not have permissions to delete the file. 550 \\test_10_16_2006.zip: No such file or directory The attempt to delete file "\\test_10_16_2006.zip" failed. This may occur when the file does not exist, the file name was spelled incorrectly, or you do not have permissions to delete the file. .|||

Still this script is not helping as its throwing exception back... Has anyone found other workaround please?

Regards,
paddy

|||Paddy -
I used a script fairly similar to the one above to work around this issue - what's the exception you're seeing?

Arjun|||

Hello Arjun,

I recieved the error 550 No such file or directory or do not have permissions but the same account works fine when used some client FTP software like SmartFTP and able to delete the files from there...

Thanks,
paddy

sql

FTP Task - Delete remote files always fails

Hello,

I have two FTP Tasks configured in my SSIS package. One is for "Receive files" and the other is set for "Delete remote files." Both use variables for the source/destination paths. My remote path variable contains a wild card in the name field such as /usr/this/is/my/path/*.ext and it is working to FTP all the .ext files to my working directory. I then rename the files and want to remove the original files from the FTP server. I use the same variable as the remote path variable in the delete as I do in the receive.

Using the same FTP connection manager for both tasks I am always getting a failure on the delete. The FTP connection manger is setup to use the root user. Using a terminal I am able to open an FTP connection to the server and remove the files manually. There doesn't seem to be any detailed documentation on the FTP Task configured for Delete remote files so I'm hoping someone might have some insight to the problem.

I receive the same message for each of the files that was downloaded:

Error: 0xC001602A at MyPackage, Connection manager "FTP Connection Manager": An error occurred in the requested FTP operation. Detailed error description: 550 \usr\this\is\my\path\datafile1.ext: No such file or directory.

The attempt to delete file "\usr\this\is\my\path\datafile1.ext" failed. This may occur when the file does not exist, the file name was spelled incorrectly, or you do not have permissions to delete the file.

With the root user/working manually I'm not understanding the permission reason, the file does exist and is spelled correctly.

Dan

Has anyone been able to remotly delete mutliple files? I'm convinced this isn't an ftp permission error as I can ftp using the same credentials in an ftp session and issue a del command to each of the files that is listed in the Output. Each one deletes.

I see there is one other unanswered post about a problem remotly deleting a file, but no answers.

|||

I am experiencing a similar problem and have not found a resolution. In my situation I am able to successfully delete files from Windows FTP servers but have not been able to delete files from Unix FTP servers. I know that this is not a permissions problem because I can go through any number of other FTP clients and delete files without a problem from both servers. I also have no problems downloading files from either the Windows or Unix FTP servers.

Any suggestions or other information would be welcome.

|||

I submitted a bug to the product feedback center. If you want to vote on it/add a comment to perhaps start getting a little more visability for this.

http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=4cd7df40-bf26-41b0-835b-3369db79284b

I was able to find a workaround for my situation. I was also able to access the directory via a Samba share. So using the full UNC path to the directory I was able to use a Foreach file in directory loop with a FileSystemTask to delete the files. It runs pretty quick too. Obviously I can't compare the speed with the FTP task though.

As an FYI, my CIO had mentioned to me that he thinks he had the same problem with DTS. By the time I started working here I just adopted his custom script to perform the FTP so I never really tried it myself on DTS.

|||

Were you able to delete a single file using the FTP Task without using a wildcard?

Donald Farmer

|||

I setup a simple package with just the FTP Task and a variable to just one file (no wildcard).

SSIS package "Package.dtsx" starting.

Error: 0xC001602A at Package, Connection manager "FTP Connection Manager": An error occurred in the requested FTP operation. Detailed error description: 550 \usr\my\path\tmp\test1.dts: No such file or directory.

The attempt to delete file "\usr\my\path\tmp\test1.dts" failed. This may occur when the file does not exist, the file name was spelled incorrectly, or you do not have permissions to delete the file.

.

Error: 0xC002918E at FTP Task, FTP Task: Unable to delete remote files using "FTP Connection Manager".

Task failed: FTP Task

Warning: 0x80019002 at Package: The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.

SSIS package "Package.dtsx" finished: Failure.

|||

I am getting exactly the same problem,

howerver this was part of my investigation of why I can FTP recieve files in development but the same task fails when run thru' sql agent.

any help on either will be appreciated.

Terry

|||

What is your error? How are you saving the connection information in the package (Package ProtectionLevel)? Are you using Configurations?

|||MS has closed this bug saying they cannot reproduce the error. If they require proof, I can provide them with a server and a SSIS package that reproduces this error. I have an FTP site that can be made available to them, and a SQL server with the SSIS package they can run.

Jarret|||

Well I hope they might consider your offer. I unfortunatly can't expose my ftp server to the internet. I really can't imagine how they arn't reproducing it unless they arn't using a UNIX server.

Out of curiousity, what is the OS of your server? Mine is running on SCO.

|||

In case anyone else runs into the situation where the FTP Task will not delete files from Unix FTP sites, I have been using the following as a work-around. I'm using it in a For Each loop to delete individual files on each pass, but it could be modified to delete wild-cards. The first step is to create a Script Task and set the read-only variables to the following (in my package most of these are coming from a Package Configurations file and are mapped to local variables):

FTP_file_name, FTP_server, FTP_root, FTP_port, FTP_username, FTP_password

Then use the following code within the Script Task:

' Microsoft SQL Server Integration Services Script Task
' Write scripts using Microsoft Visual Basic
' The ScriptMain class is the entry point of the Script Task.

Imports System
Imports System.Data
Imports System.Math
Imports System.Net
Imports Microsoft.SqlServer.Dts.Runtime

Public Class ScriptMain

' The execution engine calls this method when the task executes.
' To access the object model, use the Dts object. Connections, variables, events,
' and logging features are available as static members of the Dts class.
' Before returning from this method, set the value of Dts.TaskResult to indicate success or failure.
'
' To open Code and Text Editor Help, press F1.
' To open Object Browser, press Ctrl+Alt+J.

Public Sub Main()

Dts.TaskResult = Dts.Results.Success

Try

If FileExists(Dts.Variables("FTP_file_name").Value.ToString) Then
DeleteFile(Dts.Variables("FTP_file_name").Value.ToString)
End If

'Dts.Events.FireWarning(0, "Done", Dts.Variables("FTP_file_name").Value.ToString, String.Empty, 0)

Catch ex As Exception
Dts.Events.FireWarning(0, "Exception", "Message: " & ex.Message & vbCrLf & vbCrLf & "Stack: " & ex.StackTrace, String.Empty, 0)
Dts.TaskResult = Dts.Results.Failure
End Try

End Sub

Private Function FileExists(ByVal fileName As String) As Boolean

Dim retVal As Boolean = False
Dim remoteServer As String = Dts.Variables("FTP_server").Value.ToString
Dim remotePath As String = Dts.Variables("FTP_root").Value.ToString + fileName

Try

Dim fWebRequest As FtpWebRequest = CreateWebRequest(WebRequestMethods.Ftp.GetFileSize, remoteServer, remotePath)
Dim fWebResponse As FtpWebResponse = CType(fWebRequest.GetResponse(), FtpWebResponse)

If fWebResponse.StatusCode = FtpStatusCode.FileStatus Then
retVal = True
End If

Catch ex As WebException
If CType(ex.Response, FtpWebResponse).StatusCode <> FtpStatusCode.ActionNotTakenFileUnavailable Then
Dts.Events.FireWarning(0, "WebException", "Status Code: " & CType(ex.Response, FtpWebResponse).StatusCode & " Status Description: " & CType(ex.Response, FtpWebResponse).StatusDescription & " Message: " & ex.Message & " Stack: " & ex.StackTrace, String.Empty, 0)
End If
End Try

Return retVal

End Function

Private Sub DeleteFile(ByVal fileName As String)

Dim remoteServer As String = Dts.Variables("FTP_server").Value.ToString
Dim remotePath As String = Dts.Variables("FTP_root").Value.ToString + fileName

Try

Dim fWebRequest As FtpWebRequest = CreateWebRequest(WebRequestMethods.Ftp.DeleteFile, remoteServer, remotePath)
Dim fWebResponse As FtpWebResponse = CType(fWebRequest.GetResponse(), FtpWebResponse)

Dts.Events.FireWarning(0, "DeletedFile " & remotePath, "Status Code: " & fWebResponse.StatusCode & " Status Description: " & fWebResponse.StatusDescription, String.Empty, 0)

Catch ex As WebException
Dts.Events.FireWarning(0, "WebException", "Status Code: " & CType(ex.Response, FtpWebResponse).StatusCode & " Status Description: " & CType(ex.Response, FtpWebResponse).StatusDescription & " Message: " & ex.Message & " Stack: " & ex.StackTrace, String.Empty, 0)
End Try

End Sub

Private Function CreateWebRequest(ByVal method As String, ByVal uriHost As String, ByVal uriPath As String) As FtpWebRequest

Dim uBuilder As UriBuilder = New UriBuilder()

uBuilder.Scheme = Uri.UriSchemeFtp
uBuilder.Host = uriHost
uBuilder.Path = uriPath
uBuilder.Port = DirectCast(Dts.Variables("FTP_port").Value, Int32)

Dim fWebRequest As FtpWebRequest = CType(FtpWebRequest.Create(uBuilder.Uri), FtpWebRequest)

fWebRequest.Method = method
fWebRequest.UseBinary = False
fWebRequest.KeepAlive = False
fWebRequest.Timeout = -1
fWebRequest.Proxy = Nothing
fWebRequest.Credentials = New NetworkCredential(Dts.Variables("FTP_username").Value.ToString, Dts.Variables("FTP_password").Value.ToString)

Return fWebRequest

End Function

End Class

|||Has anyone from MS looked at this issue? I'm seeing it as well - seems like an error when attempting to delete multiple files via the FTP task.

[Connection manager "FTP"] Error: An error occurred in the requested FTP operation. Detailed error description: 550 \\results47747.zip: No such file or directory The attempt to delete file "\\results47747.zip" failed. This may occur when the file does not exist, the file name was spelled incorrectly, or you do not have permissions to delete the file. 550 \\test_10_16_2006.zip: No such file or directory The attempt to delete file "\\test_10_16_2006.zip" failed. This may occur when the file does not exist, the file name was spelled incorrectly, or you do not have permissions to delete the file. .|||

Still this script is not helping as its throwing exception back... Has anyone found other workaround please?

Regards,
paddy

|||Paddy -
I used a script fairly similar to the one above to work around this issue - what's the exception you're seeing?

Arjun|||

Hello Arjun,

I recieved the error 550 No such file or directory or do not have permissions but the same account works fine when used some client FTP software like SmartFTP and able to delete the files from there...

Thanks,
paddy

FTP Task - Delete remote files always fails

Hello,

I have two FTP Tasks configured in my SSIS package. One is for "Receive files" and the other is set for "Delete remote files." Both use variables for the source/destination paths. My remote path variable contains a wild card in the name field such as /usr/this/is/my/path/*.ext and it is working to FTP all the .ext files to my working directory. I then rename the files and want to remove the original files from the FTP server. I use the same variable as the remote path variable in the delete as I do in the receive.

Using the same FTP connection manager for both tasks I am always getting a failure on the delete. The FTP connection manger is setup to use the root user. Using a terminal I am able to open an FTP connection to the server and remove the files manually. There doesn't seem to be any detailed documentation on the FTP Task configured for Delete remote files so I'm hoping someone might have some insight to the problem.

I receive the same message for each of the files that was downloaded:

Error: 0xC001602A at MyPackage, Connection manager "FTP Connection Manager": An error occurred in the requested FTP operation. Detailed error description: 550 \usr\this\is\my\path\datafile1.ext: No such file or directory.

The attempt to delete file "\usr\this\is\my\path\datafile1.ext" failed. This may occur when the file does not exist, the file name was spelled incorrectly, or you do not have permissions to delete the file.

With the root user/working manually I'm not understanding the permission reason, the file does exist and is spelled correctly.

Dan

Has anyone been able to remotly delete mutliple files? I'm convinced this isn't an ftp permission error as I can ftp using the same credentials in an ftp session and issue a del command to each of the files that is listed in the Output. Each one deletes.

I see there is one other unanswered post about a problem remotly deleting a file, but no answers.

|||

I am experiencing a similar problem and have not found a resolution. In my situation I am able to successfully delete files from Windows FTP servers but have not been able to delete files from Unix FTP servers. I know that this is not a permissions problem because I can go through any number of other FTP clients and delete files without a problem from both servers. I also have no problems downloading files from either the Windows or Unix FTP servers.

Any suggestions or other information would be welcome.

|||

I submitted a bug to the product feedback center. If you want to vote on it/add a comment to perhaps start getting a little more visability for this.

http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=4cd7df40-bf26-41b0-835b-3369db79284b

I was able to find a workaround for my situation. I was also able to access the directory via a Samba share. So using the full UNC path to the directory I was able to use a Foreach file in directory loop with a FileSystemTask to delete the files. It runs pretty quick too. Obviously I can't compare the speed with the FTP task though.

As an FYI, my CIO had mentioned to me that he thinks he had the same problem with DTS. By the time I started working here I just adopted his custom script to perform the FTP so I never really tried it myself on DTS.

|||

Were you able to delete a single file using the FTP Task without using a wildcard?

Donald Farmer

|||

I setup a simple package with just the FTP Task and a variable to just one file (no wildcard).

SSIS package "Package.dtsx" starting.

Error: 0xC001602A at Package, Connection manager "FTP Connection Manager": An error occurred in the requested FTP operation. Detailed error description: 550 \usr\my\path\tmp\test1.dts: No such file or directory.

The attempt to delete file "\usr\my\path\tmp\test1.dts" failed. This may occur when the file does not exist, the file name was spelled incorrectly, or you do not have permissions to delete the file.

.

Error: 0xC002918E at FTP Task, FTP Task: Unable to delete remote files using "FTP Connection Manager".

Task failed: FTP Task

Warning: 0x80019002 at Package: The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.

SSIS package "Package.dtsx" finished: Failure.

|||

I am getting exactly the same problem,

howerver this was part of my investigation of why I can FTP recieve files in development but the same task fails when run thru' sql agent.

any help on either will be appreciated.

Terry

|||

What is your error? How are you saving the connection information in the package (Package ProtectionLevel)? Are you using Configurations?

|||MS has closed this bug saying they cannot reproduce the error. If they require proof, I can provide them with a server and a SSIS package that reproduces this error. I have an FTP site that can be made available to them, and a SQL server with the SSIS package they can run.

Jarret
|||

Well I hope they might consider your offer. I unfortunatly can't expose my ftp server to the internet. I really can't imagine how they arn't reproducing it unless they arn't using a UNIX server.

Out of curiousity, what is the OS of your server? Mine is running on SCO.

|||

In case anyone else runs into the situation where the FTP Task will not delete files from Unix FTP sites, I have been using the following as a work-around. I'm using it in a For Each loop to delete individual files on each pass, but it could be modified to delete wild-cards. The first step is to create a Script Task and set the read-only variables to the following (in my package most of these are coming from a Package Configurations file and are mapped to local variables):

FTP_file_name, FTP_server, FTP_root, FTP_port, FTP_username, FTP_password

Then use the following code within the Script Task:

' Microsoft SQL Server Integration Services Script Task
' Write scripts using Microsoft Visual Basic
' The ScriptMain class is the entry point of the Script Task.

Imports System
Imports System.Data
Imports System.Math
Imports System.Net
Imports Microsoft.SqlServer.Dts.Runtime

Public Class ScriptMain

' The execution engine calls this method when the task executes.
' To access the object model, use the Dts object. Connections, variables, events,
' and logging features are available as static members of the Dts class.
' Before returning from this method, set the value of Dts.TaskResult to indicate success or failure.
'
' To open Code and Text Editor Help, press F1.
' To open Object Browser, press Ctrl+Alt+J.

Public Sub Main()

Dts.TaskResult = Dts.Results.Success

Try

If FileExists(Dts.Variables("FTP_file_name").Value.ToString) Then
DeleteFile(Dts.Variables("FTP_file_name").Value.ToString)
End If

'Dts.Events.FireWarning(0, "Done", Dts.Variables("FTP_file_name").Value.ToString, String.Empty, 0)

Catch ex As Exception
Dts.Events.FireWarning(0, "Exception", "Message: " & ex.Message & vbCrLf & vbCrLf & "Stack: " & ex.StackTrace, String.Empty, 0)
Dts.TaskResult = Dts.Results.Failure
End Try

End Sub

Private Function FileExists(ByVal fileName As String) As Boolean

Dim retVal As Boolean = False
Dim remoteServer As String = Dts.Variables("FTP_server").Value.ToString
Dim remotePath As String = Dts.Variables("FTP_root").Value.ToString + fileName

Try

Dim fWebRequest As FtpWebRequest = CreateWebRequest(WebRequestMethods.Ftp.GetFileSize, remoteServer, remotePath)
Dim fWebResponse As FtpWebResponse = CType(fWebRequest.GetResponse(), FtpWebResponse)

If fWebResponse.StatusCode = FtpStatusCode.FileStatus Then
retVal = True
End If

Catch ex As WebException
If CType(ex.Response, FtpWebResponse).StatusCode <> FtpStatusCode.ActionNotTakenFileUnavailable Then
Dts.Events.FireWarning(0, "WebException", "Status Code: " & CType(ex.Response, FtpWebResponse).StatusCode & " Status Description: " & CType(ex.Response, FtpWebResponse).StatusDescription & " Message: " & ex.Message & " Stack: " & ex.StackTrace, String.Empty, 0)
End If
End Try

Return retVal

End Function

Private Sub DeleteFile(ByVal fileName As String)

Dim remoteServer As String = Dts.Variables("FTP_server").Value.ToString
Dim remotePath As String = Dts.Variables("FTP_root").Value.ToString + fileName

Try

Dim fWebRequest As FtpWebRequest = CreateWebRequest(WebRequestMethods.Ftp.DeleteFile, remoteServer, remotePath)
Dim fWebResponse As FtpWebResponse = CType(fWebRequest.GetResponse(), FtpWebResponse)

Dts.Events.FireWarning(0, "DeletedFile " & remotePath, "Status Code: " & fWebResponse.StatusCode & " Status Description: " & fWebResponse.StatusDescription, String.Empty, 0)

Catch ex As WebException
Dts.Events.FireWarning(0, "WebException", "Status Code: " & CType(ex.Response, FtpWebResponse).StatusCode & " Status Description: " & CType(ex.Response, FtpWebResponse).StatusDescription & " Message: " & ex.Message & " Stack: " & ex.StackTrace, String.Empty, 0)
End Try

End Sub

Private Function CreateWebRequest(ByVal method As String, ByVal uriHost As String, ByVal uriPath As String) As FtpWebRequest

Dim uBuilder As UriBuilder = New UriBuilder()

uBuilder.Scheme = Uri.UriSchemeFtp
uBuilder.Host = uriHost
uBuilder.Path = uriPath
uBuilder.Port = DirectCast(Dts.Variables("FTP_port").Value, Int32)

Dim fWebRequest As FtpWebRequest = CType(FtpWebRequest.Create(uBuilder.Uri), FtpWebRequest)

fWebRequest.Method = method
fWebRequest.UseBinary = False
fWebRequest.KeepAlive = False
fWebRequest.Timeout = -1
fWebRequest.Proxy = Nothing
fWebRequest.Credentials = New NetworkCredential(Dts.Variables("FTP_username").Value.ToString, Dts.Variables("FTP_password").Value.ToString)

Return fWebRequest

End Function

End Class

|||Has anyone from MS looked at this issue? I'm seeing it as well - seems like an error when attempting to delete multiple files via the FTP task.

[Connection manager "FTP"] Error: An error occurred in the requested FTP operation. Detailed error description: 550 \\results47747.zip: No such file or directory The attempt to delete file "\\results47747.zip" failed. This may occur when the file does not exist, the file name was spelled incorrectly, or you do not have permissions to delete the file. 550 \\test_10_16_2006.zip: No such file or directory The attempt to delete file "\\test_10_16_2006.zip" failed. This may occur when the file does not exist, the file name was spelled incorrectly, or you do not have permissions to delete the file. .
|||

Still this script is not helping as its throwing exception back... Has anyone found other workaround please?

Regards,
paddy

|||Paddy -
I used a script fairly similar to the one above to work around this issue - what's the exception you're seeing?

Arjun
|||

Hello Arjun,

I recieved the error 550 No such file or directory or do not have permissions but the same account works fine when used some client FTP software like SmartFTP and able to delete the files from there...

Thanks,
paddy

FTP Problem

Afternoon...

I am trying to create an SSIS ftp task and can't even get a test connection to succeed.

I am behind a firewall and using a proxy...is it possible that is my problem? If so, is there a work-around?

TIA

Tena

The firewall and/or proxy are quite probably the issue. Talk to you IT/network support in the first instance and see what the options are for you getting access to FTP outside the LAN. This will determine how you configure the task.|||Probably too obvious to be the problem but I found that unless I prefix the user name with the domain (as in DDDDDD\UUUUUUU where d indicates the domain and U indicates the user name) then I couldn't get a test connection to succeed either. But, if you are an AD user in a domain trying to get to a ftp server that is not open to anonymous access, etc. in the domain, it might be worth checkiing.

FTP guaranteed delivery

Hi,

I'm new to SSIS but have been using BizTalk for a while. My question is, if the FTP task in SSIS ensures guranteed delivery of the files transferred. I know that in BTS, potnetially you can start processing incomplete files (unless you set the staging, temp folder). Can this be a problem in SSIS FTP transfer? I'll be dealing with very large files (5 gigs in some cases) transfers via FTP, on an unreliable network in my project, which means that the file can be partially transferred when the connection breaks down.

I need to know, if in SSIS

(1) FTP task supports partial transfers, and then resuming the download/ upload of these files from point of failure, when the network is again available (Regets, Reputs)?

(2) If EOF is received, before the rest of data is received, especially in the case if 1) is supported, then does FTP task believe that whole file is received or will it wait for the rest of content, before task completion?

I'll appreciate if someone can answer these and can also send me the details of FTP implementation in SSIS

Thanks,

Ali Shahzad

Ali Shahzad wrote:

I need to know, if in SSIS

(1) FTP task supports partial transfers, and then resuming the download/ upload of these files from point of failure, when the network is again available (Regets, Reputs)?

No, that won't happen

Ali Shahzad wrote:

(2) If EOF is received, before the rest of data is received, especially in the case if 1) is supported, then does FTP task believe that whole file is received or will it wait for the rest of content, before task completion?

I don't know the answer to that one I'm afraid.

-Jamie

sql

ftp Failure

I have designed an SSIS that needs to download a set of files via ftp. The ftp is working fine under Business Studio. When I move it to The server and try runing the package I'm getting the following errors:

Error: Unable to connect to FTP server using "FTP Server"

Error: An error occurred in the requested FTP operation. Detailed error description: The password was not allowed.

This is not my first FTP in SSIS, so I also have the following item set:

Protectionlevel = EncryptProtectedWithPassword

I have several other FTP packages that go to the exact same server, with the exact same user ID and password that are working.

What am I missing?

Since noone is responding...

I also tried changing the protection level to "DontSaveEncrypted" and set up a package configuration with the password in it. I thought this would work, but I'm still getting the same messages.

|||This is an FTP server error, not an SSIS related error.

Search the Internet for "The password was not allowed." for discussions on this message.|||

Thanks for replying Phil.

If this is an FTP server error, why does it work in one package, but not in another that's using the exact same connection?

And why does it work in SSIS designer?

FTP Download Task (with Overwrite) doesn't overwrite!!!!!!!!!!

Error with SSIS FTP download task:

How to recreate the error:

    Download a file using the task.

    Go to the file in Windows Exploder and Open the file in notepad.

    Copy the last line of text and paste in a few extra rows at the bottom. So if you had 100 rows, you'll now have 103 rows.

    Save the file.

    Go back to the task and make sure you have "overwrite destination" set to True.

    Execute the task.

    Go back to the file and look at the bottom of the file. You'll see the same 3 extra rows you pasted in there.

That is not how it should work if it was supposed to be released like that.

Are there any patches that fix this error?

Ryan

I just confirmed Ryan's observations.

VS 2005 - 8.0.50727.42
SSIS - 9.00.2047.00

This looks like it's fixed and will be available in the next release.

https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=126467|||You might want to, in the interim, use a File System task to delete the file before going to the FTP task.

Phil|||

Yep. Got it, thanks!

Appreciate the feedback link. That's cool.

FTP Delete task in SQL agent

I have a FTP task created using SSIS that need to delete lot of files in a directory. This task is working fine if I'm Executing the SSIS package manualy but not working if I'm scheduling the SSIS package in SQL agent job.
Anybody have faced this kind if situation is there any solution for this?.

have you gotten a resolution on this problem? I am having the same issue on a FTP send task and it works fine when I run it manually but it bombs out when I schedule it.

Let me know... Thanks

|||

Error messages really help in these situations guys.

-Jamie

|||

I actually found the answer for my problem here:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=356558&SiteID=1

I just made the protection level to "DontSaveSensitive" and when the SQL Server agent ran the package it ran properly.

Hope it helps :)

Monday, March 26, 2012

FTP authentication information does not persist when deploying packages

I am trying to deploy a SSIS package which includes a FTP task. It works fine on the machine it was developed . When deploying the package on a production server, all other config changes work, but the FTP task is failing, with authentication error.

any help on how to persist the data would be appreciated

thanks

Maybe it's because the password was stored encrypted and couldn't be decrypted on the new machine... This is quite common and happens often when moving a package from machine to machine.

As far as I know you can get around this by using package passwords instead of the normal encryption. You can also save a package without encryption (what is not recommended...) or use a configuration to push the password back into the package i.e. using an XML file (but then the password is unencrypted in the XML)...

Wednesday, March 21, 2012

Fromatting excel column

Hi,

I have an excel export with numeric values. When the SSIS package writes into the excel it treats all data types as strings and attaches an apostrophe in the beginning. I tried formatting the excel sheet with the number data type and saving it . It doesnt work.

Other strange thing is that when I go into the advanced editor for the excel destination and look into the properties of the external columns all of them have the data type as Unicode String[DT_WSTR] irrespective of what the data type is from the input.The UI allows me to change it to numeric for numeric columns without any error but the value is not saved at all which is very frustrating. I also tried changing it in the xml file of the package, it some how seems to overwrite it after validation. It would be really nice if it threw an error saying that it cannot be changed.

Anyways there seems to be no way of changing the destination data type if it s an existing file and if I create a new excel sheet there is no way of formatting data. Is there any way out?

Thanks

Interesting report on the behavior your seeing. My experience was quite the opposite when working with an Excel import package.

I found the Excel connector to be VERY tightly bound to the defined data types within the actual Excel file. I also found that it seemed to determine the type by the top few rows and not necessarily by the whole data set.|||chandrala's issues are with an Excel destination, not a source though.|||Ya my issue is with destination if I create a new excel file or if I already have an excel file it doesnt matter. It is kind of dumb to expect that the file already has to have some data before the export to determine the type. Most exports are into an unpopulated file. Please let me know how to tackle this.|||I'm having the same issue. Anyone come up with a resolution?|||On the destination connection, I had first row has column names. Set this to no, and everything worked.|||

Grant Mackay wrote:

On the destination connection, I had first row has column names. Set this to no, and everything worked.

This make sense as SSIS try to guess the data type based on the first values of the column. If you have the column names in you first row; then SSIS will treat it as String; which be correct. May that be your problem?

I also found few trheads taking about data conversition when excel is the destination:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=64475&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=193526&SiteID=1

Fromatting excel column

Hi,

I have an excel export with numeric values. When the SSIS package writes into the excel it treats all data types as strings and attaches an apostrophe in the beginning. I tried formatting the excel sheet with the number data type and saving it . It doesnt work.

Other strange thing is that when I go into the advanced editor for the excel destination and look into the properties of the external columns all of them have the data type as Unicode String[DT_WSTR] irrespective of what the data type is from the input.The UI allows me to change it to numeric for numeric columns without any error but the value is not saved at all which is very frustrating. I also tried changing it in the xml file of the package, it some how seems to overwrite it after validation. It would be really nice if it threw an error saying that it cannot be changed.

Anyways there seems to be no way of changing the destination data type if it s an existing file and if I create a new excel sheet there is no way of formatting data. Is there any way out?

Thanks

Interesting report on the behavior your seeing. My experience was quite the opposite when working with an Excel import package.

I found the Excel connector to be VERY tightly bound to the defined data types within the actual Excel file. I also found that it seemed to determine the type by the top few rows and not necessarily by the whole data set.|||chandrala's issues are with an Excel destination, not a source though.|||Ya my issue is with destination if I create a new excel file or if I already have an excel file it doesnt matter. It is kind of dumb to expect that the file already has to have some data before the export to determine the type. Most exports are into an unpopulated file. Please let me know how to tackle this.|||I'm having the same issue. Anyone come up with a resolution?|||On the destination connection, I had first row has column names. Set this to no, and everything worked.|||

Grant Mackay wrote:

On the destination connection, I had first row has column names. Set this to no, and everything worked.

This make sense as SSIS try to guess the data type based on the first values of the column. If you have the column names in you first row; then SSIS will treat it as String; which be correct. May that be your problem?

I also found few trheads taking about data conversition when excel is the destination:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=64475&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=193526&SiteID=1

sql

Monday, March 19, 2012

from AdventureWorks to AdventureWorksDW

AdventureWorks and AdventureWorksDW are good samples for transaction and dw.

Is there any sample of SSIS package to load data from AdventureWorks to AdventureWorksDW? For example, I'd like to update AdventureWorksDW db everyday from transaction db.

How about if some dimensions changed, like employees, and productions?

Thanks!

-Z

Project REAL has examples.

http://www.microsoft.com/sql/solutions/bi/projectreal.mspx|||

Phil Brammer wrote:

Project REAL has examples.

http://www.microsoft.com/sql/solutions/bi/projectreal.mspx

Phil,

Does it have examples of using AdventureWorks though? I didn't think so. I admit I haven't looked at the Project REALstuff in too much detail.

-Jamie

|||Z,
Project REAL doesn't go against AWDW, but the concepts would be the same...

Another good resource (again not specific to AdventureWorks) is the Ralph Kimball Group Webcast.

Here are some tutorials (have you looked at MSDN at all?) from Microsoft that are against AWDW.|||

Hi, Phil,

Thanks much for your quick response. It helps a lot!

BTW,

Do you happen to know if there is any sample for the daily changes from DW to SSAS?

-Z

|||

ZZhang wrote:

BTW,

Do you happen to know if there is any sample for the daily changes from DW to SSAS?

-Z

That I cannot help with! That's out of my knowledge area!|||I am looking for advetureworkdb to advetureworkdw plus full digram of advetureworkdw

from AdventureWorks to AdventureWorksDW

AdventureWorks and AdventureWorksDW are good samples for transaction and dw.

Is there any sample of SSIS package to load data from AdventureWorks to AdventureWorksDW? For example, I'd like to update AdventureWorksDW db everyday from transaction db.

How about if some dimensions changed, like employees, and productions?

Thanks!

-Z

Project REAL has examples.

http://www.microsoft.com/sql/solutions/bi/projectreal.mspx|||

Phil Brammer wrote:

Project REAL has examples.

http://www.microsoft.com/sql/solutions/bi/projectreal.mspx

Phil,

Does it have examples of using AdventureWorks though? I didn't think so. I admit I haven't looked at the Project REALstuff in too much detail.

-Jamie

|||Z,
Project REAL doesn't go against AWDW, but the concepts would be the same...

Another good resource (again not specific to AdventureWorks) is the Ralph Kimball Group Webcast.

Here are some tutorials (have you looked at MSDN at all?) from Microsoft that are against AWDW.|||

Hi, Phil,

Thanks much for your quick response. It helps a lot!

BTW,

Do you happen to know if there is any sample for the daily changes from DW to SSAS?

-Z

|||

ZZhang wrote:

BTW,

Do you happen to know if there is any sample for the daily changes from DW to SSAS?

-Z

That I cannot help with! That's out of my knowledge area!|||I am looking for advetureworkdb to advetureworkdw plus full digram of advetureworkdw