apache/seatunnel · error · HbaseConnectorException

TABLE_TRUNCATE_EXCEPTION

TABLE_TRUNCATE_EXCEPTION

Error message

HbaseConnectorErrorCode.TABLE_TRUNCATE_EXCEPTION.getErrorMessage()

What it means

Deleting an HBase namespace via admin.deleteNamespace threw an IOException, wrapped as HbaseConnectorException with NAMESPACE_DELETE_EXCEPTION. This is thrown because namespace deletion requires the namespace to exist, be empty (no tables), and the caller to have admin permission. The failure is deferred to the caller as a connector exception.

Solutions

  1. Disable and drop (or truncate/delete) all tables in the namespace before deleting it
  2. Verify the namespace exists with 'list_namespace' in HBase shell
  3. Check permissions (ADMIN on the namespace) for the connected user
  4. Review the wrapped IOException cause for the exact HBase failure

Example fix

// before
client.deleteNamespace("old_ns");
// after
for (TableName t : client.listTables("old_ns")) { client.dropTable(t); }
client.deleteNamespace("old_ns");
Defensive patterns

Strategy: validation

Validate before calling

// pre-check: namespace empty and exists
boolean empty = admin.listTableNamesByNamespace(ns).length == 0;
boolean exists = namespaceExists(admin, ns);
if (exists && empty) admin.deleteNamespace(ns);

Type guard

boolean canDeleteNamespace(Admin admin, String ns) throws IOException {
    return namespaceExists(admin, ns) && admin.listTableNamesByNamespace(ns).length == 0;
}

Try / catch

try { client.deleteNamespace(ns); }
catch (HbaseConnectorException e) {
    Throwable c = e.getCause();
    if (c instanceof NamespaceNotFoundException) { /* already gone */ }
    else if (c.getMessage() != null && c.getMessage().contains("only empty")) { /* drop tables first */ }
    else throw e;
}

Prevention

When it happens

Trigger: Calling HbaseClient.deleteNamespace(namespace) when admin.deleteNamespace throws IOException — typically namespace does not exist, namespace still contains tables, or connection/permission problems.

Common situations: Trying to drop a namespace that still has tables enabled/disabled; typo in namespace name; cluster connectivity loss mid-operation.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/8706a60234991dea. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-connectors-v2/connector-hbase/src/main/java/org/apache/seatunnel/connectors/seatunnel/hbase/client/HbaseClient.java:280

            admin.createNamespace(NamespaceDescriptor.create(namespace).build());
        } catch (IOException e) {
            throw new HbaseConnectorException(
                    HbaseConnectorErrorCode.NAMESPACE_CREATE_EXCEPTION,
                    HbaseConnectorErrorCode.NAMESPACE_CREATE_EXCEPTION.getErrorMessage(),
                    e);
        }
    }

    /**
     * Drop a namespace.
     *
     * @param namespace namespace name
     */
    public void deleteNamespace(String namespace) {
        try {
            admin.deleteNamespace(namespace);
        } catch (IOException e) {
            throw new HbaseConnectorException(
                    HbaseConnectorErrorCode.NAMESPACE_DELETE_EXCEPTION,
                    HbaseConnectorErrorCode.NAMESPACE_DELETE_EXCEPTION.getErrorMessage(),
                    e);
        }
    }

    /**
     * Truncate a table.
     *
     * @param databaseName database name
     * @param tableName table name
     */
    public void truncateTable(String databaseName, String tableName) {
        try {
            TableName table = TableName.valueOf(databaseName, tableName);
            admin.disableTable(table);
            admin.truncateTable(table, true);
        } catch (IOException e) {

View on GitHub (pinned to cf67b549a7)