apache/seatunnel · warning

Hive table not available yet or metastore not reachable

Error message

Hive table not available yet or metastore not reachable: {}. Will continue with lazy creation via SaveMode.

What it means

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.

Solutions

  1. If the table should already exist, verify hive.metastore.uris and metastore connectivity (telnet/nc to the metastore port)
  2. Check the metastore service logs for auth or database errors
  3. If intentionally creating the table, this warning is benign — ensure SaveMode (e.g. CREATE_SCHEMA_OR_OVERWRITE) is set so lazy creation succeeds
  4. Confirm the database exists and the user has permission to read/create the table

Example fix

// before
"hive.metastore.uris" = "thrift://localhost:9083" // metastore not running
// after
# start hive metastore service, then
"hive.metastore.uris" = "thrift://metastore-host:9083"
Defensive patterns

Strategy: retry

Validate before calling

// before submitting
HiveMetaStoreClient c = new HiveMetaStoreClient(hiveConf);
c.getAllDatabases(); // throws if metastore unreachable

Try / catch

try {
  table = hiveMetaStoreClient.getTable(db, tbl);
} catch (TException e) {
  // table may be created lazily by SaveMode
  log.warn("Table not available yet, will create via SaveMode", e);
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: ECONNREFUSED and "connection refused" / "could not connect to server" errors: what they mean and how to fix them — this error's family across 44 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/5e14105a81fecd24. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/sink/HiveSink.java:335

            String table = config.get(HiveSinkOptions.TABLE_NAME);
            org.apache.seatunnel.api.table.catalog.TablePath path =
                    org.apache.seatunnel.api.table.catalog.TablePath.of(table);
            return org.apache.seatunnel.connectors.seatunnel.hive.utils.HiveLocationUtils
                    .qualifiedDefaultLocation(config, path.getDatabaseName(), path.getTableName());
        } catch (Exception e) {
            LOGGER.warn(
                    "Failed to derive qualified default table location, fallback to file:/tmp/hive/warehouse: {}",
                    e.getMessage());
            return "file:/tmp/hive/warehouse";
        }
    }

    private Table getTableInformation() {
        if (tableInformation == null) {
            try {
                tableInformation = HiveTableUtils.getTableInfo(readonlyConfig);
            } catch (Exception e) {
                LOGGER.warn(
                        "Hive table not available yet or metastore not reachable: {}. Will continue with lazy creation via SaveMode.",
                        e.getMessage());
                tableInformation = null;
            }
        }
        return tableInformation;
    }

    private WriteStrategy getWriteStrategy() {
        if (writeStrategy == null) {
            writeStrategy = WriteStrategyFactory.of(fileSinkConfig.getFileFormat(), fileSinkConfig);
            writeStrategy.setCatalogTable(catalogTable);
        }
        return writeStrategy;
    }

    @Override
    public Optional<CatalogTable> getWriteCatalogTable() {

View on GitHub (pinned to cf67b549a7)