501 error when connecting to FTP from Windows Server

Highlighted
Six Stars

501 error when connecting to FTP from Windows Server

We have a Talend application that is being deployed from an AWS Windows server : the application runs fine up to the point it tries to connect to a FTP server:

 

Exception in component tFTPDelete_4 (CopiaArquivosFTPOn)
com.enterprisedt.net.ftp.FTPException: 501 Server cannot accept argument.
        at com.enterprisedt.net.ftp.FTPControlSocket.validateReply(FTPControlSocket.java:1308)
        at com.enterprisedt.net.ftp.FTPControlSocket.setDataPort(FTPControlSocket.java:861)
        at com.enterprisedt.net.ftp.FTPControlSocket.sendPORTCommand(FTPControlSocket.java:715)
        at com.enterprisedt.net.ftp.FTPControlSocket.createDataSocketActive(FTPControlSocket.java:662)
        at com.enterprisedt.net.ftp.FTPControlSocket.createDataSocket(FTPControlSocket.java:629)
        at com.enterprisedt.net.ftp.FTPClient.createDataSocket(FTPClient.java:2756)
        at com.enterprisedt.net.ftp.FTPClient.dir(FTPClient.java:3918)
        at com.enterprisedt.net.ftp.FTPClient.dir(FTPClient.java:4023)
        at com.enterprisedt.net.ftp.FTPClient.dirDetails(FTPClient.java:3837)

The application runs fine on any machine other than the windows server in question.

We have tried the following measures, not being able to revert the error:

1) Opening all inbound and outbound ports in the Windows firewall

2) Changing the FTP connection from Active to Passive mode

 

Not much information about this anywhere - any help is appreciated

 


Accepted Solutions
Six Stars

Re: 501 error when connecting to FTP from Windows Server

The solution to run Talend on a windows server was to set not only the FTP connection to passive mode but also define it as passive for each of the put, delete, list calls (there is an option at the bottom of these components).

 

Could not figure the reason as to why active mode fails even with all ports open (both on windows and AWS) : ftp calls are able to connect to the remote FTP server but any other command (list, put, delete) causes a 501 error and freezes the connection.

View solution in original post


All Replies
Six Stars

Re: 501 error when connecting to FTP from Windows Server

We were able to connect to the FTP server through 'This PC' -> 'Add Network Location' . The problem however persists

Employee

Re: 501 error when connecting to FTP from Windows Server

Hi,

 

   Could you please check the security Group port details for the Windows EC2 instance?

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

Six Stars

Re: 501 error when connecting to FTP from Windows Server

Connecting to the FTP server from the command prompt works as expected:

 

ftp xx.xx.xx.xx

220 Microsoft FTP Service
200 OPTS UTF8 command successful - UTF8 encoding now ON.

After inserting user & password:

230 User logged in.

Employee

Re: 501 error when connecting to FTP from Windows Server

Hi,

 

   Could you please use tFTPConnection and see whether connection is working properly from Talend. The issue could be because of some problem in tFTPDelete component. So lets first make sure that connection to FTP server is working fine in Talend, from the same machine in which connection was established through command line mode.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

 

 

Six Stars

Re: 501 error when connecting to FTP from Windows Server

Sure - I am forwarding the opened ports in my EC2 instance in the attachment. The windows server itself has all ports (inbound and outbound) opened, as shown in the second attachment.

 

I am able to connect with the ftp command - but the java code throws the error both for active/passive modes (even though it runs fine from my notebook).

 

No FTP servers are being run on the Windows Server - the error also persists after machine restart.

Employee

Re: 501 error when connecting to FTP from Windows Server

Hi,

 

   Thanks for the security group details. We can rule out that possibility (But please do not keep all the ports open for long time).

 

   Could you please create a new Talend job with only tFTPConnection and try to connect to the server after providing the credentials? Please run the job from the same machine where you were able to connect through FTP command.

 

    If the error persists, could you please share the screen shot of the job along with error details?

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

Six Stars

Re: 501 error when connecting to FTP from Windows Server

I have tried with a simpler job (attached) : the error remains the same

Six Stars

Re: 501 error when connecting to FTP from Windows Server

Sorry - the error message was not detailed as I had not checked 'die on error' . the complete message is in the attachment below

Employee

Re: 501 error when connecting to FTP from Windows Server

Hi,

 

   The issue seems to happen even without Talend when the connection is not in Passive mode (please refer below forums). But in your case, I could see that you are already selecting Passive mode.

 

https://forums.iis.net/t/1157854.aspx?FTP+501+server+cannot+accept+argument

https://www.experts-exchange.com/questions/28954708/Server-Cannot-Accept-Argument-In-FTP-Command.htm...

 

Since there is some limitation to check the issue real time, I would recommend to create support ticket for the issue so that Talend support team can connect with you through remote session.

 

If you are using a free version of Talend, could you please ask your network admins to check the details?

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

 

Six Stars

Re: 501 error when connecting to FTP from Windows Server

The solution to run Talend on a windows server was to set not only the FTP connection to passive mode but also define it as passive for each of the put, delete, list calls (there is an option at the bottom of these components).

 

Could not figure the reason as to why active mode fails even with all ports open (both on windows and AWS) : ftp calls are able to connect to the remote FTP server but any other command (list, put, delete) causes a 501 error and freezes the connection.

View solution in original post

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog