You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Bernd Fondermann <be...@googlemail.com> on 2010/02/19 17:42:07 UTC

[sshd] Output for errOut goes to stdOut

Hi,

I'm connecting to a remote machine using
org.apache.sshd.ClientSession.createChannel("shell");
I'm setting
  channel.setOut(outputListener);
  channel.setErr(errorListener);
to two distinct sinks.
Now, when I invoke an unexisting command on the other machine
directly, like this:
  pommes >std.out 2>err.out
I'll find that - as expected - std.out is empty and err.out contains
  -bash: pommes: command not found
while invoking this command (without output redirection) via sshd client,
I'll get the same error message via "out", none via "err".
With a debugger I could confirm that
  org.apache.sshd.client.channel.AbstractClientChannel.doWriteExtendedData()
never get's called.

What's it I'm doing wrong here?

Thanks,

  Bernd

Re: [sshd] Output for errOut goes to stdOut

Posted by Bernd Fondermann <be...@googlemail.com>.
I resolved the issue in JIRA.

Thanks Guillaume for looking into this.
At least, the behavior is now documented.

  Bernd

On Sun, Feb 21, 2010 at 12:20, Bernd Fondermann
<be...@googlemail.com> wrote:
> Opened SSHD-76 with more info.
>
> Thanks,
>
>  Bernd
>
> On Fri, Feb 19, 2010 at 18:05, Guillaume Nodet <gn...@gmail.com> wrote:
>> I'm not aware of any problem like that.
>> Are you connecting to a native ssh server or the one from SSHD ?
>> Also could you try to set the log level to DEBUG on the client side
>> and see if you see a SSH_MSG_CHANNEL_FAILURE somehow ?
>> Maybe you could set up a small test case I could try and debug ?
>>
>> On Fri, Feb 19, 2010 at 17:42, Bernd Fondermann
>> <be...@googlemail.com> wrote:
>>> Hi,
>>>
>>> I'm connecting to a remote machine using
>>> org.apache.sshd.ClientSession.createChannel("shell");
>>> I'm setting
>>>  channel.setOut(outputListener);
>>>  channel.setErr(errorListener);
>>> to two distinct sinks.
>>> Now, when I invoke an unexisting command on the other machine
>>> directly, like this:
>>>  pommes >std.out 2>err.out
>>> I'll find that - as expected - std.out is empty and err.out contains
>>>  -bash: pommes: command not found
>>> while invoking this command (without output redirection) via sshd client,
>>> I'll get the same error message via "out", none via "err".
>>> With a debugger I could confirm that
>>>  org.apache.sshd.client.channel.AbstractClientChannel.doWriteExtendedData()
>>> never get's called.
>>>
>>> What's it I'm doing wrong here?
>>>
>>> Thanks,
>>>
>>>  Bernd
>>>
>>
>>
>>
>> --
>> Cheers,
>> Guillaume Nodet
>> ------------------------
>> Blog: http://gnodet.blogspot.com/
>> ------------------------
>> Open Source SOA
>> http://fusesource.com
>>
>

Re: [sshd] Output for errOut goes to stdOut

Posted by Bernd Fondermann <be...@googlemail.com>.
Opened SSHD-76 with more info.

Thanks,

  Bernd

On Fri, Feb 19, 2010 at 18:05, Guillaume Nodet <gn...@gmail.com> wrote:
> I'm not aware of any problem like that.
> Are you connecting to a native ssh server or the one from SSHD ?
> Also could you try to set the log level to DEBUG on the client side
> and see if you see a SSH_MSG_CHANNEL_FAILURE somehow ?
> Maybe you could set up a small test case I could try and debug ?
>
> On Fri, Feb 19, 2010 at 17:42, Bernd Fondermann
> <be...@googlemail.com> wrote:
>> Hi,
>>
>> I'm connecting to a remote machine using
>> org.apache.sshd.ClientSession.createChannel("shell");
>> I'm setting
>>  channel.setOut(outputListener);
>>  channel.setErr(errorListener);
>> to two distinct sinks.
>> Now, when I invoke an unexisting command on the other machine
>> directly, like this:
>>  pommes >std.out 2>err.out
>> I'll find that - as expected - std.out is empty and err.out contains
>>  -bash: pommes: command not found
>> while invoking this command (without output redirection) via sshd client,
>> I'll get the same error message via "out", none via "err".
>> With a debugger I could confirm that
>>  org.apache.sshd.client.channel.AbstractClientChannel.doWriteExtendedData()
>> never get's called.
>>
>> What's it I'm doing wrong here?
>>
>> Thanks,
>>
>>  Bernd
>>
>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
>

Re: [sshd] Output for errOut goes to stdOut

Posted by Guillaume Nodet <gn...@gmail.com>.
I'm not aware of any problem like that.
Are you connecting to a native ssh server or the one from SSHD ?
Also could you try to set the log level to DEBUG on the client side
and see if you see a SSH_MSG_CHANNEL_FAILURE somehow ?
Maybe you could set up a small test case I could try and debug ?

On Fri, Feb 19, 2010 at 17:42, Bernd Fondermann
<be...@googlemail.com> wrote:
> Hi,
>
> I'm connecting to a remote machine using
> org.apache.sshd.ClientSession.createChannel("shell");
> I'm setting
>  channel.setOut(outputListener);
>  channel.setErr(errorListener);
> to two distinct sinks.
> Now, when I invoke an unexisting command on the other machine
> directly, like this:
>  pommes >std.out 2>err.out
> I'll find that - as expected - std.out is empty and err.out contains
>  -bash: pommes: command not found
> while invoking this command (without output redirection) via sshd client,
> I'll get the same error message via "out", none via "err".
> With a debugger I could confirm that
>  org.apache.sshd.client.channel.AbstractClientChannel.doWriteExtendedData()
> never get's called.
>
> What's it I'm doing wrong here?
>
> Thanks,
>
>  Bernd
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com