[jira] [Commented] (SSHD-1209) Write to error stream for custom exception is appending a extra word at the beginning
[ https://issues.apache.org/jira/browse/SSHD-1209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17402029#comment-17402029 ] Susmit Sarkar commented on SSHD-1209: - *perhaps you are writing some UNICODE data but reading it as ASCII instead of UTF-8 on the peer side* = Reading is done by the ssh client in my case Putty *That means that it is UTF-8 encoded* = yes it is UTF-8 encoded *you are not reading the data as a {{ByteBufferArray}}* {code:java} ByteArrayBuffer buf = new ByteArrayBuffer(); buf.putString(refinedUserExitMessage + System.getProperty("line.separator")); errStream.writeBuffer(buf);{code} What is the solution shall i follow? > Write to error stream for custom exception is appending a extra word at the > beginning > - > > Key: SSHD-1209 > URL: https://issues.apache.org/jira/browse/SSHD-1209 > Project: MINA SSHD > Issue Type: Bug >Affects Versions: 2.7.0 >Reporter: Susmit Sarkar >Priority: Major > Attachments: image-2021-08-19-12-50-01-922.png > > > Hello Team, > > We have a class as below > > {code:java} > DetailedSftpErrorStatusDataHandler implements SftpErrorStatusDataHandler, > ChannelSessionAware, DetailedSftpErrorStatusDataHandler implements > SftpErrorStatusDataHandler, ChannelSessionAware, > AsyncCommandErrorStreamAware, CommandDirectErrorStreamAware { > {code} > and we have overridden the : > > resolveErrorMessage and setIoErrorStream(IoOutputStream errStream) > {code:java} > @Override > public void setIoErrorStream(IoOutputStream errStream) { > this.errStream = errStream; > } > {code} > finally we are writing to the error stream: > {code:java} > private void writeMsgToErrorStream(String refinedUserExitMessage) { > ByteArrayBuffer buf = new ByteArrayBuffer(); > buf.putString(refinedUserExitMessage + > System.getProperty("line.separator")); > try { if (errStream != null) { > errStream.writeBuffer(buf); > } > } catch (Exception e) { > } > } > {code} > Once the data is written to error stream we are gettig proper message to the > console: > !image-2021-08-19-12-50-01-922.png! > But there is an extra charater getting appended at the first character *<* > Utils.java > I have no idea from where this *<* is coming from, and that changes with the > first character like if it is P it would be *>, when starting with S it gets > appended with Z* > Any help will be appreciated. > Thanks, > Susmit > -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For additional commands, e-mail: dev-h...@mina.apache.org
[jira] [Comment Edited] (SSHD-1209) Write to error stream for custom exception is appending a extra word at the beginning
[ https://issues.apache.org/jira/browse/SSHD-1209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17401788#comment-17401788 ] Lyor Goldstein edited comment on SSHD-1209 at 8/20/21, 3:15 AM: You are writing the string to a {{ByteBufferArray}} and that means that it is UTF-8 encoded - perhaps you are writing some UNICODE data but reading it as ASCII instead of UTF-8 on the peer side. Another possibility is that you are not reading the data as a {{ByteBufferArray}} - reminder: when writing a string, its length is written as a 32-bit value before the (UTF-8) characters was (Author: lgoldstein): You are writing the string to a {{ByteBufferArray}} and that means that it is UTF-8 encoded - perhaps you are writing some UNICODE data but reading it as ASCII instead of UTF-8 on the peer side > Write to error stream for custom exception is appending a extra word at the > beginning > - > > Key: SSHD-1209 > URL: https://issues.apache.org/jira/browse/SSHD-1209 > Project: MINA SSHD > Issue Type: Bug >Affects Versions: 2.7.0 >Reporter: Susmit Sarkar >Priority: Major > Attachments: image-2021-08-19-12-50-01-922.png > > > Hello Team, > > We have a class as below > > {code:java} > DetailedSftpErrorStatusDataHandler implements SftpErrorStatusDataHandler, > ChannelSessionAware, DetailedSftpErrorStatusDataHandler implements > SftpErrorStatusDataHandler, ChannelSessionAware, > AsyncCommandErrorStreamAware, CommandDirectErrorStreamAware { > {code} > and we have overridden the : > > resolveErrorMessage and setIoErrorStream(IoOutputStream errStream) > {code:java} > @Override > public void setIoErrorStream(IoOutputStream errStream) { > this.errStream = errStream; > } > {code} > finally we are writing to the error stream: > {code:java} > private void writeMsgToErrorStream(String refinedUserExitMessage) { > ByteArrayBuffer buf = new ByteArrayBuffer(); > buf.putString(refinedUserExitMessage + > System.getProperty("line.separator")); > try { if (errStream != null) { > errStream.writeBuffer(buf); > } > } catch (Exception e) { > } > } > {code} > Once the data is written to error stream we are gettig proper message to the > console: > !image-2021-08-19-12-50-01-922.png! > But there is an extra charater getting appended at the first character *<* > Utils.java > I have no idea from where this *<* is coming from, and that changes with the > first character like if it is P it would be *>, when starting with S it gets > appended with Z* > Any help will be appreciated. > Thanks, > Susmit > -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For additional commands, e-mail: dev-h...@mina.apache.org
[jira] [Commented] (SSHD-1209) Write to error stream for custom exception is appending a extra word at the beginning
[ https://issues.apache.org/jira/browse/SSHD-1209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17401788#comment-17401788 ] Lyor Goldstein commented on SSHD-1209: -- You are writing the string to a {{ByteBufferArray}} and that means that it is UTF-8 encoded - perhaps you are writing some UNICODE data but reading it as ASCII instead of UTF-8 on the peer side > Write to error stream for custom exception is appending a extra word at the > beginning > - > > Key: SSHD-1209 > URL: https://issues.apache.org/jira/browse/SSHD-1209 > Project: MINA SSHD > Issue Type: Bug >Affects Versions: 2.7.0 >Reporter: Susmit Sarkar >Priority: Major > Attachments: image-2021-08-19-12-50-01-922.png > > > Hello Team, > > We have a class as below > > {code:java} > DetailedSftpErrorStatusDataHandler implements SftpErrorStatusDataHandler, > ChannelSessionAware, DetailedSftpErrorStatusDataHandler implements > SftpErrorStatusDataHandler, ChannelSessionAware, > AsyncCommandErrorStreamAware, CommandDirectErrorStreamAware { > {code} > and we have overridden the : > > resolveErrorMessage and setIoErrorStream(IoOutputStream errStream) > {code:java} > @Override > public void setIoErrorStream(IoOutputStream errStream) { > this.errStream = errStream; > } > {code} > finally we are writing to the error stream: > {code:java} > private void writeMsgToErrorStream(String refinedUserExitMessage) { > ByteArrayBuffer buf = new ByteArrayBuffer(); > buf.putString(refinedUserExitMessage + > System.getProperty("line.separator")); > try { if (errStream != null) { > errStream.writeBuffer(buf); > } > } catch (Exception e) { > } > } > {code} > Once the data is written to error stream we are gettig proper message to the > console: > !image-2021-08-19-12-50-01-922.png! > But there is an extra charater getting appended at the first character *<* > Utils.java > I have no idea from where this *<* is coming from, and that changes with the > first character like if it is P it would be *>, when starting with S it gets > appended with Z* > Any help will be appreciated. > Thanks, > Susmit > -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For additional commands, e-mail: dev-h...@mina.apache.org
[jira] [Resolved] (SSHD-1208) large file downloads may cause oom
[ https://issues.apache.org/jira/browse/SSHD-1208?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lyor Goldstein resolved SSHD-1208. -- Fix Version/s: 2.7.0 Resolution: Fixed > large file downloads may cause oom > -- > > Key: SSHD-1208 > URL: https://issues.apache.org/jira/browse/SSHD-1208 > Project: MINA SSHD > Issue Type: Bug >Affects Versions: 2.6.0, 2.5.1 >Reporter: poppinlong >Priority: Critical > Fix For: 2.7.0 > > Attachments: image-2021-08-17-11-45-32-837.png, > image-2021-08-17-11-48-35-744.png, image-2021-08-17-11-53-41-558.png, > image-2021-08-17-11-56-05-547.png > > > !image-2021-08-17-11-45-32-837.png! > this requests queue is a blocking queue,however, enqueueing while reading a > file is non-blocking,and the queue is not capped > !image-2021-08-17-11-48-35-744.png! > the same to the write queue , furthermore, the write queue is a non-blocking > queue > !image-2021-08-17-11-53-41-558.png! > downloading large files concurrently may cause OOM > !image-2021-08-17-11-56-05-547.png! -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For additional commands, e-mail: dev-h...@mina.apache.org
[jira] [Commented] (SSHD-1208) large file downloads may cause oom
[ https://issues.apache.org/jira/browse/SSHD-1208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17401785#comment-17401785 ] Lyor Goldstein commented on SSHD-1208: -- Fixed in 2.7.0 > large file downloads may cause oom > -- > > Key: SSHD-1208 > URL: https://issues.apache.org/jira/browse/SSHD-1208 > Project: MINA SSHD > Issue Type: Bug >Affects Versions: 2.6.0, 2.5.1 >Reporter: poppinlong >Priority: Critical > Attachments: image-2021-08-17-11-45-32-837.png, > image-2021-08-17-11-48-35-744.png, image-2021-08-17-11-53-41-558.png, > image-2021-08-17-11-56-05-547.png > > > !image-2021-08-17-11-45-32-837.png! > this requests queue is a blocking queue,however, enqueueing while reading a > file is non-blocking,and the queue is not capped > !image-2021-08-17-11-48-35-744.png! > the same to the write queue , furthermore, the write queue is a non-blocking > queue > !image-2021-08-17-11-53-41-558.png! > downloading large files concurrently may cause OOM > !image-2021-08-17-11-56-05-547.png! -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For additional commands, e-mail: dev-h...@mina.apache.org
[jira] [Commented] (SSHD-1209) Write to error stream for custom exception is appending a extra word at the beginning
[ https://issues.apache.org/jira/browse/SSHD-1209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17401781#comment-17401781 ] Susmit Sarkar commented on SSHD-1209: - Welcome to the community The version is 2.7.0 it's mentioned above. You can have a look at this class [https://github.com/apache/mina-sshd/blob/2fc98f7a21a7b83d2b2bc72d48a2194caa7f8fd1/sshd-contrib/src/main/java/org/apache/sshd/contrib/server/subsystem/sftp/DetailedSftpErrorStatusDataHandler.java] only difference is I have implemented is adding few more interfaces: ChannelSessionAware, AsyncCommandErrorStreamAware, CommandDirectErrorStreamAware to write any sftp related exception to the command line output, and have overrwritten few default methods resolveErrorMessage() and setIoErrorStream(IoOutputStream errStream) > Write to error stream for custom exception is appending a extra word at the > beginning > - > > Key: SSHD-1209 > URL: https://issues.apache.org/jira/browse/SSHD-1209 > Project: MINA SSHD > Issue Type: Bug >Affects Versions: 2.7.0 >Reporter: Susmit Sarkar >Priority: Major > Attachments: image-2021-08-19-12-50-01-922.png > > > Hello Team, > > We have a class as below > > {code:java} > DetailedSftpErrorStatusDataHandler implements SftpErrorStatusDataHandler, > ChannelSessionAware, DetailedSftpErrorStatusDataHandler implements > SftpErrorStatusDataHandler, ChannelSessionAware, > AsyncCommandErrorStreamAware, CommandDirectErrorStreamAware { > {code} > and we have overridden the : > > resolveErrorMessage and setIoErrorStream(IoOutputStream errStream) > {code:java} > @Override > public void setIoErrorStream(IoOutputStream errStream) { > this.errStream = errStream; > } > {code} > finally we are writing to the error stream: > {code:java} > private void writeMsgToErrorStream(String refinedUserExitMessage) { > ByteArrayBuffer buf = new ByteArrayBuffer(); > buf.putString(refinedUserExitMessage + > System.getProperty("line.separator")); > try { if (errStream != null) { > errStream.writeBuffer(buf); > } > } catch (Exception e) { > } > } > {code} > Once the data is written to error stream we are gettig proper message to the > console: > !image-2021-08-19-12-50-01-922.png! > But there is an extra charater getting appended at the first character *<* > Utils.java > I have no idea from where this *<* is coming from, and that changes with the > first character like if it is P it would be *>, when starting with S it gets > appended with Z* > Any help will be appreciated. > Thanks, > Susmit > -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For additional commands, e-mail: dev-h...@mina.apache.org
[jira] [Commented] (SSHD-1209) Write to error stream for custom exception is appending a extra word at the beginning
[ https://issues.apache.org/jira/browse/SSHD-1209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17401714#comment-17401714 ] Akash Lad commented on SSHD-1209: - Hi Susmit, I am new to the community. Could you please do let me know which version to check out from. And provide any documentation. I can start looking at the issues ASAP. Thanks in advance. > Write to error stream for custom exception is appending a extra word at the > beginning > - > > Key: SSHD-1209 > URL: https://issues.apache.org/jira/browse/SSHD-1209 > Project: MINA SSHD > Issue Type: Bug >Affects Versions: 2.7.0 >Reporter: Susmit Sarkar >Priority: Major > Attachments: image-2021-08-19-12-50-01-922.png > > > Hello Team, > > We have a class as below > > {code:java} > DetailedSftpErrorStatusDataHandler implements SftpErrorStatusDataHandler, > ChannelSessionAware, DetailedSftpErrorStatusDataHandler implements > SftpErrorStatusDataHandler, ChannelSessionAware, > AsyncCommandErrorStreamAware, CommandDirectErrorStreamAware { > {code} > and we have overridden the : > > resolveErrorMessage and setIoErrorStream(IoOutputStream errStream) > {code:java} > @Override > public void setIoErrorStream(IoOutputStream errStream) { > this.errStream = errStream; > } > {code} > finally we are writing to the error stream: > {code:java} > private void writeMsgToErrorStream(String refinedUserExitMessage) { > ByteArrayBuffer buf = new ByteArrayBuffer(); > buf.putString(refinedUserExitMessage + > System.getProperty("line.separator")); > try { if (errStream != null) { > errStream.writeBuffer(buf); > } > } catch (Exception e) { > } > } > {code} > Once the data is written to error stream we are gettig proper message to the > console: > !image-2021-08-19-12-50-01-922.png! > But there is an extra charater getting appended at the first character *<* > Utils.java > I have no idea from where this *<* is coming from, and that changes with the > first character like if it is P it would be *>, when starting with S it gets > appended with Z* > Any help will be appreciated. > Thanks, > Susmit > -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For additional commands, e-mail: dev-h...@mina.apache.org
[jira] [Updated] (SSHD-1209) Write to error stream for custom exception is appending a extra word at the beginning
[ https://issues.apache.org/jira/browse/SSHD-1209?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Susmit Sarkar updated SSHD-1209: Description: Hello Team, We have a class as below {code:java} DetailedSftpErrorStatusDataHandler implements SftpErrorStatusDataHandler, ChannelSessionAware, DetailedSftpErrorStatusDataHandler implements SftpErrorStatusDataHandler, ChannelSessionAware, AsyncCommandErrorStreamAware, CommandDirectErrorStreamAware { {code} and we have overridden the : resolveErrorMessage and setIoErrorStream(IoOutputStream errStream) {code:java} @Override public void setIoErrorStream(IoOutputStream errStream) { this.errStream = errStream; } {code} finally we are writing to the error stream: {code:java} private void writeMsgToErrorStream(String refinedUserExitMessage) { ByteArrayBuffer buf = new ByteArrayBuffer(); buf.putString(refinedUserExitMessage + System.getProperty("line.separator")); try { if (errStream != null) { errStream.writeBuffer(buf); } } catch (Exception e) { } } {code} Once the data is written to error stream we are gettig proper message to the console: !image-2021-08-19-12-50-01-922.png! But there is an extra charater getting appended at the first character *<* Utils.java I have no idea from where this *<* is coming from, and that changes with the first character like if it is P it would be *>, when starting with S it gets appended with Z* Any help will be appreciated. Thanks, Susmit was: Hello Team, We have a class as below {code:java} DetailedSftpErrorStatusDataHandler implements SftpErrorStatusDataHandler, ChannelSessionAware, DetailedSftpErrorStatusDataHandler implements SftpErrorStatusDataHandler, ChannelSessionAware, AsyncCommandErrorStreamAware, CommandDirectErrorStreamAware { {code} and we have overridden the : resolveErrorMessage and setIoErrorStream(IoOutputStream errStream) {code:java} @Override public void setIoErrorStream(IoOutputStream errStream) { this.errStream = errStream; } {code} finally we are writing to the error stream: {code:java} private void writeMsgToErrorStream(String refinedUserExitMessage) { ByteArrayBuffer buf = new ByteArrayBuffer(); buf.putString(refinedUserExitMessage + System.getProperty("line.separator")); try { if (errStream != null) { errStream.writeBuffer(buf); } } catch (Exception e) { } } {code} Once the data is written to error stream we are gettig proper message to the console: !image-2021-08-19-12-50-01-922.png! But there is an extra charater getting appended at the first character *<*Utils.java I have no idea from where this *<* is coming from, and that changes with the first character like if it is P it would be *>, when starting with S it gets appended with Z* Any help will be appreciated. Thanks, Susmit > Write to error stream for custom exception is appending a extra word at the > beginning > - > > Key: SSHD-1209 > URL: https://issues.apache.org/jira/browse/SSHD-1209 > Project: MINA SSHD > Issue Type: Bug >Affects Versions: 2.7.0 >Reporter: Susmit Sarkar >Priority: Major > Attachments: image-2021-08-19-12-50-01-922.png > > > Hello Team, > > We have a class as below > > {code:java} > DetailedSftpErrorStatusDataHandler implements SftpErrorStatusDataHandler, > ChannelSessionAware, DetailedSftpErrorStatusDataHandler implements > SftpErrorStatusDataHandler, ChannelSessionAware, > AsyncCommandErrorStreamAware, CommandDirectErrorStreamAware { > {code} > and we have overridden the : > > resolveErrorMessage and setIoErrorStream(IoOutputStream errStream) > {code:java} > @Override > public void setIoErrorStream(IoOutputStream errStream) { > this.errStream = errStream; > } > {code} > finally we are writing to the error stream: > {code:java} > private void writeMsgToErrorStream(String refinedUserExitMessage) { > ByteArrayBuffer buf = new ByteArrayBuffer(); > buf.putString(refinedUserExitMessage + > System.getProperty("line.separator")); > try { if (errStream != null) { > errStream.writeBuffer(buf); > } > } catch (Exception e) { > } > } > {code} > Once the data is written to error stream we are gettig proper message to the > console: > !image-2021-08-19-12-50-01-922.png! > But there is an extra charater getting appended at the first character *<* > Utils.java > I have no idea from where this *<* is coming from, and that changes with the > first character like if it is P it would be *>, when starting with S it gets > appended with Z* > Any help will be appreciated. > Thanks, > Susmit > -- This message was sent by Atlassian Jira
[jira] [Commented] (SSHD-1209) Write to error stream for custom exception is appending a extra word at the beginning
[ https://issues.apache.org/jira/browse/SSHD-1209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17401510#comment-17401510 ] Susmit Sarkar commented on SSHD-1209: - [~lgoldstein] any guidance will be appretiated > Write to error stream for custom exception is appending a extra word at the > beginning > - > > Key: SSHD-1209 > URL: https://issues.apache.org/jira/browse/SSHD-1209 > Project: MINA SSHD > Issue Type: Bug >Affects Versions: 2.7.0 >Reporter: Susmit Sarkar >Priority: Major > Attachments: image-2021-08-19-12-50-01-922.png > > > Hello Team, > > We have a class as below > > {code:java} > DetailedSftpErrorStatusDataHandler implements SftpErrorStatusDataHandler, > ChannelSessionAware, DetailedSftpErrorStatusDataHandler implements > SftpErrorStatusDataHandler, ChannelSessionAware, > AsyncCommandErrorStreamAware, CommandDirectErrorStreamAware { > {code} > and we have overridden the : > > resolveErrorMessage and setIoErrorStream(IoOutputStream errStream) > {code:java} > @Override > public void setIoErrorStream(IoOutputStream errStream) { > this.errStream = errStream; > } > {code} > finally we are writing to the error stream: > {code:java} > private void writeMsgToErrorStream(String refinedUserExitMessage) { > ByteArrayBuffer buf = new ByteArrayBuffer(); > buf.putString(refinedUserExitMessage + > System.getProperty("line.separator")); > try { if (errStream != null) { > errStream.writeBuffer(buf); > } > } catch (Exception e) { > } > } > {code} > Once the data is written to error stream we are gettig proper message to the > console: > !image-2021-08-19-12-50-01-922.png! > But there is an extra charater getting appended at the first character *<* > Utils.java > I have no idea from where this *<* is coming from, and that changes with the > first character like if it is P it would be *>, when starting with S it gets > appended with Z* > Any help will be appreciated. > Thanks, > Susmit > -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For additional commands, e-mail: dev-h...@mina.apache.org
[jira] [Created] (SSHD-1209) Write to error stream for custom exception is appending a extra word at the beginning
Susmit Sarkar created SSHD-1209: --- Summary: Write to error stream for custom exception is appending a extra word at the beginning Key: SSHD-1209 URL: https://issues.apache.org/jira/browse/SSHD-1209 Project: MINA SSHD Issue Type: Bug Affects Versions: 2.7.0 Reporter: Susmit Sarkar Attachments: image-2021-08-19-12-50-01-922.png Hello Team, We have a class as below {code:java} DetailedSftpErrorStatusDataHandler implements SftpErrorStatusDataHandler, ChannelSessionAware, DetailedSftpErrorStatusDataHandler implements SftpErrorStatusDataHandler, ChannelSessionAware, AsyncCommandErrorStreamAware, CommandDirectErrorStreamAware { {code} and we have overridden the : resolveErrorMessage and setIoErrorStream(IoOutputStream errStream) {code:java} @Override public void setIoErrorStream(IoOutputStream errStream) { this.errStream = errStream; } {code} finally we are writing to the error stream: {code:java} private void writeMsgToErrorStream(String refinedUserExitMessage) { ByteArrayBuffer buf = new ByteArrayBuffer(); buf.putString(refinedUserExitMessage + System.getProperty("line.separator")); try { if (errStream != null) { errStream.writeBuffer(buf); } } catch (Exception e) { } } {code} Once the data is written to error stream we are gettig proper message to the console: !image-2021-08-19-12-50-01-922.png! But there is an extra charater getting appended at the first character *<*Utils.java I have no idea from where this *<* is coming from, and that changes with the first character like if it is P it would be *>, when starting with S it gets appended with Z* Any help will be appreciated. Thanks, Susmit -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For additional commands, e-mail: dev-h...@mina.apache.org