{"record":{"id":"fb1e81276efca972","repo":"apache/seatunnel","slug":"fail-get-tableschema","errorCode":null,"errorMessage":"fail get tableSchema:","messagePattern":"fail get tableSchema:","errorType":"exception","errorClass":"SeaTunnelException","httpStatus":null,"severity":"error","filePath":"seatunnel-api/src/main/java/org/apache/seatunnel/api/metadata/gravitino/GravitinoMetadataProvider.java","lineNumber":185,"sourceCode":"            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\n    /**\n     * Builds the metalake URL for Gravitino API calls.\n     *\n     * @return complete metalake URL\n     */\n    private String buildMetalakeUrl() {\n        String baseUri = uri.endsWith(\"/\") ? uri : uri + \"/\";\n        return baseUri + METALAKE_API_PATH + metalake + CATALOGS_PATH;\n    }\n\n    private String buildMetalakeUrlTableUrl(String metaDataTableId) {\n        final String[] split = metaDataTableId.split(\"\\\\.\");\n        if (split.length != 3) {\n            throw new SeaTunnelException(\"Invalid metalake table id: \" + metaDataTableId);\n        }","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/metadata/gravitino/GravitinoMetadataProvider.java#L167-L203","documentation":"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.","triggerScenarios":"Calling tableSchema(metaDataTableId) when the Gravitino server is unreachable, the request fails at the transport layer, or the response stream cannot be read.","commonSituations":"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.","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."],"exampleFix":"// before\nOptional<TableSchema> schema = provider.tableSchema(\"catalog.db.tbl\");\n// after\ntry {\n    Optional<TableSchema> schema = provider.tableSchema(\"catalog.db.tbl\");\n} catch (SeaTunnelException e) {\n    LOG.error(\"schema fetch failed for {}: {}\", \"catalog.db.tbl\", e.getCause().getMessage());\n}","handlingStrategy":"try-catch","validationCode":"// verify the table endpoint responds\nHttpURLConnection c = (HttpURLConnection) new URL(buildTableUrl(\"catalog.db.tbl\")).openConnection();\nc.setConnectTimeout(5000);\nif (c.getResponseCode() != 200) throw new IllegalStateException(\"table endpoint not reachable\");","typeGuard":null,"tryCatchPattern":"try {\n    Optional<TableSchema> schema = provider.tableSchema(tableId);\n} catch (SeaTunnelException e) {\n    LOG.error(\"Failed schema fetch for {}: {}\", tableId, e.getCause().getMessage());\n    return Optional.empty();\n}","preventionTips":["Ensure network egress to the Gravitino port is allowed.","Retry transient failures with backoff.","Confirm catalog.schema.table exists before fetching schema."],"tags":["network","http","gravitino","table-schema"],"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"}