apache/seatunnel · error · SeaTunnelException
fail get tableSchema:
Error message
fail get tableSchema:
What it means
SeaTunnelException thrown by GravitinoMetadataProvider.tableSchema when the HTTP request for the table schema JSON (client.getTableSchema) throws an IOException. It identifies the table id whose schema could not be retrieved.
Source
Thrown at seatunnel-api/src/main/java/org/apache/seatunnel/api/metadata/gravitino/GravitinoMetadataProvider.java:185
JsonNode propertiesNode = client.getMetaInfo(metaDataDatasourceId, catalogBaseUrl);
return convertToJdbcConfig(propertiesNode);
} catch (IOException e) {
throw new SeaTunnelException(
String.format(
"Failed to fetch metadata from Gravitino for metadata: %s",
metaDataDatasourceId),
e);
}
}
@Override
public Optional<TableSchema> tableSchema(String metaDataTableId) {
try {
final JsonNode tableSchema =
client.getTableSchema(buildMetalakeUrlTableUrl(metaDataTableId));
return Optional.of(tableSchemaConvertor.convertor(tableSchema));
} catch (IOException e) {
throw new SeaTunnelException("fail get tableSchema:" + metaDataTableId, e);
}
}
/**
* Builds the metalake URL for Gravitino API calls.
*
* @return complete metalake URL
*/
private String buildMetalakeUrl() {
String baseUri = uri.endsWith("/") ? uri : uri + "/";
return baseUri + METALAKE_API_PATH + metalake + CATALOGS_PATH;
}
private String buildMetalakeUrlTableUrl(String metaDataTableId) {
final String[] split = metaDataTableId.split("\\.");
if (split.length != 3) {
throw new SeaTunnelException("Invalid metalake table id: " + metaDataTableId);
}View on GitHub (pinned to cf67b549a7)
Solutions
- Verify the Gravitino server is up and the built table URL responds (curl it).
- Validate the metaDataTableId resolves to an existing catalog.schema.table in Gravitino.
- Inspect the wrapped IOException cause to distinguish network vs HTTP errors.
- Add retry logic around transient network failures if calling repeatedly.
Example fix
// before
Optional<TableSchema> schema = provider.tableSchema("catalog.db.tbl");
// after
try {
Optional<TableSchema> schema = provider.tableSchema("catalog.db.tbl");
} catch (SeaTunnelException e) {
LOG.error("schema fetch failed for {}: {}", "catalog.db.tbl", e.getCause().getMessage());
} Defensive patterns
Strategy: try-catch
Validate before calling
// verify the table endpoint responds
HttpURLConnection c = (HttpURLConnection) new URL(buildTableUrl("catalog.db.tbl")).openConnection();
c.setConnectTimeout(5000);
if (c.getResponseCode() != 200) throw new IllegalStateException("table endpoint not reachable"); Try / catch
try {
Optional<TableSchema> schema = provider.tableSchema(tableId);
} catch (SeaTunnelException e) {
LOG.error("Failed schema fetch for {}: {}", tableId, e.getCause().getMessage());
return Optional.empty();
} Prevention
- Ensure network egress to the Gravitino port is allowed.
- Retry transient failures with backoff.
- Confirm catalog.schema.table exists before fetching schema.
When it happens
Trigger: Calling tableSchema(metaDataTableId) when the Gravitino server is unreachable, the request fails at the transport layer, or the response stream cannot be read.
Common situations: Gravitino endpoint down; wrong metalake/catalog in the table id so the URL 404s at transport level; transient network failure; proxy or TLS interception breaking the connection.
Understand the failure class
Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.
Related errors
- Failed to fetch metadata from Gravitino for metadata: %s
- Failed to execute HTTP request to %s , http status code is %
- Failed to execute HTTP request to %s after %d attempts
- SEND_RESPONSE_FAILED
- REST_SERVICE_FAILED
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/fb1e81276efca972.
Report an issue: GitHub.