You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Patrick McGloin <mc...@gmail.com> on 2017/01/15 14:06:49 UTC

Camel SCP Warnings

Hi,

If I try to transfer a file to a directory that does not exist using Camel
SCP I see a warning like this in the log:

[scp] WARN scp: /home/user/scp/1234: No such file or directory

It looks like the code says that Camel will just log a warning when such an
error occurs. There is no exception in the code, so it looks like the file
was transferred when it was not.

https://github.com/apache/camel/blob/52a739feb9da8acd29067304c7c8356bbc5ef4dd/components/camel-jsch/src/main/java/org/apache/camel/component/scp/ScpOperations.java#L347

Shouldn't this be an error and an exception? Or is there another way of
doing the error handling here?

I tried this with SCP also and indeed SCP does not create the directory so
I think that is correct.  But I think the Camel User should see that the
transfer failed.

Note: I also posted this as a question on StackOverflow.
http://stackoverflow.com/questions/41651190/camel-scp-warnings-not-handled-correctly

Re: Camel SCP Warnings

Posted by Andrea Cosentino <an...@yahoo.com.INVALID>.
ahah, yes, you're right!
 --
Andrea Cosentino 
----------------------------------
Apache Camel PMC Member
Apache Karaf Committer
Apache Servicemix Committer
Email: ancosen1985@yahoo.com
Twitter: @oscerd2
Github: oscerd



On Tuesday, January 17, 2017 10:13 AM, patrickmcgloin <mc...@gmail.com> wrote:
Hi Andrea,

I've just released that I should have used the label caml-jsch.  Perhaps
you want to remove camel-scp and use the camel-jsch label.

Best regards,
Patrick

On 17 January 2017 at 09:50, Andrea Cosentino-2 [via Camel] <
ml-node+s465427n5792657h93@n5.nabble.com> wrote:

> Added the label for camel-scp :-)
>  --
> Andrea Cosentino
> ----------------------------------
> Apache Camel PMC Member
> Apache Karaf Committer
> Apache Servicemix Committer
> Email: [hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5792657&i=0>
> Twitter: @oscerd2
> Github: oscerd
>
>
>
> On Tuesday, January 17, 2017 9:47 AM, patrickmcgloin <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5792657&i=1>> wrote:
> Done.  Note camel-scp is not one of the Jira Components that you can
> select
> so I incorrectly assigned this to camel-sftp.
>
> https://issues.apache.org/jira/browse/CAMEL-10713
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.
> com/Camel-SCP-Warnings-tp5792552p5792655.html
>
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Camel-SCP-Warnings-
> tp5792552p5792657.html
> To unsubscribe from Camel SCP Warnings, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5792552&code=bWNnbG9pbi5wYXRyaWNrQGdtYWlsLmNvbXw1NzkyNTUyfC0xMzY2OTY5MDI2>
> .
> 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-SCP-Warnings-tp5792552p5792663.html

Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel SCP Warnings

Posted by patrickmcgloin <mc...@gmail.com>.
Hi Andrea,

I've just released that I should have used the label caml-jsch.  Perhaps
you want to remove camel-scp and use the camel-jsch label.

Best regards,
Patrick

On 17 January 2017 at 09:50, Andrea Cosentino-2 [via Camel] <
ml-node+s465427n5792657h93@n5.nabble.com> wrote:

> Added the label for camel-scp :-)
>  --
> Andrea Cosentino
> ----------------------------------
> Apache Camel PMC Member
> Apache Karaf Committer
> Apache Servicemix Committer
> Email: [hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5792657&i=0>
> Twitter: @oscerd2
> Github: oscerd
>
>
>
> On Tuesday, January 17, 2017 9:47 AM, patrickmcgloin <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5792657&i=1>> wrote:
> Done.  Note camel-scp is not one of the Jira Components that you can
> select
> so I incorrectly assigned this to camel-sftp.
>
> https://issues.apache.org/jira/browse/CAMEL-10713
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.
> com/Camel-SCP-Warnings-tp5792552p5792655.html
>
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Camel-SCP-Warnings-
> tp5792552p5792657.html
> To unsubscribe from Camel SCP Warnings, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5792552&code=bWNnbG9pbi5wYXRyaWNrQGdtYWlsLmNvbXw1NzkyNTUyfC0xMzY2OTY5MDI2>
> .
> 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-SCP-Warnings-tp5792552p5792663.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel SCP Warnings

Posted by Andrea Cosentino <an...@yahoo.com.INVALID>.
Added the label for camel-scp :-)
 --
