apache/druid · error · ProvisionException

Problem parsing object at prefix[%s]: %s.

Error message

Problem parsing object at prefix[%s]: %s.

What it means

JsonConfigurator.configurate() converts a JSON map built from config properties into an instance of the target class. When the mapper throws IllegalArgumentException (bad structure/type during convertValue/constructType), it is wrapped in this ProvisionException so the failing config prefix (e.g. druid.storage.type's sibling keys) is identified.

Source

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

    final T config;
    try {
      if (defaultClass != null && jsonMap.isEmpty()) {
        // No configs were provided. Don't use the jsonMapper; instead create a default instance of the default class
        // using the JsonCreator annotated factory method or no-arg constructor.
        // We know it exists because verifyClazzIsConfigurable checks for it.
        Optional<Method> factoryMethod = findJsonCreatorFactoryMethod(defaultClass);
        if (factoryMethod.isPresent()) {
          config = (T) factoryMethod.get().invoke(null);
        } else {
          config = defaultClass.getConstructor().newInstance();
        }
      } else {
        config = jsonMapper.convertValue(jsonMap, clazz);
      }
    }
    catch (IllegalArgumentException e) {
      throw new ProvisionException(
          StringUtils.format("Problem parsing object at prefix[%s]: %s.", propertyPrefix, e.getMessage()), e
      );
    }
    catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException e) {
      throw new ProvisionException(
          StringUtils.format(
              "Problem instantiating object at prefix[%s]: %s: %s.",
              propertyPrefix,
              e.getClass().getSimpleName(),
              e.getMessage()
          ),
          e
      );
    }

    final Set<ConstraintViolation<T>> violations = validator.validate(config);
    if (!violations.isEmpty()) {
      List<String> messages = new ArrayList<>();

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Read e.getMessage() in the exception — it names the offending property/value
  2. Fix the type or spelling of the config property at that prefix
  3. Compare your config against the target class's documented properties
  4. Use the same Jackson-compatible value formats (lists as comma- or JSON-formatted values per JsonConfigurator parsing rules)

Example fix

// before
-Ddruid.emitter.http.flushThreshold="lots"
// after
-Ddruid.emitter.http.flushThreshold=100000
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-flight: deserialize the same map outside Guice
jsonMapper.convertValue(propsToJsonMap(propertyPrefix), MyConfigClass.class);

Try / catch

try { startDruid(); } catch (ProvisionException e) {
  if (e.getMessage().startsWith("Problem parsing object at prefix")) {
    throw new ConfigurationException("Fix config at " + extractPrefix(e.getMessage()), e);
  }
  throw e;
}

Prevention

When it happens

Trigger: Properties under a propertyPrefix produce a JSON map whose shape does not match the target class (wrong value types, unexpected fields requiring strict validation, invalid enum names) when JsonConfigurator deserializes config for a Guice-provided object.

Common situations: Typos in enum-valued config (e.g. a bad druid.emitter.* value); supplying a string where a number/list is expected; nested config keys that don't match the class's properties; config keys left over from a deprecated extension version.

Related errors


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