pinpoint-apm/pinpoint · error · IllegalArgumentException

Invalid namespace : <namespace>

Error message

Invalid namespace : <namespace>

What it means

HbaseTableNameProvider's constructor validates the HBase namespace string using the supplied NamespaceValidator via requireValidation(). After the empty-check, any namespace whose characters/shape fail the validator throws IllegalArgumentException('Invalid namespace : <namespace>'). HBase namespaces must be valid table-namespace identifiers (e.g. [a-z0-9_-] style, no illegal characters).

Source

Thrown at commons-hbase/src/main/java/com/navercorp/pinpoint/common/hbase/HbaseTableNameProvider.java:50

    private static final HbaseTableNameCache CACHE = new HbaseTableNameCache();

    private final String namespace;

    public HbaseTableNameProvider(String namespace) {
        this(namespace, HbaseNamespaceValidator.INSTANCE);
    }

    @VisibleForTesting
    HbaseTableNameProvider(String namespace, NamespaceValidator namespaceValidator) {
        Objects.requireNonNull(namespaceValidator, "namespaceValidator");
        this.namespace = requireValidation(namespace, namespaceValidator);
    }

    private String requireValidation(String namespace, NamespaceValidator namespaceValidator) {
        Assert.hasLength(namespace, "namespace must not be empty");
        if (!namespaceValidator.validate(namespace)) {
            throw new IllegalArgumentException("Invalid namespace : " + namespace);
        }
        return namespace;
    }

    @Override
    public TableName getTableName(HbaseTable hBaseTable) {
        return getTableName(hBaseTable.getName());
    }

    @Override
    public TableName getTableName(String tableName) {
        return CACHE.get(namespace, tableName);
    }

    @Override
    public boolean hasDefaultNameSpace() {
        return true;
    }

View on GitHub (pinned to 744c3d3075)

Solutions

  1. Use a lowercase namespace matching HBase rules (letters, digits, underscore, hyphen; e.g. 'pinpoint')
  2. Trim the namespace value read from configuration before constructing the provider
  3. If the value came from a placeholder, check for unresolved or wrongly-resolved values (see '${...}' resolution) and set a literal default

Example fix

// before (config)
hbase.namespace=Pinpoint
// after (config)
hbase.namespace=pinpoint
Defensive patterns

Strategy: validation

Validate before calling

private static final Pattern NS = Pattern.compile("^[a-z0-9_-]+$");
public static void checkNamespace(String ns) {
    Assert.hasLength(ns, "namespace must not be empty");
    if (!NS.matcher(ns).matches()) throw new IllegalArgumentException("Invalid namespace : " + ns);
}

Try / catch

try {
    HbaseTableNameProvider provider = new HbaseTableNameProvider(namespace, validator);
} catch (IllegalArgumentException e) {
    log.error("Namespace rejected: {}", e.getMessage());
    throw new IllegalArgumentException("Fix hbase.namespace in config", e);
}

Prevention

When it happens

Trigger: Constructing HbaseTableNameProvider with a namespace containing uppercase letters, illegal characters (dots, slashes, spaces), or otherwise failing NamespaceValidator.validate(); loading the namespace from config with an unintended value such as an empty-defaulted placeholder resolving to garbage.

Common situations: Config file has hbase.namespace=MyNamespace (uppercase) — HBase namespaces are conventionally lowercase; trailing whitespace or BOM from the config file; user pasted a fully-qualified 'ns:table' string where only the namespace was expected.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07). Data as JSON: /api/errors/d6f6a09f28e19e90. Report an issue: GitHub.