You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "guluo (Jira)" <ji...@apache.org> on 2024/04/17 12:34:00 UTC

[jira] [Created] (HBASE-28531) IndexOutOfBoundsException when executing HBCK2

guluo created HBASE-28531:
-----------------------------

             Summary: IndexOutOfBoundsException when executing HBCK2 
                 Key: HBASE-28531
                 URL: https://issues.apache.org/jira/browse/HBASE-28531
             Project: HBase
          Issue Type: Bug
          Components: hbck2
         Environment: hbck master
hbase master
            Reporter: guluo


Reproduction
 
Execute the following command:
{code:java}
//代码占位符
${HBASE_HOME}/bin/hbase --config /etc/hbase-conf hbck -j ~/hbase-operator-tools/hbase-hbck2/target/hbase-hbck2-1.0.0-SNAPSHOT.jar {code}
we would get IndexOutOfBoundsException, as following.
{code:java}
//代码占位符
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) {code}
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.
 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)