camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cherry Ngai (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-11387) SFTP is delivered into incorrect location, without exception (file in subfolder + temp file is created + Camel running on Window & SFTP server running on LINUX)
Date Mon, 28 Aug 2017 19:28:00 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-11387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16144235#comment-16144235
] 

Cherry Ngai commented on CAMEL-11387:
-------------------------------------

[~davsclaus], the file is delivered to "$linuxServer/myfolder1myfolder2test.txt".   It is
expected to be delivered $linuxServer/myfolder1/myfolder2/test.txt.  


Camel route with v2.19.0: 
{code}
 from("file://sourceFolder?recursive=true&delay=60000").
 to("sftp://username@linuxServer?tempFileName=${file:onlyname}.part");
{code}

Step 1: Camel is running on Window server
Step 2: File is placed in $windowServer/sourceFolder/myfolder1/myfolder2/test.txt, and expecting
to delivery to $linuxServer/myfolder1/myfolder2/test.txt.  However, the file is delivery to
$linuxServer/myfolder1myfolder2test.txt, and there is no exception.


Debug message:
{code}
[hread #6 - file://sourceFolder] SftpOperations                 DEBUG Connected to sftp://username@linuxServer:22
[hread #6 - file://sourceFolder] RemoteFileProducer             DEBUG Connected and logged
in to: sftp://username@linuxServer?tempFileName=%24%7Bfile%3Aonlyname%7D.part
[hread #6 - file://sourceFolder] SftpOperations                 DEBUG Trying to build remote
directory: myfolder1/myfolder2
[hread #6 - file://sourceFolder] GenericFileConverter           DEBUG Read file sourceFolder\myfolder1\myfolder2\test.txt
(no charset)
[hread #6 - file://sourceFolder] SftpOperations                 DEBUG About to store file:
test.txt.part using stream: java.io.BufferedInputStream@75c2d4bc
[hread #6 - file://sourceFolder] SftpOperations                 DEBUG Took 0.015 seconds (15
millis) to store file: test.txt.part and FTP client returned: true
[hread #6 - file://sourceFolder] RemoteFileProducer             DEBUG Wrote [myfolder1/myfolder2/test.txt.part]
to [sftp://username@linuxServer?tempFileName=%24%7Bfile%3Aonlyname%7D.part]
[hread #6 - file://sourceFolder] SftpOperations                 DEBUG Renaming file: myfolder1/myfolder2/test.txt.part
to: myfolder1\myfolder2\test.txt
[hread #6 - file://sourceFolder] Tracer                         INFO  ID-VACSWVNGAI02-55268-1503948136624-0-2
>>> (route2) sftp://username@linuxServer?tempFileName=%24%7Bfile%3Aonlyname%7D.part
--> log[file ${file:absolute.path} is processed] <<< Pattern:InOnly, Headers:{breadcrumbId=ID-VACSWVNGAI02-55268-1503948136624-0-1,
CamelFileAbsolute=false, CamelFileAbsolutePath=E:\relay\sourceFolder\myfolder1\myfolder2\test.txt,
CamelFileLastModified=1503948089127, CamelFileLength=4, CamelFileName=myfolder1\myfolder2\test.txt,
CamelFileNameConsumed=myfolder1\myfolder2\test.txt, CamelFileNameOnly=test.txt, CamelFileNameProduced=myfolder1\myfolder2\test.txt,
CamelFileParent=sourceFolder\myfolder1\myfolder2, CamelFilePath=sourceFolder\myfolder1\myfolder2\test.txt,
CamelFileRelativePath=myfolder1\myfolder2\test.txt}, BodyType:org.apache.camel.component.file.GenericFile,
Body:[Body is file based: GenericFile[myfolder1\myfolder2\test.txt]]
[hread #6 - file://sourceFolder] route2                         INFO  file E:\relay\sourceFolder\myfolder1\myfolder2\test.txt
is processed
[hread #6 - file://sourceFolder] GenericFileOnCompletion        DEBUG Done processing file:
GenericFile[myfolder1\myfolder2\test.txt] using exchange: Exchange[ID-VACSWVNGAI02-55268-1503948136624-0-2]
[hread #6 - file://sourceFolder] FileUtil                       DEBUG Retrying attempt 0 to
delete file: sourceFolder\myfolder1\myfolder2\.camel\test.txt
[hread #6 - file://sourceFolder] FileUtil                       DEBUG Tried 1 to delete file:
sourceFolder\myfolder1\myfolder2\.camel\test.txt with result: true
[hread #6 - file://sourceFolder] nericFileRenameProcessStrategy DEBUG Renaming file: GenericFile[myfolder1\myfolder2\test.txt]
to: GenericFile[myfolder1\myfolder2\.camel\test.txt]
[hread #6 - file://sourceFolder] FileUtil                       DEBUG Tried 1 to rename file:
E:\relay\sourceFolder\myfolder1\myfolder2\test.txt to: sourceFolder\myfolder1\myfolder2\.camel\test.txt
with result: true
[hread #6 - file://sourceFolder] FileUtil                       DEBUG Retrying attempt 0 to
delete file: E:\relay\sourceFolder\myfolder1\myfolder2\test.txt.camelLock
[hread #6 - file://sourceFolder] FileUtil                       DEBUG Tried 1 to delete file:
E:\relay\sourceFolder\myfolder1\myfolder2\test.txt.camelLock with result: true
{code}





> SFTP is delivered into incorrect location, without exception (file in subfolder + temp
file is created + Camel running on Window & SFTP server running on LINUX)
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-11387
>                 URL: https://issues.apache.org/jira/browse/CAMEL-11387
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-sftp
>    Affects Versions: 2.19.0
>         Environment: camel is running on Window, and SFTP server is LINUX
>            Reporter: Cherry Ngai
>            Priority: Minor
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> The bug only happens when:
> i) file in subfolder
> ii) temp file is created 
> iii) Camel running on Window & SFTP server running on LINUX
> Route Configuration:
> {code}
>  from("file://sourceFolder?recursive=true&delay=60000").
>  to("sftp://username@linuxServer?tempFileName=${file:onlyname}.part");
> {code}
> NOTES: added separator=UNIX or AUTO, I got the same issue.
> Window Local File: sourceFolder/myfolder1/myfolder2/test.txt
> FTPS Remote File Delivered: $linuxServer/myfolder1myfolder2test.txt
> NOTES: 
> * There is no exception throw in 2.19.0, even though the file delivered into incorrect
location.  
> * In 2.17.3, exception throw at org.apache.camel.component.file.remote.SftpOperations.renameFile(SftpOperations.java:431)[camel-ftp-2.17.3.jar:2.17.3]
> * Without tempFileName, it works perfectly.  Issue is around the rename area.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message