You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by sparekh <sp...@oneweb.net> on 2016/09/27 21:09:34 UTC

Camel-FTP and Docker

Seeing a weird issue when trying to retrieve a file on a public FTP server
via the camel-ftp component. The camel route is running in a docker
container with openjdk:8-jdk image. The jar is built with dependencies and
runs correctly when executed on local OS.

From the trace log I can see that Camel queries and finds the file but is
unable to retrieve it.
LOG SNIPPET:
http://pastebin.com/rLfBnFKZ

Thanks!




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-FTP-and-Docker-tp5788132.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel-FTP and Docker

Posted by souciance <so...@gmail.com>.
Can you download the file via ftp manually inside the docker container?

Den 28 sep. 2016 4:18 em skrev "sparekh [via Camel]" <
ml-node+s465427n5788160h23@n5.nabble.com>:

> That's what confusing to me, its a public ftp server, just an anonymous
> login:
>
> Camel can successfully log in and find the file for download, even on
> TRACE I can't get an exact error thats causing the download to fail:
> ...
> [                          main] FtpOperations                  TRACE
> Connecting to ftp://anonymous@ftp.iers.org:21 using connection timeout:
> 10000
> [                          main] FtpOperations                  TRACE
> Using SoTimeout=300000
> [                          main] FtpOperations                  TRACE
> Attempting to login anonymous
> [                          main] FtpOperations                  TRACE User
> anonymous logged in: true
> [                          main] FtpConsumer                    DEBUG
> Connected and logged in to: ftp://anonymous@ftp.iers.org:21
> ...
> [/bulletina/29-volume-xxix/xml/] FtpConsumer                    TRACE
> Found 1 in directory: products/eop/rapid/bulletina/29-volume-xxix/xml
> [/bulletina/29-volume-xxix/xml/] FtpConsumer                    TRACE
> FtpFile[name=bulletina-xxix-038.xml, dir=false, file=true]
> [/bulletina/29-volume-xxix/xml/] FtpConsumer                    DEBUG
> Took 0.002 seconds to poll: products/eop/rapid/bulletina/29-volume-xxix/xml/
>
> [/bulletina/29-volume-xxix/xml/] FtpConsumer                    DEBUG
> Total 1 files to consume
> [/bulletina/29-volume-xxix/xml/] FtpConsumer                    TRACE
> Processing file: RemoteFile[bulletina-xxix-038.xml]
> [/bulletina/29-volume-xxix/xml/] FtpConsumer                    TRACE
> Retrieving file: products/eop/rapid/bulletina/
> 29-volume-xxix/xml/bulletina-xxix-038.xml from: Endpoint[
> ftp://ftp.iers.org/products/eop/rapid/bulletina/29-volume-xxix/xml/?delay=
> 60000&fileName=bulletina-xxix-038.xml&stepwise=false&useList=false]
> [/bulletina/29-volume-xxix/xml/] FtpOperations                  TRACE
> retrieveFile(products/eop/rapid/bulletina/29-volume-
> xxix/xml/bulletina-xxix-038.xml)
> [/bulletina/29-volume-xxix/xml/] FtpOperations                  TRACE
> Client retrieveFile: products/eop/rapid/bulletina/
> 29-volume-xxix/xml/bulletina-xxix-038.xml
> [/bulletina/29-volume-xxix/xml/] FtpConsumer                    WARN
>  Error processing file RemoteFile[bulletina-xxix-038.xml] due to Cannot
> retrieve file: RemoteFile[bulletina-xxix-038.xml] from: Endpoint[
> ftp://ftp.iers.org/products/eop/rapid/bulletina/29-volume-xxix/xml/?delay=
> 60000&fileName=bulletina-xxix-038.xml&stepwise=false&useList=false].
> Caused by: [org.apache.camel.component.file.GenericFileOperationFailedException
> - Cannot retrieve file: RemoteFile[bulletina-xxix-038.xml] from: Endpoint[
> ftp://ftp.iers.org/products/eop/rapid/bulletina/29-volume-xxix/xml/?delay=
> 60000&fileName=bulletina-xxix-038.xml&stepwise=false&useList=false]]
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Camel-FTP-and-Docker-
> tp5788132p5788160.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428h31@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-FTP-and-Docker-tp5788132p5788171.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel-FTP and Docker

Posted by sparekh <sp...@oneweb.net>.
I figured out the issue, I had to set the passiveMode=true in my FTP config
after using curl in verbose inside the container. Not sure why it works with
active mode (enabled by default) in host OS but not in docker.

Thanks,
sparekh



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-FTP-and-Docker-tp5788132p5788165.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel-FTP and Docker

Posted by sparekh <sp...@oneweb.net>.
That's what confusing to me, its a public ftp server, just an anonymous
login:

Camel can successfully log in and find the file for download, even on TRACE
I can't get an exact error thats causing the download to fail:
...
[                          main] FtpOperations                  TRACE
Connecting to ftp://anonymous@ftp.iers.org:21 using connection timeout:
10000
[                          main] FtpOperations                  TRACE Using
SoTimeout=300000
[                          main] FtpOperations                  TRACE
Attempting to login anonymous
[                          main] FtpOperations                  TRACE User
anonymous logged in: true
[                          main] FtpConsumer                    DEBUG
Connected and logged in to: ftp://anonymous@ftp.iers.org:21
...
[/bulletina/29-volume-xxix/xml/] FtpConsumer                    TRACE Found
1 in directory: products/eop/rapid/bulletina/29-volume-xxix/xml
[/bulletina/29-volume-xxix/xml/] FtpConsumer                    TRACE
FtpFile[name=bulletina-xxix-038.xml, dir=false, file=true]
[/bulletina/29-volume-xxix/xml/] FtpConsumer                    DEBUG Took
0.002 seconds to poll: products/eop/rapid/bulletina/29-volume-xxix/xml/
[/bulletina/29-volume-xxix/xml/] FtpConsumer                    DEBUG Total
1 files to consume
[/bulletina/29-volume-xxix/xml/] FtpConsumer                    TRACE
Processing file: RemoteFile[bulletina-xxix-038.xml]
[/bulletina/29-volume-xxix/xml/] FtpConsumer                    TRACE
Retrieving file:
products/eop/rapid/bulletina/29-volume-xxix/xml/bulletina-xxix-038.xml from:
Endpoint[ftp://ftp.iers.org/products/eop/rapid/bulletina/29-volume-xxix/xml/?delay=60000&fileName=bulletina-xxix-038.xml&stepwise=false&useList=false]
[/bulletina/29-volume-xxix/xml/] FtpOperations                  TRACE
retrieveFile(products/eop/rapid/bulletina/29-volume-xxix/xml/bulletina-xxix-038.xml)
[/bulletina/29-volume-xxix/xml/] FtpOperations                  TRACE Client
retrieveFile:
products/eop/rapid/bulletina/29-volume-xxix/xml/bulletina-xxix-038.xml
[/bulletina/29-volume-xxix/xml/] FtpConsumer                    WARN  Error
processing file RemoteFile[bulletina-xxix-038.xml] due to Cannot retrieve
file: RemoteFile[bulletina-xxix-038.xml] from:
Endpoint[ftp://ftp.iers.org/products/eop/rapid/bulletina/29-volume-xxix/xml/?delay=60000&fileName=bulletina-xxix-038.xml&stepwise=false&useList=false].
Caused by:
[org.apache.camel.component.file.GenericFileOperationFailedException -
Cannot retrieve file: RemoteFile[bulletina-xxix-038.xml] from:
Endpoint[ftp://ftp.iers.org/products/eop/rapid/bulletina/29-volume-xxix/xml/?delay=60000&fileName=bulletina-xxix-038.xml&stepwise=false&useList=false]]



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-FTP-and-Docker-tp5788132p5788160.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel-FTP and Docker

Posted by souciance <so...@gmail.com>.
Hi,

I doubt it is the FTP because I have also done a route with camel-ftp
inside docker and it worked fine to retrieve a file. If you enter the
docker container with bash, can you manually login to the ftp site and
download the file?

Best
Souciance

On Tue, Sep 27, 2016 at 11:09 PM, sparekh [via Camel] <
ml-node+s465427n5788132h55@n5.nabble.com> wrote:

> Seeing a weird issue when trying to retrieve a file on a public FTP server
> via the camel-ftp component. The camel route is running in a docker
> container with openjdk:8-jdk image. The jar is built with dependencies and
> runs correctly when executed on local OS.
>
> From the trace log I can see that Camel queries and finds the file but is
> unable to retrieve it.
> LOG SNIPPET:
> http://pastebin.com/rLfBnFKZ
>
> Thanks!
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Camel-FTP-and-Docker-tp5788132.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428h31@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-FTP-and-Docker-tp5788132p5788135.html
Sent from the Camel - Users mailing list archive at Nabble.com.