{"record":{"id":"d72fbf0b9f087a1d","repo":"apache/seatunnel","slug":"listdatabases-failed-via-getalldatabases-check","errorCode":null,"errorMessage":"listDatabases failed via getAllDatabases(), check HMS version compatibility: {}","messagePattern":"listDatabases failed via getAllDatabases\\(\\), check HMS version compatibility: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/utils/HiveMetaStoreCatalog.java","lineNumber":583,"sourceCode":"        }\n    }\n\n    @Override\n    public String name() {\n        return \"hive\";\n    }\n\n    @Override\n    public String getDefaultDatabase() throws CatalogException {\n        return \"default\";\n    }\n\n    @Override\n    public List<String> listDatabases() throws CatalogException {\n        try {\n            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    }","sourceCodeStart":565,"sourceCodeEnd":601,"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#L565-L601","documentation":"HiveMetaStoreCatalog.listDatabases calls IMetaStoreClient.getAllDatabases(); when the Thrift call fails with a TException, it logs this warning (suggesting an HMS version incompatibility as a possible cause) and wraps the exception in a CatalogException('Failed to list databases'). The warning message is a diagnostic hint; the actual failure surfaces as a CatalogException to the caller (e.g. catalog open or database discovery).","triggerScenarios":"Calling listDatabases() (directly or via catalog operations that enumerate databases) when the HMS Thrift connection fails, the metastore rejects the getAllDatabases call, Kerberos/Hive config is wrong, or the HMS server version does not support the API as invoked by the client library.","commonSituations":"SeaTunnel built against Hive 2.x client talking to an HMS 1.x/3.x server with mismatched Thrift protocols; HMS host/port unreachable (fs.defaultFS/metastore URIs misconfigured in hive-site.xml); Kerberos authentication failing so the RPC is rejected; firewall or DNS blocking the metastore port (9083).","solutions":["Verify HMS connectivity from the job node: nc/teleport to the metastore host:9083 and confirm the service is running.","Align Hive client and HMS server versions: check the hive-exec/hive-metastore versions on the classpath and match the metastore's Thrift protocol (set hive.metastore.client.socket.timeout / use the matching client).","Check hive-site.xml on the job classpath points to the correct metastore URIs and, if Kerberized, that the principal/realm and keytab are correct.","Inspect the underlying TException stack trace in the thrown CatalogException to distinguish connectivity from RPC/version errors."],"exampleFix":"// before (blind retry hides the real cause)\nList<String> dbs = catalog.listDatabases();\n\n// after (validate connectivity first)\ntry {\n    List<String> dbs = catalog.listDatabases();\n} catch (CatalogException e) {\n    LOG.error(\"HMS unreachable or incompatible: {}\", e.getCause() != null ? e.getCause().getMessage() : e.getMessage());\n    throw e;\n}","handlingStrategy":"try-catch","validationCode":"// Before job start, verify HMS reachability:\ntry (Socket s = new Socket()) {\n    s.connect(new InetSocketAddress(hmsHost, hmsPort), 3000); // e.g. port 9083\n} catch (IOException e) {\n    throw new IllegalStateException(\"HMS unreachable: \" + hmsHost + \":\" + hmsPort, e);\n}","typeGuard":null,"tryCatchPattern":"try {\n    List<String> dbs = catalog.listDatabases();\n} catch (CatalogException e) {\n    Throwable cause = e.getCause(); // TException root cause\n    LOG.error(\"listDatabases failed; check HMS version/connectivity: {}\", cause, cause);\n    // fall back to statically configured database name or abort job startup\n}","preventionTips":["Pin the Hive client library version to match the HMS server version (Thrift protocol compatibility).","Ship a correct hive-site.xml with the right metastore URIs on the job classpath.","Smoke-test HMS connectivity from worker nodes before launching production jobs.","For Kerberized clusters, validate kinit/keytab access before job submission."],"tags":["hive","metastore","thrift","version-compatibility","catalog"],"backgroundTag":"api-request-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"}