{"record":{"id":"e3e3309b20e8e55e","repo":"apache/seatunnel","slug":"failed-to-list-tables-in-database-databasename","errorCode":null,"errorMessage":"Failed to list tables in database: ${databaseName}","messagePattern":"Failed to list tables in database: (.+?)","errorType":"exception","errorClass":"CatalogException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/utils/HiveMetaStoreCatalog.java","lineNumber":599,"sourceCode":"            return getClient().getAllDatabases();\n        } catch (TException e) {\n            log.warn(\n                    \"listDatabases failed via getAllDatabases(), check HMS version compatibility: {}\",\n                    e.getMessage());\n            throw new CatalogException(\"Failed to list databases\", e);\n        }\n    }\n\n    @Override\n    public List<String> listTables(String databaseName)\n            throws CatalogException, DatabaseNotExistException {\n        try {\n            if (!databaseExists(databaseName)) {\n                throw new DatabaseNotExistException(\"hive\", databaseName);\n            }\n            return getClient().getAllTables(databaseName);\n        } catch (TException e) {\n            throw new CatalogException(\"Failed to list tables in database: \" + databaseName, e);\n        }\n    }\n\n    @Override\n    public boolean tableExists(TablePath tablePath) throws CatalogException {\n        return tableExists(tablePath.getDatabaseName(), tablePath.getTableName());\n    }\n\n    @Override\n    public CatalogTable getTable(TablePath tablePath)\n            throws CatalogException, TableNotExistException {\n        try {\n            if (!tableExists(tablePath.getDatabaseName(), tablePath.getTableName())) {\n                throw new TableNotExistException(\"hive\", tablePath);\n            }\n            Table hiveTable = getTable(tablePath.getDatabaseName(), tablePath.getTableName());\n            return convertHiveTableToCatalogTable(hiveTable);\n        } catch (TableNotExistException e) {","sourceCodeStart":581,"sourceCodeEnd":617,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/utils/HiveMetaStoreCatalog.java#L581-L617","documentation":"Thrown by HiveMetaStoreCatalog.listTables when the Hive Metastore Thrift call getAllTables fails with a TException after the database existence check passed. It indicates an HMS communication/protocol failure, not a missing database (that case throws DatabaseNotExistException separately).","triggerScenarios":"Calling listTables(databaseName) when HMS is unreachable mid-call, the thrift call times out, or the metastore server throws an internal error for this database.","commonSituations":"Transient metastore outage or network partition; socket timeout under load; HMS GC pauses; permission issues on HMS for that database in secured clusters.","solutions":["Inspect the TException cause for timeouts/connection errors and retry with backoff.","Increase hive.metastore.client.socket.timeout if timeouts occur under load.","Confirm HMS service health and network connectivity to the thrift port.","Check HMS server logs for the failing request."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    return catalog.listTables(db);\n} catch (CatalogException e) {\n    if (e.getCause() instanceof org.apache.thrift.TException\n        && isTransient(e.getCause())) {\n        // retry with exponential backoff\n    }\n    throw e;\n}","preventionTips":["Set generous hive.metastore.client.socket.timeout.","Monitor HMS health; add retry with backoff for enumeration calls.","Avoid listing tables during metastore maintenance windows."],"tags":["hive","metastore","catalog","thrift","transient-failure"],"backgroundTag":"database-query-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}