{"record":{"id":"23c3449c004905ae","repo":"apache/iceberg","slug":"uri-is-not-specified-in-the-catalog-properties","errorCode":null,"errorMessage":"URI is not specified in the catalog properties","messagePattern":"URI is not specified in the catalog properties","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"nessie/src/main/java/org/apache/iceberg/nessie/NessieCatalog.java","lineNumber":138,"sourceCode":"        api = nessieClientBuilder.build(NessieApiV2.class);\n        break;\n      default:\n        throw new IllegalArgumentException(\n            String.format(\n                \"Unsupported %s: %s. Can only be 1 or 2\",\n                removePrefix.apply(NessieUtil.CLIENT_API_VERSION), apiVersion));\n    }\n\n    initialize(\n        name,\n        new NessieIcebergClient(api, requestedRef, requestedHash, catalogOptions),\n        CatalogUtil.loadFileIO(fileIOImpl, options, config),\n        catalogOptions);\n  }\n\n  private static String inferVersionFromURI(String uri) {\n    if (uri == null) {\n      throw new IllegalArgumentException(\"URI is not specified in the catalog properties\");\n    }\n\n    // match for uri ending with /v1, /v2 etc\n    Pattern pattern = Pattern.compile(\"/v(\\\\d+)$\");\n    Matcher matcher = pattern.matcher(uri);\n    if (matcher.find()) {\n      return matcher.group(1);\n    } else {\n      throw new IllegalArgumentException(\n          String.format(\n              \"URI doesn't end with the version: %s. \"\n                  + \"Please configure `client-api-version` in the catalog properties explicitly.\",\n              uri));\n    }\n  }\n\n  /**\n   * An alternative way to initialize the catalog using a pre-configured {@link NessieIcebergClient}","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/nessie/src/main/java/org/apache/iceberg/nessie/NessieCatalog.java#L120-L156","documentation":"When 'client-api-version' is not set, NessieCatalog tries to infer the Nessie client API version from the catalog's 'uri' via inferVersionFromURI. If the URI (warehouse-less endpoint property) is null — i.e. no URI was supplied at all — it throws this IllegalArgumentException.","triggerScenarios":"Initializing NessieCatalog without a 'uri' entry in the catalog properties and without 'client-api-version' set, so there is nothing to infer the API version from.","commonSituations":"Forgetting the 'uri' key when assembling the catalog config map; renaming the property key by mistake; building options programmatically and omitting the endpoint.","solutions":["Add the 'uri' property pointing at the Nessie server, e.g. \"http://nessie:19120/api/v2\".","Alternatively set 'client-api-version' explicitly to \"1\" or \"2\" — though you still normally need the uri to connect.","Double-check the property key is exactly 'uri' (no typos/extra whitespace)."],"exampleFix":"// before\nMap<String, String> props = Map.of(\"ref\", \"main\");\n// after\nMap<String, String> props = Map.of(\"uri\", \"http://nessie:19120/api/v2\", \"ref\", \"main\");","handlingStrategy":"validation","validationCode":"if (properties.get(\"uri\") == null && properties.get(\"client-api-version\") == null) {\n  throw new IllegalArgumentException(\"Nessie catalog requires 'uri' (or explicit client-api-version with endpoint)\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  catalog.initialize(name, props, conf);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().contains(\"URI is not specified\")) {\n    props.put(\"uri\", \"http://nessie:19120/api/v2\");\n    catalog.initialize(name, props, conf);\n  } else throw e;\n}","preventionTips":["Always include 'uri' in Nessie catalog property maps","Use a shared catalog-config template checked into the repo","Validate catalog properties with a small bootstrap check before job submission"],"tags":["nessie","catalog","config","uri"],"backgroundTag":"missing-required-config-field","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}