{"record":{"id":"fff9737cf5e23c09","repo":"apache/druid","slug":"one-or-more-values-are-required-for-parameter-s","errorCode":null,"errorMessage":"One or more values are required for parameter %s","messagePattern":"One or more values are required for parameter (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"server/src/main/java/org/apache/druid/catalog/model/CatalogUtils.java","lineNumber":220,"sourceCode":"   * Get a string parameter that can either be null or non-blank.\n   */\n  public static String getNonBlankString(Map<String, Object> args, String parameter)\n  {\n    String value = CatalogUtils.getString(args, parameter);\n    if (value != null) {\n      value = value.trim();\n      if (value.isEmpty()) {\n        throw new IAE(\"%s parameter cannot be a blank string\", parameter);\n      }\n    }\n    return value;\n  }\n\n  public static List<String> getUriListArg(Map<String, Object> args, String parameter)\n  {\n    String urisString = CatalogUtils.getString(args, parameter);\n    if (Strings.isNullOrEmpty(urisString)) {\n      throw new IAE(\"One or more values are required for parameter %s\", parameter);\n    }\n    return stringToList(urisString);\n  }\n\n  public static List<URI> stringToUriList(String uris)\n  {\n    return stringListToUriList(stringToList(uris));\n  }\n\n  /**\n   * Convert a list of strings to a list of {@link URI} objects.\n   */\n  public static List<URI> stringListToUriList(List<String> list)\n  {\n    if (list == null) {\n      return null;\n    }\n    List<URI> uris = new ArrayList<>();","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/catalog/model/CatalogUtils.java#L202-L238","documentation":"CatalogUtils.getUriListArg extracts a URI-list parameter (a comma/newline separated string) from an argument map and throws when the raw string is null or empty, because at least one URI value is mandatory. It guards before splitting via stringToList.","triggerScenarios":"Calling getUriListArg(args, \"uris\") with args missing the key, holding null, \"\", or a whitespace-only string. Typically reached when a catalog/table property that must list URIs is omitted or blank.","commonSituations":"A lookup or table definition referencing external URI resources is created without the required URI property; a template expands with no URIs; the user deletes the value but keeps the empty key.","solutions":["Provide at least one URI in the parameter, e.g. \"uris\": \"file:///path/to/resource\" or a comma-separated list.","Verify the property key spelling matches what the model expects (a typo means the key is read as null).","If URIs are genuinely optional, switch the model definition to a property type that permits absence rather than getUriListArg."],"exampleFix":"// before\n{\"properties\": {\"uris\": \"\"}}\n// after\n{\"properties\": {\"uris\": \"file:///opt/druid/lookups/country.json,http://host/country.json\"}}","handlingStrategy":"validation","validationCode":"Object v = args.get(\"uris\");\nif (v == null || (v instanceof String && ((String) v).trim().isEmpty())) {\n  throw new IllegalArgumentException(\"uris must contain at least one URI\");\n}","typeGuard":"boolean hasUriList(Map<String, Object> args, String key) { return args.get(key) instanceof String && !Strings.isNullOrEmpty(((String) args.get(key)).trim()); }","tryCatchPattern":"try { List<String> uris = CatalogUtils.getUriListArg(args, \"uris\"); ... } catch (IllegalArgumentException e) { // prompt user for at least one URI }","preventionTips":["Always supply at least one URI when the model requires external resources.","Verify property key spellings so required keys are not silently read as null.","Template-driven configs: fail at template-render time if a required URI list is empty."],"tags":["catalog","validation","uri","missing-value"],"backgroundTag":"missing-required-argument","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}