Uploaded image for project: 'odlparent'
  1. odlparent
  2. ODLPARENT-170

Karaf CLI "java.util.regex.PatternSyntaxException: Illegal repetition near index" when running in container and using dumb terminal

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Medium Medium
    • None
    • None
    • Karaf
    • None

      While investigating GENIUS-211 and using https://github.com/jhershberg/netvirt-ha-docker to run ODL clustered in a container, I've come accross this curious problem:

      [laptop-host] $ ./karaf-client 1
      [container] opendaylight-user@root> shell:stack-traces-print
      [container] opendaylight-user@root>showSvcStatus --help     
      DESCRIPTION
              diagstatus:showSvcStatus
      
      	show the status of registered services
      
      SYNTAX
              diagstatus:showSvcStatus [options]
      
      OPTIONS
              --help
      java.util.regex.PatternSyntaxException: Illegal repetition near index 4
      (\S\S{-16,}|.{1,-16})(\s+|$)
          ^
      	at java.util.regex.Pattern.error(Pattern.java:1957)
      	at java.util.regex.Pattern.closure(Pattern.java:3159)
      	at java.util.regex.Pattern.sequence(Pattern.java:2136)
      	at java.util.regex.Pattern.expr(Pattern.java:1998)
      	at java.util.regex.Pattern.group0(Pattern.java:2907)
      	at java.util.regex.Pattern.sequence(Pattern.java:2053)
      	at java.util.regex.Pattern.expr(Pattern.java:1998)
      	at java.util.regex.Pattern.compile(Pattern.java:1698)
      	at java.util.regex.Pattern.<init>(Pattern.java:1351)
      	at java.util.regex.Pattern.compile(Pattern.java:1028)
      	at org.apache.karaf.shell.impl.action.command.DefaultActionPreparator.printFormatted(DefaultActionPreparator.java:440)
      	at org.apache.karaf.shell.impl.action.command.DefaultActionPreparator.printUsage(DefaultActionPreparator.java:384)
      	at org.apache.karaf.shell.impl.action.command.DefaultActionPreparator.prepare(DefaultActionPreparator.java:98)
      	at org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:83)
      	at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68)
      	at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86)
      	at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:571)
      	at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:497)
      	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:386)
      	at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:417)
      	at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229)
      	at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)

      What is fun is that if I do the exact same thing on a Karaf running locally outside of the container, with the exact same code (I'm using the binary which jhershberg/netvirt-ha-docker copied into the container), this this does not happen... so must have something to do with running in container and using dumb terminal (where "cursor arrow up" prints "^[[A" instead of working history).

      May be it's somehow related to the @Option(name = "-n", aliases = {"--node"}) String nip; in DiagStatusCommand, because the exception above seem to happen just as it's about to print that option, here is the output from when it works (note how the -n, --node is missing above!):

      opendaylight-user@root>showSvcStatus --help
      DESCRIPTION
              diagstatus:showSvcStatus
      
      	show the status of registered services
      
      SYNTAX
              diagstatus:showSvcStatus [options]
      
      OPTIONS
              --help
                      Display this help message
              -n, --node

      So definitely very minor, and only filing this here for reference; not important enough to jump on fixing it; skitt FYI.

            Unassigned Unassigned
            vorburger Michael Vorburger
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: