{"record":{"id":"f4a95bfececd037f","repo":"apache/seatunnel","slug":"failed-to-fetch-metadata-from-gravitino-for-metada","errorCode":null,"errorMessage":"Failed to fetch metadata from Gravitino for metadata: %s","messagePattern":"Failed to fetch metadata from Gravitino for metadata: (.+?)","errorType":"exception","errorClass":"SeaTunnelException","httpStatus":null,"severity":"error","filePath":"seatunnel-api/src/main/java/org/apache/seatunnel/api/metadata/gravitino/GravitinoMetadataProvider.java","lineNumber":170,"sourceCode":"    }\n\n    @Override\n    public Map<String, Object> datasourceMap(\n            String connectorIdentifier, String metaDataDatasourceId) {\n        if (!JDBC_CONNECTOR.equalsIgnoreCase(connectorIdentifier)) {\n            log.warn(\n                    \"Unsupported connector '{}' for Gravitino provider, only '{}' is supported\",\n                    connectorIdentifier,\n                    JDBC_CONNECTOR);\n            return Collections.emptyMap();\n        }\n\n        try {\n            String catalogBaseUrl = buildMetalakeUrl();\n            JsonNode propertiesNode = client.getMetaInfo(metaDataDatasourceId, catalogBaseUrl);\n            return convertToJdbcConfig(propertiesNode);\n        } catch (IOException e) {\n            throw new SeaTunnelException(\n                    String.format(\n                            \"Failed to fetch metadata from Gravitino for metadata: %s\",\n                            metaDataDatasourceId),\n                    e);\n        }\n    }\n\n    @Override\n    public Optional<TableSchema> tableSchema(String metaDataTableId) {\n        try {\n            final JsonNode tableSchema =\n                    client.getTableSchema(buildMetalakeUrlTableUrl(metaDataTableId));\n            return Optional.of(tableSchemaConvertor.convertor(tableSchema));\n        } catch (IOException e) {\n            throw new SeaTunnelException(\"fail get tableSchema:\" + metaDataTableId, e);\n        }\n    }\n","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/metadata/gravitino/GravitinoMetadataProvider.java#L152-L188","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the Gravitino server is reachable (curl the metalake URL from buildMetalakeUrl()).","Check the configured Gravitino URI and metalake name in the connector config.","Confirm the datasource id exists in Gravitino (query the Gravitino API for the catalog).","Inspect the wrapped IOException cause for the real network/HTTP failure and fix accordingly."],"exampleFix":"// before\nreturn provider.datasourceMap(datasourceId);\n// after\ntry {\n    return provider.datasourceMap(datasourceId);\n} catch (SeaTunnelException e) {\n    LOG.error(\"Gravitino metadata fetch failed for id {}\", datasourceId, e.getCause());\n    throw e;\n}","handlingStrategy":"try-catch","validationCode":"// preflight: verify Gravitino reachable\nHttpURLConnection c = (HttpURLConnection) new URL(gravitinoBaseUri + \"/api/metalakes\").openConnection();\nc.setConnectTimeout(5000);\nif (c.getResponseCode() != 200) throw new IllegalStateException(\"Gravitino unreachable: \" + c.getResponseCode());","typeGuard":null,"tryCatchPattern":"try {\n    Map<String, JdbcConfig> cfg = provider.datasourceMap(datasourceId);\n} catch (SeaTunnelException e) {\n    LOG.error(\"Gravitino metadata fetch failed for id {} (cause: {})\", datasourceId, e.getCause());\n    // fall back to static config or rethrow\n}","preventionTips":["Health-check the Gravitino server before submitting jobs.","Pin and validate the Gravitino URI/metalake in config at startup.","Confirm datasource ids exist in Gravitino before use."],"tags":["network","http","gravitino","metadata"],"backgroundTag":"http-request-failed","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"}