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

Wrong error message in case incorrect snapshot name OR Incorrect table name

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.0
    • 1.0.0, 0.98.11
    • None
    • None

    Description

      hbase(main):009:0> snapshot 't1', '.t1Snapshot'

      ERROR: Illegal first character <46> at 0. Namespaces can only start with alphanumeric characters': i.e. [a-zA-Z_0-9]: t1Snapshot

      hbase(main):008:0> create '-test' , 'cf1'

      ERROR: Illegal first character <45> at 0.Namespaces can only start with alphanumeric characters': i.e. [a-zA-Z_0-9]: -test

      >> As per message "Namespaces" is wrong. But in this scenario, snapshot / table name start character is wrong.

      Its because in the code the message is as below

      if (qualifierName[start] == '.' || qualifierName[start] == '-') {
            throw new IllegalArgumentException("Illegal first character <" + qualifierName[0] +
                                               "> at 0. Namespaces can only start with alphanumeric " +
                                               "characters': i.e. [a-zA-Z_0-9]: " +
                                               Bytes.toString(qualifierName));
      

      The correct code should be as below

      if (qualifierName[start] == '.' || qualifierName[start] == '-') {
            throw new IllegalArgumentException("Illegal first character <" + qualifierName[start] +
                                               "> at 0. " + (isSnapshot ? "Snapshot" : "User-space table") +
                                               " qualifiers can only start with 'alphanumeric " +
                                               "characters': i.e. [a-zA-Z_0-9]: " +
                                               Bytes.toString(qualifierName, start, end));
      

      Attachments

        Activity

          People

            Bhupendra Bhupendra Kumar Jain
            Bhupendra Bhupendra Kumar Jain
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: