user3118593
user3118593

Reputation: 33

FTP to Tomcat 7 instance on azure returns 501 Server cannot accept Argument

I have setup a managed Tomcat 7 instance on azure. I need to be able to FTP a war file to the tomcat webapps folder from a Jenkins instance sitting on a different Azure virtual machine.

I can connect to the FTP server via filezilla and upload files manually but unfortunaly, when attempting to ftp a file through the command line I get the error "501 Server cannot accept Argument".

I have attempted this simple script from both the vm that my jenkins is on and my own machine and I get the same error.

open [domain]
user
password
cd /site/wwwroot/bin/apache-tomcat-7.0.52/webapps
put C:\test.txt
bye

Does anybody know why an FTP server on azure can be accessed via filezilla but not through the command line?

Upvotes: 3

Views: 1685

Answers (1)

Anti Veeranna
Anti Veeranna

Reputation: 11613

I hade the same problem.

The solution is - you have to switch your FTP client to passive mode:

ftp> ls
501 Server cannot accept argument.
ftp: bind: Address already in use
ftp> passive
Passive mode on.
ftp> ls
227 Entering Passive Mode (23,100,51,45,39,132).
125 Data connection already open; Transfer starting.
01-12-15  12:58AM             14501595 ROOT.war
226 Transfer complete.

I guess Filezilla is smart enough to switch to passive mode on its own, and that's why it works out of the box.

Upvotes: 2

Related Questions