apache/druid · error · ProvisionException

%s - %s

Error message

%s - %s

What it means

During Guice configuration binding, JsonConfigurator validates each property against its Bean Validation (JSR-303) annotations (e.g. @NotNull, @Min). This error aggregates one line per violation: '<property path> - <violation message>'. It wraps the collected messages in a ProvisionException so all validation problems surface at startup rather than one at a time.

Source

Thrown at processing/src/main/java/org/apache/druid/guice/JsonConfigurator.java:200

              JsonProperty annotation = theField.getAnnotation(JsonProperty.class);
              final boolean noAnnotationValue = annotation == null || Strings.isNullOrEmpty(annotation.value());
              final String pathPart = noAnnotationValue ? fieldName : annotation.value();
              if (path.length() == 0) {
                path.append(pathPart);
              } else {
                path.append(".").append(pathPart);
              }
            }
          }
        }
        catch (NoSuchFieldException e) {
          throw new RuntimeException(e);
        }

        messages.add(StringUtils.format("%s - %s", path.toString(), violation.getMessage()));
      }

      throw new ProvisionException(
          Iterables.transform(
              messages,
              new Function<>()
              {
                @Override
                public Message apply(String input)
                {
                  return new Message(StringUtils.format("%s%s", propertyBase, input));
                }
              }
          )
      );
    }

    log.debug("Loaded class[%s] from props[%s] as [%s]", clazz, propertyBase, config);

    return config;
  }

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Read the property path and violation message in the error to identify the offending config key
  2. Fix the value of the listed property in runtime.properties or the -D flag to satisfy the constraint annotation
  3. Check the config class source for the annotation (e.g. @Min, @NotNull) to learn the allowed range
  4. If the property is intentionally unused, remove it entirely instead of leaving an invalid placeholder value

Example fix

// before (runtime.properties)
druid.server.http.numThreads=-1
// after
druid.server.http.numThreads=10
Defensive patterns

Strategy: validation

Validate before calling

Set<ConstraintViolation<Object>> violations = validator.validate(configInstance);
if (!violations.isEmpty()) {
  violations.forEach(v -> System.err.println(v.getPropertyPath() + " - " + v.getMessage()));
  throw new IllegalArgumentException("config validation failed");
}

Try / catch

try { injector = Guice.createInjector(...); } catch (ProvisionException e) { log.error("Invalid config: {}", e.getMessage()); throw e; }

Prevention

When it happens

Trigger: configurate() binds a config class, deserializes properties into the instance via Jackson, then runs the Validator; any constraint violation on the populated bean produces this message and the surrounding ProvisionException.

Common situations: Runtime properties files with out-of-range numbers (druid.server.http.numThreads=-1), missing required values marked @NotNull/@NotBlank, or @Max/@Min violations on tuning configs passed via -D flags.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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