You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/09/17 09:39:00 UTC
[jira] [Work logged] (SSHD-1071) SFTPFileSystem file copy to
remote SFTP Server fails with buffer size 64K
[ https://issues.apache.org/jira/browse/SSHD-1071?focusedWorklogId=485617&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-485617 ]
ASF GitHub Bot logged work on SSHD-1071:
----------------------------------------
Author: ASF GitHub Bot
Created on: 17/Sep/20 09:38
Start Date: 17/Sep/20 09:38
Worklog Time Spent: 10m
Work Description: gnodet opened a new pull request #168:
URL: https://github.com/apache/mina-sshd/pull/168
Not to be merged yet, but to check if the tests pass first.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Issue Time Tracking
-------------------
Worklog Id: (was: 485617)
Remaining Estimate: 0h
Time Spent: 10m
> SFTPFileSystem file copy to remote SFTP Server fails with buffer size 64K
> --------------------------------------------------------------------------
>
> Key: SSHD-1071
> URL: https://issues.apache.org/jira/browse/SSHD-1071
> Project: MINA SSHD
> Issue Type: Bug
> Affects Versions: 2.5.1
> Reporter: Sreedhar J
> Priority: Minor
> Attachments: apache_sshd_2.5.1_sftpclient.log
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Hi, I am trying to put a file to remote SFTP Server using SFTPFileSystem copy method. It works will when I set the buffersize to 32K. But with buffer size set to 64K, getting an exception.
>
> Here is the code
>
> {code}
> public void putFile (String localFileName, String remoteFileName) throws IOException {
> SftpClientFactory factory = SftpClientFactory.instance();
> SftpFileSystem fs = factory.createSftpFileSystem(session);
> fs.setReadBufferSize(65536);
> fs.setWriteBufferSize(65536);
> // fs.setReadBufferSize( 32768);
> // fs.setWriteBufferSize(32768);
> Path localFile = Paths.get( localFileName);
> Path remoteFile = fs.getPath(remoteFileName);
> Files.copy( localFile, remoteFile);
> }
> {code}
>
> Here is the Stacktrace
> {code}
> 5827 2020-09-01 22:00:17,248 [NioProcessor-2] DEBUG org.apache.sshd.client.subsystem.sftp.impl.DefaultSftpClient$SftpChannelSubsystem - close(SftpChannelSubsystem[id=0, recipient=0]-ClientSessionImpl[jsreedha@/10.15.102.66:22][sftp]][Graceful] - operationComplete() closed
> Exception in thread "main" java.io.EOFException: Channel is being closed
> at org.apache.sshd.common.channel.AbstractChannel$2.<init>(AbstractChannel.java:794)
> at org.apache.sshd.common.channel.AbstractChannel.writePacket(AbstractChannel.java:792)
> at org.apache.sshd.common.channel.ChannelAsyncOutputStream.doWriteIfPossible(ChannelAsyncOutputStream.java:168)
> at org.apache.sshd.common.channel.ChannelAsyncOutputStream.onWritten(ChannelAsyncOutputStream.java:194)
> at org.apache.sshd.common.channel.ChannelAsyncOutputStream.lambda$doWriteIfPossible$2(ChannelAsyncOutputStream.java:169)
> at org.apache.sshd.common.channel.ChannelAsyncOutputStream$$Lambda$100.00000000135A3070.operationComplete(Unknown Source)
> at org.apache.sshd.common.future.AbstractSshFuture.notifyListener(AbstractSshFuture.java:173)
> at org.apache.sshd.common.future.DefaultSshFuture.notifyListeners(DefaultSshFuture.java:209)
> at org.apache.sshd.common.future.DefaultSshFuture.setValue(DefaultSshFuture.java:112)
> at org.apache.sshd.common.io.mina.MinaSession$Future.setWritten(MinaSession.java:195)
> at org.apache.sshd.common.io.mina.MinaSession.lambda$write$2(MinaSession.java:183)
> at org.apache.sshd.common.io.mina.MinaSession$$Lambda$57.0000000011860FB0.operationComplete(Unknown Source)
> at org.apache.mina.core.future.DefaultIoFuture.notifyListener(DefaultIoFuture.java:423)
> at org.apache.mina.core.future.DefaultIoFuture.notifyListeners(DefaultIoFuture.java:407)
> at org.apache.mina.core.future.DefaultIoFuture.setValue(DefaultIoFuture.java:327)
> at org.apache.mina.core.future.DefaultWriteFuture.setWritten(DefaultWriteFuture.java:103)
> at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageSent(DefaultIoFilterChain.java:656)
> at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.fireMessageSent(AbstractPollingIoProcessor.java:1224)
> at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.writeBuffer(AbstractPollingIoProcessor.java:1132)
> at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.flushNow(AbstractPollingIoProcessor.java:994)
> at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.flush(AbstractPollingIoProcessor.java:921)
> at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:688)
> at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1160)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
> at java.lang.Thread.run(Thread.java:818)
> Suppressed: java.io.IOException: close(100mb.txt: 00000000) client is closed
> at org.apache.sshd.client.subsystem.sftp.impl.AbstractSftpClient.close(AbstractSftpClient.java:720)
> at org.apache.sshd.client.subsystem.sftp.impl.DefaultCloseableHandle.close(DefaultCloseableHandle.java:53)
> at org.apache.sshd.client.subsystem.sftp.impl.SftpOutputStreamAsync.close(SftpOutputStreamAsync.java:256)
> at java.nio.file.Files.copy(Files.java:3039)
> at java.nio.file.CopyMoveHelper.copyToForeignTarget(CopyMoveHelper.java:137)
> at java.nio.file.Files.copy(Files.java:1288)
> at com.b2b.sftp.apache.sftpclient.ClientTest.putFile(ClientTest.java:156)
> at com.b2b.sftp.apache.sftpclient.ClientTest.main(ClientTest.java:178)
> {code}
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org