Andrea Cosentino 
----------------------------------
Apache Camel PMC Member
Apache Karaf Committer
Apache Servicemix Committer
Email: ancosen1985@yahoo.com
Twitter: @oscerd2
Github: oscerd



On Tuesday, January 17, 2017 9:47 AM, patrickmcgloin <mc...@gmail.com> wrote:
Done.  Note camel-scp is not one of the Jira Components that you can select
so I incorrectly assigned this to camel-sftp.  

https://issues.apache.org/jira/browse/CAMEL-10713



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-SCP-Warnings-tp5792552p5792655.html

Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel SCP Warnings

Posted by patrickmcgloin <mc...@gmail.com>.
Done.  Note camel-scp is not one of the Jira Components that you can select
so I incorrectly assigned this to camel-sftp.  

https://issues.apache.org/jira/browse/CAMEL-10713



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-SCP-Warnings-tp5792552p5792655.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel SCP Warnings

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Thanks yeah that looks like a little bug.

You are welcome to log a JIRA and also work on a github PR or patch
file with a fix.
http://camel.apache.org/support.html

On Mon, Jan 16, 2017 at 8:14 PM, patrickmcgloin
<mc...@gmail.com> wrote:
> Hi Claus,
>
> Sure.
>
> 1 General error in file copy
> 2 Destination is not directory, but it should be
>
> http://support.attachmate.com/techdocs/2116.html
>
> Looking at those return codes, it seems that unless its a 0 (Operation was
> successful), then the error should be pushed up to the Camel Route as the
> file was not transferred.
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-SCP-Warnings-tp5792552p5792635.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: Camel SCP Warnings

Posted by patrickmcgloin <mc...@gmail.com>.
Hi Claus,

Sure.  

1 General error in file copy 
2 Destination is not directory, but it should be 

http://support.attachmate.com/techdocs/2116.html

Looking at those return codes, it seems that unless its a 0 (Operation was
successful), then the error should be pushed up to the Camel Route as the
file was not transferred.  





--
View this message in context: http://camel.465427.n5.nabble.com/Camel-SCP-Warnings-tp5792552p5792635.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel SCP Warnings

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Can you try to research about SCP error codes, and see what code 1 and
2 is expected to mean.


On Sun, Jan 15, 2017 at 3:06 PM, Patrick McGloin
<mc...@gmail.com> wrote:
> Hi,
>
> If I try to transfer a file to a directory that does not exist using Camel
> SCP I see a warning like this in the log:
>
> [scp] WARN scp: /home/user/scp/1234: No such file or directory
>
> It looks like the code says that Camel will just log a warning when such an
> error occurs. There is no exception in the code, so it looks like the file
> was transferred when it was not.
>
> https://github.com/apache/camel/blob/52a739feb9da8acd29067304c7c8356bbc5ef4dd/components/camel-jsch/src/main/java/org/apache/camel/component/scp/ScpOperations.java#L347
>
> Shouldn't this be an error and an exception? Or is there another way of
> doing the error handling here?
>
> I tried this with SCP also and indeed SCP does not create the directory so
> I think that is correct.  But I think the Camel User should see that the
> transfer failed.
>
> Note: I also posted this as a question on StackOverflow.
> http://stackoverflow.com/questions/41651190/camel-scp-warnings-not-handled-correctly



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2