Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-28531

IndexOutOfBoundsException when executing HBCK2

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • hbck2
    • None
    • hbck master
      hbase master

    Description

      Reproduction
       
      Execute the following command:

      //代码占位符
      ${HBASE_HOME}/bin/hbase --config /etc/hbase-conf hbck -j ~/hbase-operator-tools/hbase-hbck2/target/hbase-hbck2-1.0.0-SNAPSHOT.jar 

      we would get IndexOutOfBoundsException, as following.

      //代码占位符
      Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1    at java.lang.String.substring(String.java:1967)    at org.apache.logging.log4j.util.PropertiesUtil.partitionOnCommonPrefixes(PropertiesUtil.java:555)    at org.apache.logging.log4j.core.config.properties.PropertiesConfigurationBuilder.build(PropertiesConfigurationBuilder.java:174)    at org.apache.logging.log4j.core.config.properties.PropertiesConfigurationFactory.getConfiguration(PropertiesConfigurationFactory.java:56)    at org.apache.logging.log4j.core.config.properties.PropertiesConfigurationFactory.getConfiguration(PropertiesConfigurationFactory.java:35)    at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:557)    at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:481)    at org.apache.logging.log4j.core.config.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:323)    at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:695)    at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:716)    at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:270)    at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:155)    at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:47)    at org.apache.logging.log4j.LogManager.getContext(LogManager.java:196)    at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:137)    at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:55)    at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:47)    at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:33)    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)    at org.apache.hbase.HBCK2.<clinit>(HBCK2.java:92) 

      The Reason.
      The current version of HBase uses version 2.17.2 of log4j2, which supports shorthand syntax for properties configuration ( LOG4J2-3341 :   https://issues.apache.org/jira/browse/LOG4J2-3341).
       
      However, The current version of HBCK2 uses version 2.17.1 of log4j2, which does not support the feature.

      So, we would get IndexOutOfBoundsException when HBCK2 uses as following log4j2 properties, and this is the default log configuration format for HBase
      logger.http = INFO,NullAppender

      In order to avoid this problem, I think we need bump log4j2 from 2.17.1 to 2.17.2 against HBCK2.
       

      Attachments

        Activity

          People

            Unassigned Unassigned
            guluo guluo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: