You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by "Thiago Moreira (timba)" <tm...@gmail.com> on 2018/09/03 00:00:43 UTC

Strange behaviour when accessing console via ssh client into a dockernized Karaf

  Hi again,

  I'm upgrading my project from 4.0.9 (ServiceMix-7.0.1) to 4.2.1 but when
I try to access the console via ssh (ssh -p 8101 karaf@myserver.com) I get
all the responses from any command issued in the console with problems,
looks line that there isn't a line break. Check the printscreen below.

[image: Screen Shot 2018-09-02 at 20.51.29.png]

If I access it via *karaf_home/bin/client* it works perfectly.

[image: Screen Shot 2018-09-02 at 20.52.26.png]

  On version 4.0.9/4.0.10 I don't have this issue. What I'm missing?

  Thanks

Thiago Moreira
+55 48 99911-6331

Re: Strange behaviour when accessing console via ssh client into a dockernized Karaf

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Thiago,

I think I have a fix, it will be included in Karaf 4.1.7 and 4.2.2 (plan
for November).

Regards
JB

On 14/09/2018 23:01, Thiago Moreira (timba) wrote:
> 
>   Hey JB, do you have any updates on this? Is the problem related to
> jline/karaf or both?
> 
>   Thanks
> 
> Thiago Moreira
> +55 48 99911-6331
> 
> 
> On Mon, Sep 3, 2018 at 10:45 AM Thiago Moreira (timba)
> <tmoreira2020@gmail.com <ma...@gmail.com>> wrote:
> 
> 
>       Nice JB, if there is anything that I can do for help let me know.
> 
>     Thiago Moreira
>     +55 48 99911-6331
> 
> 
>     On Mon, Sep 3, 2018 at 1:18 AM Jean-Baptiste Onofré <jb@nanthrax.net
>     <ma...@nanthrax.net>> wrote:
> 
>         OK, I saw the response in the mail subject ;)
> 
>         Yeah, I saw that as well when using -tty in the docker. It seems the
>         term type in docker doesn't work fine with jline. I gonna work
>         on a fix
>         for 4.2.2.
> 
>         Regards
>         JB
> 
>         On 03/09/2018 06:06, Jean-Baptiste Onofré wrote:
>         > Hi,
>         >
>         > I guess you are using docker right ?
>         >
>         > Regards
>         > JB
>         >
>         > On 03/09/2018 02:00, Thiago Moreira (timba) wrote:
>         >>
>         >>   Hi again,
>         >>
>         >>   I'm upgrading my project from 4.0.9 (ServiceMix-7.0.1) to
>         4.2.1 but
>         >> when I try to access the console via ssh (ssh -p 8101
>         karaf@myserver.com <ma...@myserver.com>
>         >> <mailto:karaf@myserver.com <ma...@myserver.com>>) I
>         get all the responses from any command
>         >> issued in the console with problems, looks line that there
>         isn't a line
>         >> break. Check the printscreen below.
>         >>
>         >> Screen Shot 2018-09-02 at 20.51.29.png
>         >>
>         >> If I access it via *karaf_home/bin/client* it works perfectly.
>         >>
>         >> Screen Shot 2018-09-02 at 20.52.26.png
>         >>
>         >>   On version 4.0.9/4.0.10 I don't have this issue. What I'm
>         missing?
>         >>
>         >>   Thanks
>         >>   
>         >> Thiago Moreira
>         >> +55 48 99911-6331
>         >
> 
>         -- 
>         Jean-Baptiste Onofré
>         jbonofre@apache.org <ma...@apache.org>
>         http://blog.nanthrax.net
>         Talend - http://www.talend.com
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Strange behaviour when accessing console via ssh client into a dockernized Karaf

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Wouter,

Yes, that's a different issue related to the kind of terminal when using
OpenSSH.

I created a specific Jira about that:
https://issues.apache.org/jira/browse/KARAF-5916

I'm working on a fix for this one in the SshTerminal. It will be
included in Karaf 4.2.2.

Regards
JB

On 16/09/2018 09:41, wborn wrote:
> Hi JB,
> 
> I've also seen this issue occur without using Docker.
> E.g. when I start Karaf 4.2.1 (part of openHAB 2.4.0-SNAPSHOT) from the
> command line in the foreground with the shell console on Ubuntu 16.04.5 and
> then connect to it with SSH.
> So it seems this SSH issue is not limited to Docker environments.
> 
> After  browsing the 4.2.1 tag
> <https://github.com/apache/karaf/commit/04b0d916f3842b19d0f0cdd8f2d3ea40f622405d#diff-79b50e1d21ae311d16c1bd36b1be95f3>  
> in GitHub it seems Karaf 4.2.1 already has the mentioned fix of KARAF-5842,
> although the issue still occurs.
> 
> Regards, Wouter
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Strange behaviour when accessing console via ssh client into a dockernized Karaf

Posted by Steinar Bang <sb...@dod.no>.
>>>>> Jean-Baptiste Onofré <jb...@nanthrax.net>:

> By the way, Karaf 4.1.6 is also affected by this issue (whereas Karaf
> 4.1.5 works fine). So I think it's a change we did in jline, as we
> updated to jline 3.6.2 in Karaf 4.1.6 whereas Karaf 4.1.5 uses jline 3.6.0.

> I think I already have a fix/workaround (I'm testing it locally).

> Anyway, both 4.1.7 and 4.2.2 will include the fix.

Right! I ran into this issue when trying to make a debian package for
4.1.6 (the reason I didn't think I saw it from the targball, was that
there I started karaf from a terminal while with the deb packaged
version I SSH'd in).

So I guess I'll skip deb packaging 4.1.6 and wait for 4.1.7.


Re: Strange behaviour when accessing console via ssh client into a dockernized Karaf

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
By the way, Karaf 4.1.6 is also affected by this issue (whereas Karaf
4.1.5 works fine). So I think it's a change we did in jline, as we
updated to jline 3.6.2 in Karaf 4.1.6 whereas Karaf 4.1.5 uses jline 3.6.0.

I think I already have a fix/workaround (I'm testing it locally).

Anyway, both 4.1.7 and 4.2.2 will include the fix.

Regards
JB

On 16/09/2018 09:41, wborn wrote:
> Hi JB,
> 
> I've also seen this issue occur without using Docker.
> E.g. when I start Karaf 4.2.1 (part of openHAB 2.4.0-SNAPSHOT) from the
> command line in the foreground with the shell console on Ubuntu 16.04.5 and
> then connect to it with SSH.
> So it seems this SSH issue is not limited to Docker environments.
> 
> After  browsing the 4.2.1 tag
> <https://github.com/apache/karaf/commit/04b0d916f3842b19d0f0cdd8f2d3ea40f622405d#diff-79b50e1d21ae311d16c1bd36b1be95f3>  
> in GitHub it seems Karaf 4.2.1 already has the mentioned fix of KARAF-5842,
> although the issue still occurs.
> 
> Regards, Wouter
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Strange behaviour when accessing console via ssh client into a dockernized Karaf

Posted by wborn <ap...@maindrain.net>.
Hi JB,

I've also seen this issue occur without using Docker.
E.g. when I start Karaf 4.2.1 (part of openHAB 2.4.0-SNAPSHOT) from the
command line in the foreground with the shell console on Ubuntu 16.04.5 and
then connect to it with SSH.
So it seems this SSH issue is not limited to Docker environments.

After  browsing the 4.2.1 tag
<https://github.com/apache/karaf/commit/04b0d916f3842b19d0f0cdd8f2d3ea40f622405d#diff-79b50e1d21ae311d16c1bd36b1be95f3>  
in GitHub it seems Karaf 4.2.1 already has the mentioned fix of KARAF-5842,
although the issue still occurs.

Regards, Wouter



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Strange behaviour when accessing console via ssh client into a dockernized Karaf

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Thiago,

FYI, the problem is already fixed on Karaf 4.2.2-SNAPSHOT.

The problem is that the size of the terminal columns size is set to 0
while running in Docker.
So, the fix is simply to set a "correct" size when size is 0:

        if (jlineTerminal.getSize().getColumns() == 0) {
            jlineTerminal.setSize(new Size(80, 24));
        }

I'm backporting this fix on Karaf 4.1.x branch as well.

Regards
JB

On 14/09/2018 23:01, Thiago Moreira (timba) wrote:
> 
>   Hey JB, do you have any updates on this? Is the problem related to
> jline/karaf or both?
> 
>   Thanks
> 
> Thiago Moreira
> +55 48 99911-6331
> 
> 
> On Mon, Sep 3, 2018 at 10:45 AM Thiago Moreira (timba)
> <tmoreira2020@gmail.com <ma...@gmail.com>> wrote:
> 
> 
>       Nice JB, if there is anything that I can do for help let me know.
> 
>     Thiago Moreira
>     +55 48 99911-6331
> 
> 
>     On Mon, Sep 3, 2018 at 1:18 AM Jean-Baptiste Onofré <jb@nanthrax.net
>     <ma...@nanthrax.net>> wrote:
> 
>         OK, I saw the response in the mail subject ;)
> 
>         Yeah, I saw that as well when using -tty in the docker. It seems the
>         term type in docker doesn't work fine with jline. I gonna work
>         on a fix
>         for 4.2.2.
> 
>         Regards
>         JB
> 
>         On 03/09/2018 06:06, Jean-Baptiste Onofré wrote:
>         > Hi,
>         >
>         > I guess you are using docker right ?
>         >
>         > Regards
>         > JB
>         >
>         > On 03/09/2018 02:00, Thiago Moreira (timba) wrote:
>         >>
>         >>   Hi again,
>         >>
>         >>   I'm upgrading my project from 4.0.9 (ServiceMix-7.0.1) to
>         4.2.1 but
>         >> when I try to access the console via ssh (ssh -p 8101
>         karaf@myserver.com <ma...@myserver.com>
>         >> <mailto:karaf@myserver.com <ma...@myserver.com>>) I
>         get all the responses from any command
>         >> issued in the console with problems, looks line that there
>         isn't a line
>         >> break. Check the printscreen below.
>         >>
>         >> Screen Shot 2018-09-02 at 20.51.29.png
>         >>
>         >> If I access it via *karaf_home/bin/client* it works perfectly.
>         >>
>         >> Screen Shot 2018-09-02 at 20.52.26.png
>         >>
>         >>   On version 4.0.9/4.0.10 I don't have this issue. What I'm
>         missing?
>         >>
>         >>   Thanks
>         >>   
>         >> Thiago Moreira
>         >> +55 48 99911-6331
>         >
> 
>         -- 
>         Jean-Baptiste Onofré
>         jbonofre@apache.org <ma...@apache.org>
>         http://blog.nanthrax.net
>         Talend - http://www.talend.com
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Strange behaviour when accessing console via ssh client into a dockernized Karaf

Posted by "Thiago Moreira (timba)" <tm...@gmail.com>.
  Hey JB, do you have any updates on this? Is the problem related to
jline/karaf or both?

  Thanks

Thiago Moreira
+55 48 99911-6331


On Mon, Sep 3, 2018 at 10:45 AM Thiago Moreira (timba) <
tmoreira2020@gmail.com> wrote:

>
>   Nice JB, if there is anything that I can do for help let me know.
>
> Thiago Moreira
> +55 48 99911-6331
>
>
> On Mon, Sep 3, 2018 at 1:18 AM Jean-Baptiste Onofré <jb...@nanthrax.net>
> wrote:
>
>> OK, I saw the response in the mail subject ;)
>>
>> Yeah, I saw that as well when using -tty in the docker. It seems the
>> term type in docker doesn't work fine with jline. I gonna work on a fix
>> for 4.2.2.
>>
>> Regards
>> JB
>>
>> On 03/09/2018 06:06, Jean-Baptiste Onofré wrote:
>> > Hi,
>> >
>> > I guess you are using docker right ?
>> >
>> > Regards
>> > JB
>> >
>> > On 03/09/2018 02:00, Thiago Moreira (timba) wrote:
>> >>
>> >>   Hi again,
>> >>
>> >>   I'm upgrading my project from 4.0.9 (ServiceMix-7.0.1) to 4.2.1 but
>> >> when I try to access the console via ssh (ssh -p 8101
>> karaf@myserver.com
>> >> <ma...@myserver.com>) I get all the responses from any command
>> >> issued in the console with problems, looks line that there isn't a line
>> >> break. Check the printscreen below.
>> >>
>> >> Screen Shot 2018-09-02 at 20.51.29.png
>> >>
>> >> If I access it via *karaf_home/bin/client* it works perfectly.
>> >>
>> >> Screen Shot 2018-09-02 at 20.52.26.png
>> >>
>> >>   On version 4.0.9/4.0.10 I don't have this issue. What I'm missing?
>> >>
>> >>   Thanks
>> >>
>> >> Thiago Moreira
>> >> +55 48 99911-6331
>> >
>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>

Re: Strange behaviour when accessing console via ssh client into a dockernized Karaf

Posted by "Thiago Moreira (timba)" <tm...@gmail.com>.
  Nice JB, if there is anything that I can do for help let me know.

Thiago Moreira
+55 48 99911-6331


On Mon, Sep 3, 2018 at 1:18 AM Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:

> OK, I saw the response in the mail subject ;)
>
> Yeah, I saw that as well when using -tty in the docker. It seems the
> term type in docker doesn't work fine with jline. I gonna work on a fix
> for 4.2.2.
>
> Regards
> JB
>
> On 03/09/2018 06:06, Jean-Baptiste Onofré wrote:
> > Hi,
> >
> > I guess you are using docker right ?
> >
> > Regards
> > JB
> >
> > On 03/09/2018 02:00, Thiago Moreira (timba) wrote:
> >>
> >>   Hi again,
> >>
> >>   I'm upgrading my project from 4.0.9 (ServiceMix-7.0.1) to 4.2.1 but
> >> when I try to access the console via ssh (ssh -p 8101
> karaf@myserver.com
> >> <ma...@myserver.com>) I get all the responses from any command
> >> issued in the console with problems, looks line that there isn't a line
> >> break. Check the printscreen below.
> >>
> >> Screen Shot 2018-09-02 at 20.51.29.png
> >>
> >> If I access it via *karaf_home/bin/client* it works perfectly.
> >>
> >> Screen Shot 2018-09-02 at 20.52.26.png
> >>
> >>   On version 4.0.9/4.0.10 I don't have this issue. What I'm missing?
> >>
> >>   Thanks
> >>
> >> Thiago Moreira
> >> +55 48 99911-6331
> >
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

