Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
5.9k views
in Java FTP by (340 points)
Hi ,

Am facing problems intermittently on an FTP server wherein the get method of FTP Client throws a Malformed Reply Exception .


The error trace is as below .

com.enterprisedt.net.ftp.MalformedReplyException: Invalid reply code ' uc'
at com.enterprisedt.net.ftp.FTPReply.validateCode(FTPReply.java:178)
at com.enterprisedt.net.ftp.FTPReply.<init>(FTPReply.java:99)
at com.enterprisedt.net.ftp.FTPControlSocket.readReply(FTPControlSocket.java:1053)
at com.enterprisedt.net.ftp.FTPControlSocket.sendCommand(FTPControlSocket.java:921)
at com.enterprisedt.net.ftp.FTPControlSocket.createDataSocketPASV(FTPControlSocket.java:771)
at com.enterprisedt.net.ftp.FTPControlSocket.createDataSocket(FTPControlSocket.java:547)
at com.enterprisedt.net.ftp.FTPClient.setupDataSocket(FTPClient.java:2452)
at com.enterprisedt.net.ftp.FTPClient.initGet(FTPClient.java:2851)
at com.enterprisedt.net.ftp.FTPClient.getData(FTPClient.java:2911)
at com.enterprisedt.net.ftp.FTPClient.getFile(FTPClient.java:2751)
at com.enterprisedt.net.ftp.FTPClient.get(FTPClient.java:2170)

Can anyone tell me why this error is being thrown .

6 Answers

0 votes
by (340 points)
The problem does not occur all the time .

The FTP directory being passed to the get method is present on the server .
0 votes
by (162k points)
Please post the log file at DEBUG level. Not all of it, but the part showing the error ...
0 votes
by (340 points)
A similar error

2009-05-14 21:55:02 [RP-DistTaskExecutor-pool-Thread-11] [DEBUG] FTPSource$FTPSourceDistributionTask: Processed file:fnyl0302.pdf

2009-05-14 21:55:20 [RP-DistTaskExecutor-pool-Thread-11] [DEBUG] ---> PWD

2009-05-14 21:55:21 [RP-DistTaskExecutor-pool-Thread-11] [DEBUG] 257 "/crcftp-as1/apps/reports_new/disthub/CRCTESTING/UAT/GCOM2CRC/crcimis/archive"

2009-05-14 21:55:21 [RP-DistTaskExecutor-pool-Thread-11] [DEBUG] ---> CWD /crcftp-as1/apps/reports_new/disthub/CRCTESTING/UAT/GCOM2CRC/crcimis/archive/

2009-05-14 21:55:21 [RP-DistTaskExecutor-pool-Thread-11] [DEBUG] 250 Directory successfully changed.

2009-05-14 21:55:21 [RP-DistTaskExecutor-pool-Thread-11] [DEBUG] ---> PWD

2009-05-14 21:55:21 [RP-DistTaskExecutor-pool-Thread-11] [DEBUG] 257 "/crcftp-as1/apps/reports_new/disthub/CRCTESTING/UAT/GCOM2CRC/crcimis/archive"

2009-05-14 21:55:21 [RP-DistTaskExecutor-pool-Thread-11] [DEBUG] Attempt #1

2009-05-14 21:55:21 [RP-DistTaskExecutor-pool-Thread-11] [DEBUG] ---> PASV

2009-05-14 21:55:21 [RP-DistTaskExecutor-pool-Thread-11] [DEBUG] 227 Entering Passv Md6,6,

2009-05-14 21:55:22 [RP-DistTaskExecutor-pool-Thread-11] [DEBUG] 5 ccftp-as1app/ep_hub/CRCTESTINGU

