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

After the upgrade from 2.10.0 to 2.12.0, batch move files,invoke SftpPath.getClient().rename. operation fails after 10 files moved. #637

Open
alinlky opened this issue Nov 20, 2024 · 3 comments

Comments

@alinlky
Copy link

alinlky commented Nov 20, 2024

Version

2.12.0

Bug description

After the upgrade from 2.10.0 to 2.12.0, Rename and move file directories on the remote SFTP server, If more than 10 files are operated, the operation fails.
Invoke the SftpPath.getClient() .rename();

Actual behavior

Failed (SshChannelOpenException) to execute: open failed
at org.apache.sshd.common.future.AbstractSshFuture.lambda$verifyResult$2(AbstractSshFuture.java:146) ~[sshd-common.jar:2.12.0]
at org.apache.sshd.common.future.AbstractSshFuture.formatExceptionMessage(AbstractSshFuture.java:206) ~[sshd-common.jar:2.12.0]
at org.apache.sshd.common.future.AbstractSshFuture.verifyResult(AbstractSshFuture.java:145) ~[sshd-common.jar:2.12.0]
at org.apache.sshd.client.future.DefaultOpenFuture.verify(DefaultOpenFuture.java:39) ~[sshd-core.jar:2.12.0]
at org.apache.sshd.client.future.DefaultOpenFuture.verify(DefaultOpenFuture.java:32) ~[sshd-core.jar:2.12.0]
at org.apache.sshd.common.future.VerifiableFuture.verify(VerifiableFuture.java:74) ~[sshd-common.jar:2.12.0]
at org.apache.sshd.sftp.client.impl.DefaultSftpClient.(DefaultSftpClient.java:103) ~[sshd-sftp.jar:2.12.0]
at org.apache.sshd.sftp.client.impl.DefaultSftpClientFactory.createDefaultSftpClient(DefaultSftpClientFactory.java:66) ~[sshd-sftp.jar:2.12.0]
at org.apache.sshd.sftp.client.impl.DefaultSftpClientFactory.createSftpClient(DefaultSftpClientFactory.java:50) ~[sshd-sftp.jar:2.12.0]
at org.apache.sshd.sftp.client.fs.SftpFileSystem.getClient(SftpFileSystem.java:249) ~[sshd-sftp.jar:2.12.0]
at com.huawei.payment.sftp.SftpUtils.close(SftpUtils.java) ~[cit_util.jar:?]
at com.huawei.payment.sftp.upload.SftpUploadWorker.close(SftpUploadWorker.java:434) ~[cpt_sftp_file_tool.jar:?]
at com.huawei.payment.sftp.upload.SftpUploadWorker.startWork(SftpUploadWorker.java:111) ~[cpt_sftp_file_tool.jar:?]
at com.huawei.payment.sftp.SftpWorkInstance.dealTaskThroughSftpWork(SftpWorkInstance.java:129) ~[cpt_sftp_file_tool.jar:?]
at com.huawei.payment.sftp.SftpWorkInstance.lambda$dealTaskWithCountDownLatch$1(SftpWorkInstance.java:90) ~[cpt_sftp_file_tool.jar:?]
at com.huawei.payment.thread.TraceableTask.run(TraceableTask.java) ~[cit_util.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_402]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_402]
at java.lang.Thread.run(Thread.java:750) [?:1.8.0_402]
Caused by: org.apache.sshd.common.channel.exception.SshChannelOpenException: open failed
at org.apache.sshd.client.channel.AbstractClientChannel.handleOpenFailure(AbstractClientChannel.java:419) ~[sshd-core.jar:2.12.0]
at org.apache.sshd.common.session.helpers.AbstractConnectionService.channelOpenFailure(AbstractConnectionService.java:569) ~[sshd-core.jar:2.12.0]
at org.apache.sshd.common.session.helpers.AbstractConnectionService.process(AbstractConnectionService.java:459) ~[sshd-core.jar:2.12.0]
at org.apache.sshd.common.session.helpers.CurrentService.process(CurrentService.java:109) ~[sshd-core.jar:2.12.0]
at org.apache.sshd.common.session.helpers.AbstractSession.doHandleMessage(AbstractSession.java:624) ~[sshd-core.jar:2.12.0]
at org.apache.sshd.common.session.helpers.AbstractSession.lambda$handleMessage$0(AbstractSession.java:545) ~[sshd-core.jar:2.12.0]
at org.apache.sshd.common.util.threads.ThreadUtils.runAsInternal(ThreadUtils.java:68) ~[sshd-common.jar:2.12.0]
at org.apache.sshd.common.session.helpers.AbstractSession.handleMessage(AbstractSession.java:544) ~[sshd-core.jar:2.12.0]
at org.apache.sshd.common.session.helpers.AbstractSession.decode(AbstractSession.java:1688) ~[sshd-core.jar:2.12.0]
at org.apache.sshd.common.session.helpers.AbstractSession.messageReceived(AbstractSession.java:505) ~[sshd-core.jar:2.12.0]
at org.apache.sshd.common.session.helpers.AbstractSessionIoHandler.messageReceived(AbstractSessionIoHandler.java:64) ~[sshd-core.jar:2.12.0]
at org.apache.sshd.common.io.nio2.Nio2Session.handleReadCycleCompletion(Nio2Session.java:409) ~[sshd-core.jar:2.12.0]
at org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:382) ~[sshd-core.jar:2.12.0]
at org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:377) ~[sshd-core.jar:2.12.0]
at org.apache.sshd.common.io.nio2.Nio2CompletionHandler.lambda$completed$0(Nio2CompletionHandler.java:38) ~[sshd-core.jar:2.12.0]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_402]
at org.apache.sshd.common.io.nio2.Nio2CompletionHandler.completed(Nio2CompletionHandler.java:37) ~[sshd-core.jar:2.12.0]
at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126) ~[?:1.8.0_402]
at sun.nio.ch.Invoker$2.run(Invoker.java:218) ~[?:1.8.0_402]
at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112) ~[?:1.8.0_402]

Expected behavior

How can I fix it?

Relevant log output

No response

Other information

No response

@alinlky alinlky changed the title After the upgrade from 2.10.0 to 2.12.0, the SftpPath.getClient().rename operation fails after 10 files are moved remotely. What can I do? After the upgrade from 2.10.0 to 2.12.0, the SftpPath.getClient().rename. The operation fails after 10 files are moved remotely. Nov 21, 2024
@alinlky alinlky changed the title After the upgrade from 2.10.0 to 2.12.0, the SftpPath.getClient().rename. The operation fails after 10 files are moved remotely. After the upgrade from 2.10.0 to 2.12.0, invoke SftpPath.getClient().rename. The operation fails after 10 files are moved remotely. Nov 21, 2024
@alinlky alinlky changed the title After the upgrade from 2.10.0 to 2.12.0, invoke SftpPath.getClient().rename. The operation fails after 10 files are moved remotely. After the upgrade from 2.10.0 to 2.12.0, batch move files,invoke SftpPath.getClient().rename. operation fails after 10 files moved. Nov 21, 2024
@alinlky
Copy link
Author

alinlky commented Nov 21, 2024

@tomaswolf Can you help handle this issue !!

@tomaswolf
Copy link
Member

No, I cannot. First, I don't have the time, and second, it's not possible with just that stack trace.

Note that the channel pool used in an SftpFileSystem was changed in 2.11.0. See the relese notes and the technical docs.

@LiQingFeng7
Copy link

LiQingFeng7 commented Nov 28, 2024

I tried 2.13.2 and did not have the problem again, maybe you can try the latest version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants