apache/druid · error · IllegalArgumentException

One or more values are required for parameter %s

Error message

One or more values are required for parameter %s

What it means

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.

Source

Thrown at server/src/main/java/org/apache/druid/catalog/model/CatalogUtils.java:220

   * Get a string parameter that can either be null or non-blank.
   */
  public static String getNonBlankString(Map<String, Object> args, String parameter)
  {
    String value = CatalogUtils.getString(args, parameter);
    if (value != null) {
      value = value.trim();
      if (value.isEmpty()) {
        throw new IAE("%s parameter cannot be a blank string", parameter);
      }
    }
    return value;
  }

  public static List<String> getUriListArg(Map<String, Object> args, String parameter)
  {
    String urisString = CatalogUtils.getString(args, parameter);
    if (Strings.isNullOrEmpty(urisString)) {
      throw new IAE("One or more values are required for parameter %s", parameter);
    }
    return stringToList(urisString);
  }

  public static List<URI> stringToUriList(String uris)
  {
    return stringListToUriList(stringToList(uris));
  }

  /**
   * Convert a list of strings to a list of {@link URI} objects.
   */
  public static List<URI> stringListToUriList(List<String> list)
  {
    if (list == null) {
      return null;
    }
    List<URI> uris = new ArrayList<>();

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Provide at least one URI in the parameter, e.g. "uris": "file:///path/to/resource" or a comma-separated list.
  2. Verify the property key spelling matches what the model expects (a typo means the key is read as null).
  3. If URIs are genuinely optional, switch the model definition to a property type that permits absence rather than getUriListArg.

Example fix

// before
{"properties": {"uris": ""}}
// after
{"properties": {"uris": "file:///opt/druid/lookups/country.json,http://host/country.json"}}
Defensive patterns

Strategy: validation

Validate before calling

Object v = args.get("uris");
if (v == null || (v instanceof String && ((String) v).trim().isEmpty())) {
  throw new IllegalArgumentException("uris must contain at least one URI");
}

Type guard

boolean hasUriList(Map<String, Object> args, String key) { return args.get(key) instanceof String && !Strings.isNullOrEmpty(((String) args.get(key)).trim()); }

Try / catch

try { List<String> uris = CatalogUtils.getUriListArg(args, "uris"); ... } catch (IllegalArgumentException e) { // prompt user for at least one URI }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07). Data as JSON: /api/errors/fff9737cf5e23c09. Report an issue: GitHub.