2009-05-14 21:55:22 [RP-DistTaskExecutor-pool-Thread-11] [WARN] Validate transfer on error failed
com.enterprisedt.net.ftp.MalformedReplyException: Invalid reply code '5 c'
at com.enterprisedt.net.ftp.FTPReply.validateCode(FTPReply.java:178)
at com.enterprisedt.net.ftp.FTPReply.<init>(FTPReply.java:99)
at com.enterprisedt.net.ftp.FTPControlSocket.readReply(FTPControlSocket.java:1053)
at com.enterprisedt.net.ftp.FTPClient.validateTransfer(FTPClient.java:2347)
at com.enterprisedt.net.ftp.FTPClient.validateTransferOnError(FTPClient.java:2379)
at com.enterprisedt.net.ftp.FTPClient.putStream(FTPClient.java:2324)
at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2194)
at com.ml.gpb.distfrmw.connector.DFFTPClient.put(DFFTPClient.java:308)
at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2280)
at com.ml.gpb.distfrmw.connector.DFFTPClient.put(DFFTPClient.java:369)
at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2245)
at com.ml.gpb.distfrmw.connector.DFFTPClient.put(DFFTPClient.java:338)
at com.ml.gpb.distfrmw.filehandler.archiver.FTPArchiver.archiveFromLocalToRemote(FTPArchiver.java:56)
at com.ml.gpb.distfrmw.filehandler.archiver.Archiver.archiveFile(Archiver.java:78)
at com.ml.gpb.distfrmw.receiver.ArchivingBase.archiveFile(ArchivingBase.java:225)
at com.ml.gpb.distfrmw.receiver.Source.archiveAndCleanUp(Source.java:658)
at com.ml.gpb.distfrmw.receiver.FTPSource$FTPSourceDistributionTask.postDistributionTask(FTPSource.java:448)
at com.ml.gpb.distfrmw.core.DistributionTask.call(DistributionTask.java:129)
at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:178)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
at java.lang.Thread.run(Thread.java:568)


2009-05-14 21:55:22 [RP-DistTaskExecutor-pool-Thread-11] [DEBUG] Sleeping for 5000 ms prior to retry
0 votes
by (162k points)
You have something very strange going on. Here's what a normal reply to the PASV command looks like:

227 Entering Passive Mode (192,168,1,3,10,250).

You are getting:

227 Entering Passv Md6,6,

followed by

5 ccftp-as1app/ep_hub/CRCTESTINGU

That just isn't ever going to work, as the numbers in brackets are the IP address and port number to connect to.

Something is seriously wrong with your FTP server, or a firewall is messing with the reply packets. What happens when you use an FTP client like Filezilla?
0 votes
by (340 points)
Hi
I have even been getting sucecssful transfers too for many files. The errors are not continuously happening. They take place intermittently.

2009-05-15 04:40:57 [RP-DistTaskExecutor-pool-Thread-20] [DEBUG] FTPConnection: getConnection() - get from cache

2009-05-15 04:40:57 [RP-DistTaskExecutor-pool-Thread-20] [DEBUG] ---> PWD

2009-05-15 04:40:57 [RP-DistTaskExecutor-pool-Thread-20] [DEBUG] 257 "/crcftp-as1/apps/reports_new/disthub"

2009-05-15 04:40:57 [RP-DistTaskExecutor-pool-Thread-20] [DEBUG] ---> PWD

2009-05-15 04:40:57 [RP-DistTaskExecutor-pool-Thread-20] [DEBUG] 257 "/crcftp-as1/apps/reports_new/disthub"

2009-05-15 04:40:57 [RP-DistTaskExecutor-pool-Thread-20] [DEBUG] ---> CWD /crcftp-as1/apps/reports_new/disthub/CRCTESTING/UAT
/GCOM2CRC/crcistln2/

2009-05-15 04:40:57 [RP-DistTaskExecutor-pool-Thread-20] [DEBUG] 250 Directory successfully changed.


2009-05-15 04:40:57 [RP-DistTaskExecutor-pool-Thread-20] [DEBUG] ---> PASV

2009-05-15 04:40:57 [RP-DistTaskExecutor-pool-Thread-20] [DEBUG] 227 Entering Passive Mode (141,128,62,63,123,253)

2009-05-15 04:40:57 [RP-DistTaskExecutor-pool-Thread-20] [DEBUG] ---> STOR smt72114.2009.05.14.pdf

2009-05-15 04:40:57 [RP-DistTaskExecutor-pool-Thread-20] [DEBUG] 150 Ok to send data.

2009-05-15 04:40:57 [RP-DistTaskExecutor-pool-Thread-20] [DEBUG] Transferred 4026 bytes to remote host

2009-05-15 04:40:57 [RP-DistTaskExecutor-pool-Thread-20] [DEBUG] 226 File receive OK.

2009-05-15 04:40:57 [RP-DistTaskExecutor-pool-Thread-20] [DEBUG] FTPSender: Copied file smt72114.2009.05.14.pdf, to crcf
tp-as1-q.lvt.us.ml.com /crcftp-as1/apps/reports_new/disthub/CRCTESTING/UAT/GCOM2CRC/crcistln2/

2009-05-15 04:40:57 [RP-DistTaskExecutor-pool-Thread-20] [DEBUG] ---> CWD /crcftp-as1/apps/reports_new/disthub.

.
0 votes
by (162k points)
It looks like a server or possibly a router/firewall problem. You can confirm that by replicating using another client. Check the server logs also.

Categories

...