0

I am getting 501 error code when I try to connect to the FTP server and download file. I am able to download the csv file using the same user using winscp. I am using Apache camel 2.17 version.

From windows command prompt:

C:\Users\benzyl>ftp 10.15.22.198
Connected to 10.15.22.198.
220-QTCP at SOURCESYSTEM.COMPANY.PARENTCOMPANY.
220 Connection will close if idle more than 5 minutes.
User (10.15.22.198:(none)): GAUNAME
331 Enter password.
Password:
230 GAUNAME logged on.
ftp> quote site namefmt 1
250  Now using naming format "1".
ftp> cd /home/COMPANY/SOURCESYSTEM/TEST/OUT/MOAPP
250 "/home/COMPANY/SOURCESYSTEM/TEST/OUT/MOAPP" is current directory.
ftp> get SOURCESYSTEM.CSV
200 PORT subcommand request successful.
150 Retrieving file /home/COMPANY/SOURCESYSTEM/TEST/OUT/MOAPP/SOURCESYSTEM.CSV
226 File transfer completed successfully.
ftp: 150896 bytes received in 0,00Seconds 75448,00Kbytes/sec.

server logs:

12:37:51,838 WARN  [org.apache.camel.component.file.remote.RemoteFilePollingConsumerPollStrategy] (Camel (SOURCESYSTEMContext) thread #0 - ftp://10.15.22.198:21/home/COMPANY/SOURCESYSTEM/TEST/OUT/MOAPP) Trying to recover by disconnecting from remote server forcing a re-connect at next poll: ftp://GAUNAME@10.15.22.198:21
12:37:51,839 WARN  [org.apache.camel.component.file.remote.FtpConsumer] (Camel (SOURCESYSTEMContext) thread #0 - ftp://10.15.22.198:21/home/COMPANY/SOURCESYSTEM/TEST/OUT/MOAPP) Consumer FtpConsumer[ftp://10.15.22.198:21/home/COMPANY/SOURCESYSTEM/TEST/OUT/MOAPP?delete=true&fileName=SOURCESYSTEM.CSV&password=xxxxxx&siteCommand=NAMEFMT+1&useList=false&username=GAUNAME] failed polling endpoint: Endpoint[ftp://10.15.22.198:21/home/COMPANY/SOURCESYSTEM/TEST/OUT/MOAPP?delete=true&fileName=SOURCESYSTEM.CSV&password=xxxxxx&siteCommand=NAMEFMT+1&useList=false&username=GAUNAME]. Will try again at next poll. Caused by: [org.apache.camel.component.file.GenericFileOperationFailedException - File operation failed: 501 Unknown extension in database file name.
 Cannot change directory to: home. Code: 501]: org.apache.camel.component.file.GenericFileOperationFailedException: File operation failed: 501 Unknown extension in database file name.
 Cannot change directory to: home. Code: 501
    at org.apache.camel.component.file.remote.FtpOperations.doChangeDirectory(FtpOperations.java:778) [camel-ftp-2.17.0.redhat-630262.jar:2.17.0.redhat-630262]
    at org.apache.camel.component.file.remote.FtpOperations.changeCurrentDirectory(FtpOperations.java:756) [camel-ftp-2.17.0.redhat-630262.jar:2.17.0.redhat-630262]
    at org.apache.camel.component.file.remote.FtpConsumer.doPollDirectory(FtpConsumer.java:111) [camel-ftp-2.17.0.redhat-630262.jar:2.17.0.redhat-630262]
    at org.apache.camel.component.file.remote.FtpConsumer.pollDirectory(FtpConsumer.java:82) [camel-ftp-2.17.0.redhat-630262.jar:2.17.0.redhat-630262]
    at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:131) [camel-core-2.17.0.redhat-630262.jar:2.17.0.redhat-630262]
    at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:175) [camel-core-2.17.0.redhat-630262.jar:2.17.0.redhat-630262]
    at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:102) [camel-core-2.17.0.redhat-630262.jar:2.17.0.redhat-630262]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_151]
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [rt.jar:1.8.0_151]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [rt.jar:1.8.0_151]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [rt.jar:1.8.0_151]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_151]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_151]
    at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_151]

Can you please let me know how to fix this issue

Ravi
  • 1,247
  • 4
  • 15
  • 35
  • Possible duplicate of [Apache Camel endpoint to write a file AS400 FTP :](https://stackoverflow.com/questions/22651690/apache-camel-endpoint-to-write-a-file-as400-ftp) – pvpkiran Nov 16 '17 at 16:00
  • Hi Kiran,I have tried the same and updated my post with current error. – Ravi Nov 16 '17 at 17:08
  • Read on the Camel ftp website for what is and isn't allowed. – Souciance Eqdam Rashti Nov 16 '17 at 20:00
  • Do you mean to say am i sending something which is not allowed?I understand with 501 error code is invalid syntax or arguments. – Ravi Nov 16 '17 at 20:12

0 Answers0