{"record":{"id":"fc864d29733230a9","repo":"apache/seatunnel","slug":"failed-to-open-hive-catalog","errorCode":null,"errorMessage":"Failed to open Hive catalog","messagePattern":"Failed to open Hive catalog","errorType":"exception","errorClass":"CatalogException","httpStatus":null,"severity":"critical","filePath":"seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/utils/HiveMetaStoreCatalog.java","lineNumber":564,"sourceCode":"            getClient().dropTable(dbName, tableName, true, true);\n        } catch (TException e) {\n            String msg = String.format(\"Failed to drop table %s.%s\", dbName, tableName);\n            throw new HiveConnectorException(\n                    HiveConnectorErrorCode.CREATE_HIVE_TABLE_FAILED, msg, e);\n        }\n    }\n\n    public void createTableFromTemplate(@NonNull Table table) throws TException {\n        log.info(\"Create table from template {}.{}\", table.getDbName(), table.getTableName());\n        createTableIfNotExists(table);\n    }\n\n    @Override\n    public void open() throws CatalogException {\n        try {\n            getClient();\n        } catch (HiveConnectorException e) {\n            throw new CatalogException(\"Failed to open Hive catalog\", e);\n        }\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) {","sourceCodeStart":546,"sourceCodeEnd":582,"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#L546-L582","documentation":"CatalogException thrown by the Catalog open() lifecycle method when the initial getClient() call fails with a HiveConnectorException. It means the Hive metastore client could not be constructed at catalog startup, so the entire catalog is unusable and the job aborts early.","triggerScenarios":"Calling open() during catalog initialization when the metastore URI is invalid/unreachable, credentials fail, or client factory construction fails (see the 'Unable to load Hive metastore client factory' error).","commonSituations":"Wrong metastore uris in catalog config; metastore service down at job submission; missing Hive jars/plugin dependencies on the classpath; Kerberos principal/keytab misconfigured.","solutions":["Check the chained HiveConnectorException cause for the root failure (factory load vs connection).","Verify the catalog config: metastore uris, hive version, and credentials.","Ensure the Hive connector plugin and its Hive dependencies are installed on all nodes.","Test metastore connectivity from the machine (nc/telnet on the thrift port) before resubmitting."],"exampleFix":"// before\nHiveCatalog catalog = new HiveCatalog(\"hive\", ...); // metastore uri typo\n// after: fix config so open() succeeds\ncatalogProps.put(\"metastore.uris\", \"thrift://metastore-host:9083\");\ncatalog.open();","handlingStrategy":"validation","validationCode":"// verify metastore reachability before opening the catalog\nSocket s = new Socket();\ns.connect(new InetSocketAddress(\"metastore-host\", 9083), 3000);\ns.close();","typeGuard":null,"tryCatchPattern":"try {\n    catalog.open();\n} catch (CatalogException e) {\n    throw new IllegalStateException(\"Hive catalog init failed: \" + e.getCause(), e);\n}","preventionTips":["Validate metastore.uris and network access before job submission","Install Hive connector plugins on all cluster nodes","Pre-test credentials/Kerberos setup with a lightweight metastore call","Fail fast at startup rather than mid-pipeline by opening the catalog eagerly"],"tags":["hive","catalog","lifecycle","metastore"],"backgroundTag":"connection-refused","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"}