{"record":{"id":"5e14105a81fecd24","repo":"apache/seatunnel","slug":"hive-table-not-available-yet-or-metastore-not-reac","errorCode":null,"errorMessage":"Hive table not available yet or metastore not reachable: {}. Will continue with lazy creation via SaveMode.","messagePattern":"Hive table not available yet or metastore not reachable: (.+?)\\. Will continue with lazy creation via SaveMode\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/sink/HiveSink.java","lineNumber":335,"sourceCode":"            String table = config.get(HiveSinkOptions.TABLE_NAME);\n            org.apache.seatunnel.api.table.catalog.TablePath path =\n                    org.apache.seatunnel.api.table.catalog.TablePath.of(table);\n            return org.apache.seatunnel.connectors.seatunnel.hive.utils.HiveLocationUtils\n                    .qualifiedDefaultLocation(config, path.getDatabaseName(), path.getTableName());\n        } catch (Exception e) {\n            LOGGER.warn(\n                    \"Failed to derive qualified default table location, fallback to file:/tmp/hive/warehouse: {}\",\n                    e.getMessage());\n            return \"file:/tmp/hive/warehouse\";\n        }\n    }\n\n    private Table getTableInformation() {\n        if (tableInformation == null) {\n            try {\n                tableInformation = HiveTableUtils.getTableInfo(readonlyConfig);\n            } catch (Exception e) {\n                LOGGER.warn(\n                        \"Hive table not available yet or metastore not reachable: {}. Will continue with lazy creation via SaveMode.\",\n                        e.getMessage());\n                tableInformation = null;\n            }\n        }\n        return tableInformation;\n    }\n\n    private WriteStrategy getWriteStrategy() {\n        if (writeStrategy == null) {\n            writeStrategy = WriteStrategyFactory.of(fileSinkConfig.getFileFormat(), fileSinkConfig);\n            writeStrategy.setCatalogTable(catalogTable);\n        }\n        return writeStrategy;\n    }\n\n    @Override\n    public Optional<CatalogTable> getWriteCatalogTable() {","sourceCodeStart":317,"sourceCodeEnd":353,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/sink/HiveSink.java#L317-L353","documentation":"HiveSink.getTableInformation tries to fetch the existing Hive table metadata via HiveTableUtils.getTableInfo. If the table does not exist yet or the metastore cannot be reached, it logs this warning, caches null, and lets SaveMode handle lazy table creation later. This is expected on first-run jobs that create the table.","triggerScenarios":"getTableInformation() (called during sink initialization: createAggregatedCommitter, createHadoopConf, etc.) catches any Exception from getTableInfo — table absent from the metastore, metastore URIs unreachable, thrift connection refused, or auth failure.","commonSituations":"First run against a table that will be created by the sink, wrong hive.metastore.uris, metastore service down, Kerberos/network issues between the job and metastore.","solutions":["If the table should already exist, verify hive.metastore.uris and metastore connectivity (telnet/nc to the metastore port)","Check the metastore service logs for auth or database errors","If intentionally creating the table, this warning is benign — ensure SaveMode (e.g. CREATE_SCHEMA_OR_OVERWRITE) is set so lazy creation succeeds","Confirm the database exists and the user has permission to read/create the table"],"exampleFix":"// before\n\"hive.metastore.uris\" = \"thrift://localhost:9083\" // metastore not running\n// after\n# start hive metastore service, then\n\"hive.metastore.uris\" = \"thrift://metastore-host:9083\"","handlingStrategy":"retry","validationCode":"// before submitting\nHiveMetaStoreClient c = new HiveMetaStoreClient(hiveConf);\nc.getAllDatabases(); // throws if metastore unreachable","typeGuard":null,"tryCatchPattern":"try {\n  table = hiveMetaStoreClient.getTable(db, tbl);\n} catch (TException e) {\n  // table may be created lazily by SaveMode\n  log.warn(\"Table not available yet, will create via SaveMode\", e);\n}","preventionTips":["Test metastore connectivity (thrift port) from job nodes before submission","Pre-create the table if you require it to exist","Use correct SaveMode for first-run table creation","Check Kerberos/auth principals if metastore rejects connections"],"tags":["hive","metastore","lazy-creation"],"backgroundTag":"connection-refused","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}