apache/seatunnel · error · SeaTunnelException

Failed to fetch metadata from Gravitino for metadata: %s

Error message

Failed to fetch metadata from Gravitino for metadata: %s

What it means

SeaTunnelException thrown by GravitinoMetadataProvider.datasourceMap when the HTTP call to the Gravitino server (via MetalakeClient.getMetaInfo) throws an IOException. It wraps the underlying I/O failure and identifies the datasource id whose metadata could not be fetched.

Source

Thrown at seatunnel-api/src/main/java/org/apache/seatunnel/api/metadata/gravitino/GravitinoMetadataProvider.java:170

    }

    @Override
    public Map<String, Object> datasourceMap(
            String connectorIdentifier, String metaDataDatasourceId) {
        if (!JDBC_CONNECTOR.equalsIgnoreCase(connectorIdentifier)) {
            log.warn(
                    "Unsupported connector '{}' for Gravitino provider, only '{}' is supported",
                    connectorIdentifier,
                    JDBC_CONNECTOR);
            return Collections.emptyMap();
        }

        try {
            String catalogBaseUrl = buildMetalakeUrl();
            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);
        }
    }

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Verify the Gravitino server is reachable (curl the metalake URL from buildMetalakeUrl()).
  2. Check the configured Gravitino URI and metalake name in the connector config.
  3. Confirm the datasource id exists in Gravitino (query the Gravitino API for the catalog).
  4. Inspect the wrapped IOException cause for the real network/HTTP failure and fix accordingly.

Example fix

// before
return provider.datasourceMap(datasourceId);
// after
try {
    return provider.datasourceMap(datasourceId);
} catch (SeaTunnelException e) {
    LOG.error("Gravitino metadata fetch failed for id {}", datasourceId, e.getCause());
    throw e;
}
Defensive patterns

Strategy: try-catch

Validate before calling

// preflight: verify Gravitino reachable
HttpURLConnection c = (HttpURLConnection) new URL(gravitinoBaseUri + "/api/metalakes").openConnection();
c.setConnectTimeout(5000);
if (c.getResponseCode() != 200) throw new IllegalStateException("Gravitino unreachable: " + c.getResponseCode());

Try / catch

try {
    Map<String, JdbcConfig> cfg = provider.datasourceMap(datasourceId);
} catch (SeaTunnelException e) {
    LOG.error("Gravitino metadata fetch failed for id {} (cause: {})", datasourceId, e.getCause());
    // fall back to static config or rethrow
}

Prevention

When it happens

Trigger: Calling datasourceMap(metaDataDatasourceId) when the Gravitino server is unreachable, returns a non-200 response, the connection is reset mid-request, or the metalake/catalog URL built by buildMetalakeUrl() is wrong.

Common situations: Gravitino service down or misconfigured URI; wrong metalake name in config; network/firewall blocking the HTTP port; Gravitino returning 4xx/5xx because the datasource id does not exist in the catalog.

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


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