Uploaded image for project: 'Ratis'
  1. Ratis
  2. RATIS-1736

Fix ratis-shell can't work in branch-2

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.4.0
    • 2.4.1
    • shell
    • None

    Description

      The ratis-shell of Ratis 2.4.0 release does not work, and the related error logs are as follows:

      bin/ratis sh group info -peers localhost:19200,localhost:19201,localhost:19202
      [main] INFO org.reflections.Reflections - Reflections took 57 ms to scan 1 urls, producing 5 keys and 18 values
      java.lang.NoClassDefFoundError: com/codahale/metrics/MetricRegistry
              at org.apache.ratis.metrics.MetricRegistryInfo.<init>(MetricRegistryInfo.java:52)
              at org.apache.ratis.grpc.metrics.MessageMetrics.<init>(MessageMetrics.java:34)
              at org.apache.ratis.grpc.metrics.intercept.client.MetricClientInterceptor.<init>(MetricClientInterceptor.java:38)
              at org.apache.ratis.grpc.client.GrpcClientProtocolClient.<init>(GrpcClientProtocolClient.java:105)
              at org.apache.ratis.grpc.client.GrpcClientRpc.lambda$new$0(GrpcClientRpc.java:59)
              at org.apache.ratis.util.PeerProxyMap$PeerAndProxy.lambda$getProxy$0(PeerProxyMap.java:64)
              at org.apache.ratis.util.LifeCycle.startAndTransition(LifeCycle.java:270)
              at org.apache.ratis.util.PeerProxyMap$PeerAndProxy.getProxy(PeerProxyMap.java:63)
              at org.apache.ratis.util.PeerProxyMap.getProxy(PeerProxyMap.java:115)
              at org.apache.ratis.grpc.client.GrpcClientRpc.sendRequest(GrpcClientRpc.java:94)
              at org.apache.ratis.client.impl.BlockingImpl.sendRequest(BlockingImpl.java:134)
              at org.apache.ratis.client.impl.BlockingImpl.sendRequestWithRetry(BlockingImpl.java:99)
              at org.apache.ratis.client.impl.GroupManagementImpl.list(GroupManagementImpl.java:69)
              at org.apache.ratis.shell.cli.sh.command.AbstractRatisCommand.lambda$run$1(AbstractRatisCommand.java:120)
              at org.apache.ratis.shell.cli.sh.command.AbstractRatisCommand.run(AbstractRatisCommand.java:75)
              at org.apache.ratis.shell.cli.sh.command.AbstractRatisCommand.run(AbstractRatisCommand.java:119)
              at org.apache.ratis.shell.cli.sh.group.GroupInfoCommand.run(GroupInfoCommand.java:47)
              at org.apache.ratis.shell.cli.AbstractShell.run(AbstractShell.java:104)
              at org.apache.ratis.shell.cli.sh.RatisShell.main(RatisShell.java:43)
      Caused by: java.lang.ClassNotFoundException: com.codahale.metrics.MetricRegistry
              at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
              ... 19 more
      java.lang.NoClassDefFoundError: com/codahale/metrics/MetricRegistry
              at org.apache.ratis.metrics.MetricRegistryInfo.<init>(MetricRegistryInfo.java:52)
              at org.apache.ratis.grpc.metrics.MessageMetrics.<init>(MessageMetrics.java:34)
              at org.apache.ratis.grpc.metrics.intercept.client.MetricClientInterceptor.<init>(MetricClientInterceptor.java:38)
              at org.apache.ratis.grpc.client.GrpcClientProtocolClient.<init>(GrpcClientProtocolClient.java:105)
              at org.apache.ratis.grpc.client.GrpcClientRpc.lambda$new$0(GrpcClientRpc.java:59)
              at org.apache.ratis.util.PeerProxyMap$PeerAndProxy.lambda$getProxy$0(PeerProxyMap.java:64)
              at org.apache.ratis.util.LifeCycle.startAndTransition(LifeCycle.java:270)
              at org.apache.ratis.util.PeerProxyMap$PeerAndProxy.getProxy(PeerProxyMap.java:63)
              at org.apache.ratis.util.PeerProxyMap.getProxy(PeerProxyMap.java:115)
              at org.apache.ratis.grpc.client.GrpcClientRpc.sendRequest(GrpcClientRpc.java:94)
              at org.apache.ratis.client.impl.BlockingImpl.sendRequest(BlockingImpl.java:134)
              at org.apache.ratis.client.impl.BlockingImpl.sendRequestWithRetry(BlockingImpl.java:99)
              at org.apache.ratis.client.impl.GroupManagementImpl.list(GroupManagementImpl.java:69)
              at org.apache.ratis.shell.cli.sh.command.AbstractRatisCommand.lambda$run$1(AbstractRatisCommand.java:120)
              at org.apache.ratis.shell.cli.sh.command.AbstractRatisCommand.run(AbstractRatisCommand.java:75)
              at org.apache.ratis.shell.cli.sh.command.AbstractRatisCommand.run(AbstractRatisCommand.java:119)
              at org.apache.ratis.shell.cli.sh.group.GroupInfoCommand.run(GroupInfoCommand.java:47)
              at org.apache.ratis.shell.cli.AbstractShell.run(AbstractShell.java:104)
              at org.apache.ratis.shell.cli.sh.RatisShell.main(RatisShell.java:43)
      java.lang.NoClassDefFoundError: com/codahale/metrics/MetricRegistry
              at org.apache.ratis.metrics.MetricRegistryInfo.<init>(MetricRegistryInfo.java:52)
              at org.apache.ratis.grpc.metrics.MessageMetrics.<init>(MessageMetrics.java:34)
              at org.apache.ratis.grpc.metrics.intercept.client.MetricClientInterceptor.<init>(MetricClientInterceptor.java:38)
              at org.apache.ratis.grpc.client.GrpcClientProtocolClient.<init>(GrpcClientProtocolClient.java:105)
              at org.apache.ratis.grpc.client.GrpcClientRpc.lambda$new$0(GrpcClientRpc.java:59)
              at org.apache.ratis.util.PeerProxyMap$PeerAndProxy.lambda$getProxy$0(PeerProxyMap.java:64)
              at org.apache.ratis.util.LifeCycle.startAndTransition(LifeCycle.java:270)
              at org.apache.ratis.util.PeerProxyMap$PeerAndProxy.getProxy(PeerProxyMap.java:63)
              at org.apache.ratis.util.PeerProxyMap.getProxy(PeerProxyMap.java:115)
              at org.apache.ratis.grpc.client.GrpcClientRpc.sendRequest(GrpcClientRpc.java:94)
              at org.apache.ratis.client.impl.BlockingImpl.sendRequest(BlockingImpl.java:134)
              at org.apache.ratis.client.impl.BlockingImpl.sendRequestWithRetry(BlockingImpl.java:99)
              at org.apache.ratis.client.impl.GroupManagementImpl.list(GroupManagementImpl.java:69)
              at org.apache.ratis.shell.cli.sh.command.AbstractRatisCommand.lambda$run$1(AbstractRatisCommand.java:120)
              at org.apache.ratis.shell.cli.sh.command.AbstractRatisCommand.run(AbstractRatisCommand.java:75)
              at org.apache.ratis.shell.cli.sh.command.AbstractRatisCommand.run(AbstractRatisCommand.java:119)
              at org.apache.ratis.shell.cli.sh.group.GroupInfoCommand.run(GroupInfoCommand.java:47)
              at org.apache.ratis.shell.cli.AbstractShell.run(AbstractShell.java:104)
              at org.apache.ratis.shell.cli.sh.RatisShell.main(RatisShell.java:43)
      Failed to get group ID from [localhost_19200|rpc:localhost:19200|priority:0|startupRole:FOLLOWER, localhost_19201|rpc:localhost:19201|priority:0|startupRole:FOLLOWER, localhost_19202|rpc:localhost:19202|priority:0|startupRole:FOLLOWER]
      group id: c4fcc968-e6aa-40f2-98c6-b5d4d6d88446
      null
      [main] ERROR org.apache.ratis.shell.cli.AbstractShell - Error running group info -peers localhost:19200,localhost:19201,localhost:19202
      java.lang.NullPointerException
              at org.apache.ratis.shell.cli.sh.group.GroupInfoCommand.run(GroupInfoCommand.java:50)
              at org.apache.ratis.shell.cli.AbstractShell.run(AbstractShell.java:104)
              at org.apache.ratis.shell.cli.sh.RatisShell.main(RatisShell.java:43)
      

      Attachments

        Issue Links

          Activity

            People

              liuyaolong Yaolong Liu
              liuyaolong Yaolong Liu
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h