Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.6
    • Fix Version/s: 2.2.11, 2.3.1, 3.0.0
    • Component/s: karaf-shell
    • Labels:
      None

      Description

      apache-karaf-2.2.6\bin>client -a 8101 -h localhost -u karaf -p karaf bundles:list

      No output; log contains exception

      2012-04-05 14:52:18,921 | WARN | NioProcessor-3 | ServerSession | d.common.session.AbstractSession 253 | 22 - sshd-core - 0.5.0 | Exception caught
      java.io.IOException: Unable to start shell
      at org.apache.karaf.shell.ssh.ShellCommandFactory$ShellCommand.start(ShellCommandFactory.java:104)[14:org.apache.karaf.shell.ssh:2.2.6]
      at org.apache.sshd.server.channel.ChannelSession.handleExec(ChannelSession.java:398)[22:sshd-core:0.5.0]
      at org.apache.sshd.server.channel.ChannelSession.handleRequest(ChannelSession.java:232)[22:sshd-core:0.5.0]
      at org.apache.sshd.server.channel.ChannelSession.handleRequest(ChannelSession.java:194)[22:sshd-core:0.5.0]
      at org.apache.sshd.common.session.AbstractSession.channelRequest(AbstractSession.java:999)[22:sshd-core:0.5.0]
      at org.apache.sshd.server.session.ServerSession.handleMessage(ServerSession.java:210)[22:sshd-core:0.5.0]
      at org.apache.sshd.common.session.AbstractSession.decode(AbstractSession.java:522)[22:sshd-core:0.5.0]
      at org.apache.sshd.common.session.AbstractSession.messageReceived(AbstractSession.java:225)[22:sshd-core:0.5.0]
      at org.apache.sshd.common.AbstractSessionIoHandler.messageReceived(AbstractSessionIoHandler.java:58)[22:sshd-core:0.5.0]
      at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:716)[34:org.apache.mina.core:2.0.1]
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)[34:org.apache.mina.core:2.0.1]
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)[34:org.apache.mina.core:2.0.1]
      at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)[34:org.apache.mina.core:2.0.1]
      at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119)[34:org.apache.mina.core:2.0.1]
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)[34:org.apache.mina.core:2.0.1]
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426)[34:org.apache.mina.core:2.0.1]
      at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:692)[34:org.apache.mina.core:2.0.1]
      at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:645)[34:org.apache.mina.core:2.0.1]
      at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:634)[34:org.apache.mina.core:2.0.1]
      at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:66)[34:org.apache.mina.core:2.0.1]
      at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1078)[34:org.apache.mina.core:2.0.1]
      at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)[34:org.apache.mina.core:2.0.1]
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_31]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_31]
      at java.lang.Thread.run(Thread.java:662)[:1.6.0_31]
      Caused by: org.apache.felix.gogo.runtime.CommandNotFoundException: Command not found: bundles:list
      at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:471)
      at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)
      at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
      at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
      at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
      at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
      at org.apache.karaf.shell.ssh.ShellCommandFactory$ShellCommand$1.run(ShellCommandFactory.java:93)
      at java.security.AccessController.doPrivileged(Native Method)[:1.6.0_31]
      at javax.security.auth.Subject.doAs(Subject.java:396)[:1.6.0_31]
      at org.apache.karaf.shell.ssh.ShellCommandFactory$ShellCommand.start(ShellCommandFactory.java:91)[14:org.apache.karaf.shell.ssh:2.2.6]
      ... 24 more

        Activity

        Hide
        jkindler Jürgen Kindler added a comment - - edited

        Works for me! (using Karaf 2.3.1)

        Show
        jkindler Jürgen Kindler added a comment - - edited Works for me! (using Karaf 2.3.1)
        Show
        jbonofre Jean-Baptiste Onofré added a comment - Fixed on karaf-2.2.x: http://svn.apache.org/viewvc?view=revision&revision=1449721
        Show
        jbonofre Jean-Baptiste Onofré added a comment - Fixed on karaf-2.3.x: http://svn.apache.org/viewvc?view=revision&revision=1449624
        Show
        jbonofre Jean-Baptiste Onofré added a comment - Fixed on trunk: http://svn.apache.org/viewvc?view=revision&revision=1449616
        Hide
        jbonofre Jean-Baptiste Onofré added a comment -

        OK, the issue is that the SSH ShellCommand (SSH server side) doesn't load the shell.init.script when executing "outside" of a shell context.

        I'm adding the loading of the aliases there.

        Show
        jbonofre Jean-Baptiste Onofré added a comment - OK, the issue is that the SSH ShellCommand (SSH server side) doesn't load the shell.init.script when executing "outside" of a shell context. I'm adding the loading of the aliases there.
        Hide
        jbonofre Jean-Baptiste Onofré added a comment -

        Same behavior with Karaf 3.0.0-SNAPSHOT.

        Show
        jbonofre Jean-Baptiste Onofré added a comment - Same behavior with Karaf 3.0.0-SNAPSHOT.
        Hide
        jbonofre Jean-Baptiste Onofré added a comment -

        I tested with Karaf 2.3.1-SNAPSHOT, with a simple:

        ssh -p 8101 karaf@localhost la

        and it doesn't work.

        If I type the la alias in the client in the shell console (connected using ssh -p 8101 karaf@localhost), it works fine.

        So, the problem seems to be in the Karaf commands directly appended to the ssh client command.

        Show
        jbonofre Jean-Baptiste Onofré added a comment - I tested with Karaf 2.3.1-SNAPSHOT, with a simple: ssh -p 8101 karaf@localhost la and it doesn't work. If I type the la alias in the client in the shell console (connected using ssh -p 8101 karaf@localhost), it works fine. So, the problem seems to be in the Karaf commands directly appended to the ssh client command.
        Hide
        jgoodyear Jamie goodyear added a comment -

        Bumping out to 2.2.10

        Show
        jgoodyear Jamie goodyear added a comment - Bumping out to 2.2.10
        Hide
        jbonofre Jean-Baptiste Onofré added a comment -

        The main difference is that on trunk bundle:list is a "real" command, whereas on karaf 2.2.x (and 2.3.x), it's an alias to osgi:list.

        I'm quite sure that the problem is around shell.init.script loading.

        Show
        jbonofre Jean-Baptiste Onofré added a comment - The main difference is that on trunk bundle:list is a "real" command, whereas on karaf 2.2.x (and 2.3.x), it's an alias to osgi:list. I'm quite sure that the problem is around shell.init.script loading.
        Hide
        chris@die-schneider.net Christian Schneider added a comment -

        Could not reproduce in 3.0.0-SNAPSHOT:
        C:\java\apache-karaf-3.0.0-SNAPSHOT\bin>client -a 8101 -h localhost -u karaf -p karaf bundle:list
        START LEVEL 100 , List Threshold: 50
        ID State Level Name
        [ 169] [ Active] [ 50] Apache CXF Compatibility Bundle Jar (2.6.1.SNAPSHOT)

        Show
        chris@die-schneider.net Christian Schneider added a comment - Could not reproduce in 3.0.0-SNAPSHOT: C:\java\apache-karaf-3.0.0-SNAPSHOT\bin>client -a 8101 -h localhost -u karaf -p karaf bundle:list START LEVEL 100 , List Threshold: 50 ID State Level Name [ 169] [ Active] [ 50] Apache CXF Compatibility Bundle Jar (2.6.1.SNAPSHOT)
        Hide
        chris@die-schneider.net Christian Schneider added a comment -

        removing 3.0.0 as it worked fine there

        Show
        chris@die-schneider.net Christian Schneider added a comment - removing 3.0.0 as it worked fine there
        Hide
        chris@die-schneider.net Christian Schneider added a comment -

        I just tried with the following command on trunk and it worked

        sshd
        ssh -l karaf -P karaf -p 8101 localhost bundle:list

        Show
        chris@die-schneider.net Christian Schneider added a comment - I just tried with the following command on trunk and it worked sshd ssh -l karaf -P karaf -p 8101 localhost bundle:list
        Hide
        amarkevich Alexey Markevich added a comment -

        *bundle:list of course

        Show
        amarkevich Alexey Markevich added a comment - *bundle:list of course

          People

          • Assignee:
            jbonofre Jean-Baptiste Onofré
            Reporter:
            amarkevich Alexey Markevich
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development