Re: Strange behaviour when accessing console via ssh client into a dockernized Karaf

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
OK, I saw the response in the mail subject ;)

Yeah, I saw that as well when using -tty in the docker. It seems the
term type in docker doesn't work fine with jline. I gonna work on a fix
for 4.2.2.

Regards
JB

On 03/09/2018 06:06, Jean-Baptiste Onofré wrote:
> Hi,
> 
> I guess you are using docker right ?
> 
> Regards
> JB
> 
> On 03/09/2018 02:00, Thiago Moreira (timba) wrote:
>>
>>   Hi again,
>>
>>   I'm upgrading my project from 4.0.9 (ServiceMix-7.0.1) to 4.2.1 but
>> when I try to access the console via ssh (ssh -p 8101 karaf@myserver.com
>> <ma...@myserver.com>) I get all the responses from any command
>> issued in the console with problems, looks line that there isn't a line
>> break. Check the printscreen below.
>>
>> Screen Shot 2018-09-02 at 20.51.29.png
>>
>> If I access it via *karaf_home/bin/client* it works perfectly.
>>
>> Screen Shot 2018-09-02 at 20.52.26.png
>>
>>   On version 4.0.9/4.0.10 I don't have this issue. What I'm missing?
>>
>>   Thanks
>>   
>> Thiago Moreira
>> +55 48 99911-6331
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Strange behaviour when accessing console via ssh client into a dockernized Karaf

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

I guess you are using docker right ?

Regards
JB

On 03/09/2018 02:00, Thiago Moreira (timba) wrote:
> 
>   Hi again,
> 
>   I'm upgrading my project from 4.0.9 (ServiceMix-7.0.1) to 4.2.1 but
> when I try to access the console via ssh (ssh -p 8101 karaf@myserver.com
> <ma...@myserver.com>) I get all the responses from any command
> issued in the console with problems, looks line that there isn't a line
> break. Check the printscreen below.
> 
> Screen Shot 2018-09-02 at 20.51.29.png
> 
> If I access it via *karaf_home/bin/client* it works perfectly.
> 
> Screen Shot 2018-09-02 at 20.52.26.png
> 
>   On version 4.0.9/4.0.10 I don't have this issue. What I'm missing?
> 
>   Thanks
>   
> Thiago Moreira
> +55 48 99911-6331

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com