Uploaded image for project: 'CDAP'
  1. CDAP
  2. CDAP-7501

CDAP Router should have some startup checks

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 4.0.0, 3.6.0, 3.5.1
    • Fix Version/s: None
    • Component/s: Router
    • Labels:
      None
    • Rank:
      1|hzznin:

      Description

      If router is misconfigured, it should fail to startup. For instance, setting 'router.bypass.auth.regex' to '*', will result in the below error logs to appear in router logs every second.
      It seems like router is stuck in an initializing state. Instead, router should error out when the user attempts to start it.

      Oct 21, 2016 6:25:27 PM org.jboss.netty.channel.socket.nio.AbstractNioSelector
      WARNING: Failed to initialize an accepted socket.
      java.lang.IllegalArgumentException: Invalid regular expression for router.bypass.auth.regex
              at co.cask.cdap.gateway.router.handlers.SecurityAuthenticationHttpHandler.createMatcher(SecurityAuthenticationHttpHandler.java:96)
              at co.cask.cdap.gateway.router.handlers.SecurityAuthenticationHttpHandler.<init>(SecurityAuthenticationHttpHandler.java:86)
              at co.cask.cdap.gateway.router.NettyRouter$4.getPipeline(NettyRouter.java:256)
              at org.jboss.netty.channel.socket.nio.NioServerBoss.registerAcceptedChannel(NioServerBoss.java:134)
              at org.jboss.netty.channel.socket.nio.NioServerBoss.process(NioServerBoss.java:104)
              at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312)
              at org.jboss.netty.channel.socket.nio.NioServerBoss.run(NioServerBoss.java:42)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
              at java.lang.Thread.run(Thread.java:745)
      Caused by: java.util.regex.PatternSyntaxException: Dangling meta character '*' near index 0
      *
      ^
              at java.util.regex.Pattern.error(Pattern.java:1924)
              at java.util.regex.Pattern.sequence(Pattern.java:2090)
              at java.util.regex.Pattern.expr(Pattern.java:1964)
              at java.util.regex.Pattern.compile(Pattern.java:1665)
              at java.util.regex.Pattern.<init>(Pattern.java:1337)
              at java.util.regex.Pattern.compile(Pattern.java:1022)
              at co.cask.cdap.gateway.router.handlers.SecurityAuthenticationHttpHandler.createMatcher(SecurityAuthenticationHttpHandler.java:94)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                nitin Nitin Motgi
                Reporter:
                ali.anwar Ali Anwar
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: