{"record":{"id":"354ab5d145cbf5cb","repo":"apache/seatunnel","slug":"table-url-cannot-be-null-or-empty","errorCode":null,"errorMessage":"Table URL cannot be null or empty","messagePattern":"Table URL cannot be null or empty","errorType":"exception","errorClass":"SeaTunnelRuntimeException","httpStatus":null,"severity":"error","filePath":"seatunnel-api/src/main/java/org/apache/seatunnel/api/metalake/gravitino/GravitinoClient.java","lineNumber":103,"sourceCode":"    public JsonNode getMetaInfo(String sourceId, String metalakeUrl) throws IOException {\n        if (!metalakeUrl.endsWith(\"/\")) {\n            metalakeUrl = metalakeUrl + \"/\";\n        }\n        JsonNode rootNode = executeGetRequest(metalakeUrl + sourceId);\n        JsonNode catalogNode = getRequiredNode(rootNode, JSON_FIELD_CATALOG);\n        return getRequiredNode(catalogNode, JSON_FIELD_PROPERTIES);\n    }\n\n    @Override\n    public JsonNode getTableSchema(String schemaHttpUrl) throws IOException {\n        JsonNode rootNode = executeGetRequest(schemaHttpUrl);\n        return getRequiredNode(rootNode, JSON_FIELD_TABLE);\n    }\n\n    @Override\n    public TablePath getTableSchemaPath(String schemaHttpUrl) {\n        if (schemaHttpUrl == null || schemaHttpUrl.isEmpty()) {\n            throw new SeaTunnelRuntimeException(\n                    ERROR_INVALID_TABLE_URL, \"Table URL cannot be null or empty\");\n        }\n        final Matcher matcher = getMatcher(schemaHttpUrl);\n        String catalogName = matcher.group(1);\n        String schemaName = matcher.group(2);\n        String tableName = matcher.group(3);\n        return TablePath.of(catalogName, schemaName, tableName);\n    }\n\n    private Matcher getMatcher(String schemaHttpUrl) {\n        Matcher matcher = TABLE_URL_PATTERN.matcher(schemaHttpUrl);\n        if (!matcher.find()) {\n            throw new SeaTunnelRuntimeException(\n                    ERROR_INVALID_TABLE_URL,\n                    String.format(\n                            \"Invalid table URL format: '%s'. \"\n                                    + \"Expected format: http://host/api/metalakes/{metalake}/catalogs/{catalog}/schemas/{schema}/tables/{table}\",\n                            schemaHttpUrl));","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/metalake/gravitino/GravitinoClient.java#L85-L121","documentation":"SeaTunnelRuntimeException (ERROR_INVALID_TABLE_URL) thrown by GravitinoClient.getTableSchemaPath when the supplied schemaHttpUrl is null or empty. A URL is mandatory to parse out catalog, schema, and table names.","triggerScenarios":"Calling getTableSchemaPath(null) or getTableSchemaPath(\"\") — e.g. when an upstream step that was supposed to produce the table's HTTP URL silently returned null or an empty string.","commonSituations":"Upstream metadata lookup returned no URL for the table; configuration field left blank; a variable holding the URL was never initialized before being passed in.","solutions":["Ensure a non-empty Gravitino table URL is produced before calling getTableSchemaPath.","Check the upstream call/configuration that supplies the URL for null/empty results.","Fail fast with your own validation and a clear message pointing to the missing config value."],"exampleFix":"// before\nTablePath path = client.getTableSchemaPath(url);\n// after\nif (url == null || url.isEmpty()) {\n    throw new IllegalArgumentException(\"tableUrl config is empty\");\n}\nTablePath path = client.getTableSchemaPath(url);","handlingStrategy":"validation","validationCode":"if (tableUrl == null || tableUrl.trim().isEmpty()) {\n    throw new IllegalArgumentException(\"tableUrl must be set to the Gravitino table URL\");\n}","typeGuard":"static boolean hasText(String s) { return s != null && !s.trim().isEmpty(); }\n// if (hasText(tableUrl)) { client.getTableSchemaPath(tableUrl); }","tryCatchPattern":"try {\n    return client.getTableSchemaPath(url);\n} catch (SeaTunnelRuntimeException e) {\n    if (\"Table URL cannot be null or empty\".equals(e.getMessage())) {\n        throw new IllegalStateException(\"Missing tableUrl config for table lookup\");\n    }\n    throw e;\n}","preventionTips":["Validate the tableUrl config field at job startup.","Fail fast when an upstream URL-producing step returns null.","Log which config key supplied the URL to ease debugging."],"tags":["validation","null","url","gravitino"],"backgroundTag":"null-argument","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}