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
- Disable and drop (or truncate/delete) all tables in the namespace before deleting it
- Verify the namespace exists with 'list_namespace' in HBase shell
- Check permissions (ADMIN on the namespace) for the connected user
- 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
- Drop/disable all tables in the namespace before deleting it
- Confirm the namespace name against list_namespace
- Verify ADMIN permission for the user
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
- NAMESPACE_DELETE_EXCEPTION
- DatabaseNotExistException: database
- Failed to close HBase connection.
- CONNECTION_FAILED
- CONNECTION_FAILED_FOR_ADMIN
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)