Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SFTP Recursive LS Fails #3482

Closed
garyrussell opened this issue Feb 1, 2021 · 0 comments · Fixed by #3486
Closed

SFTP Recursive LS Fails #3482

garyrussell opened this issue Feb 1, 2021 · 0 comments · Fixed by #3486

Comments

@garyrussell
Copy link
Contributor

garyrussell commented Feb 1, 2021

See https://stackoverflow.com/questions/65951035/sftp-oubound-gateway-error-file-list-command

When testing locally, I see it trying to stat

main/directoryB/directoryB/./

$ tree main
main
├── directoryA
│   └── subdirectory1
│       └── bar
└── directoryB
    └── subdirectory1
        └── foo

The . and .. dirs should be skipped - there is logic to do that, but it is incorrect.

On MacOS, this is reported as

Caused by: com.jcraft.jsch.SftpException: No such file
	at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2873) ~[jsch-0.1.55.jar:na]

But it looks like the user's SFTP server expands . and includes it in the exception message.

Caused by: com.jcraft.jsch.SftpException: main/directoryA/directoryA/subDirectory1
at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2873) ~[jsch-0.1.55.jar:na]
@garyrussell garyrussell added type: bug status: waiting-for-triage The issue need to be evaluated and its future decided labels Feb 1, 2021
@artembilan artembilan added this to the 5.5 M2 milestone Feb 1, 2021
@artembilan artembilan added backport 5.3.x in: sftp in: ftp and removed status: waiting-for-triage The issue need to be evaluated and its future decided labels Feb 1, 2021
@garyrussell garyrussell self-assigned this Feb 1, 2021
garyrussell added a commit to garyrussell/spring-integration that referenced this issue Feb 1, 2021
Resolves spring-projects#3482

`.` and `..` should be ignored when recursing.
garyrussell added a commit to garyrussell/spring-integration that referenced this issue Feb 1, 2021
Resolves spring-projects#3482

`.` and `..` should be ignored when recursing.

**cherry-pick to 5.4.x, 5.3.x**
garyrussell added a commit to garyrussell/spring-integration that referenced this issue Feb 1, 2021
Resolves spring-projects#3482

`.` and `..` should be ignored when recursing.

**cherry-pick to 5.4.x, 5.3.x**
artembilan pushed a commit that referenced this issue Feb 1, 2021
Resolves #3482

`.` and `..` should be ignored when recursing.

**cherry-pick to 5.4.x, 5.3.x**

* Fix checkstyle.

* Fix test in `file` module - test was incorrect; it would have detected this problem.
artembilan pushed a commit that referenced this issue Feb 1, 2021
Resolves #3482

`.` and `..` should be ignored when recursing.

**cherry-pick to 5.4.x, 5.3.x**

* Fix checkstyle.

* Fix test in `file` module - test was incorrect; it would have detected this problem.
artembilan pushed a commit that referenced this issue Feb 1, 2021
Resolves #3482

`.` and `..` should be ignored when recursing.

**cherry-pick to 5.4.x, 5.3.x**

* Fix checkstyle.

* Fix test in `file` module - test was incorrect; it would have detected this problem.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants