apache/druid · error · ProvisionException

Some value must be configured for [%s]

Error message

Some value must be configured for [%s]

What it means

PolyBind.createChoice returns a provider that selects an implementation based on a runtime property. When neither the property is set nor any default property value or default binding key exists, the choice cannot be resolved and PolyBind.get throws ProvisionException 'Some value must be configured for [<key>]'.

Source

Thrown at processing/src/main/java/org/apache/druid/guice/PolyBind.java:189

    {
      final ParameterizedType mapType = Types.mapOf(
          String.class, Types.newParameterizedType(Provider.class, key.getTypeLiteral().getType())
      );

      final Map<String, Provider<T>> implsMap;
      if (key.getAnnotation() != null) {
        implsMap = (Map<String, Provider<T>>) injector.getInstance(Key.get(mapType, key.getAnnotation()));
      } else if (key.getAnnotationType() != null) {
        implsMap = (Map<String, Provider<T>>) injector.getInstance(Key.get(mapType, key.getAnnotationType()));
      } else {
        implsMap = (Map<String, Provider<T>>) injector.getInstance(Key.get(mapType));
      }

      String implName = props.getProperty(property);
      if (implName == null) {
        if (defaultPropertyValue == null) {
          if (defaultKey == null) {
            throw new ProvisionException(StringUtils.format("Some value must be configured for [%s]", key));
          }
          return injector.getInstance(defaultKey);
        }
        implName = defaultPropertyValue;
      }
      final Provider<T> provider = implsMap.get(implName);

      if (provider == null) {
        throw new ProvisionException(
            StringUtils.format("Unknown provider [%s] of %s, known options [%s]", implName, key, implsMap.keySet())
        );
      }

      return provider.get();
    }
  }
}

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Set the required property in runtime.properties, e.g. druid.storage.type=local or s3
  2. Call .defaultProperty(...) or default to a bound key in the PolyBind.createChoice builder in the extension/module code
  3. Check the docs for the subsystem to find which property key it expects

Example fix

// before (runtime.properties) — druid.storage.type not set
// after
druid.storage.type=local
Defensive patterns

Strategy: validation

Validate before calling

if (System.getProperty("druid.storage.type") == null && properties.getProperty("druid.storage.type") == null) {
  throw new IllegalStateException("druid.storage.type must be set");
}

Try / catch

try { injector.getInstance(key); } catch (ProvisionException e) { if (e.getMessage().startsWith("Some value must be configured")) log.error("Set required property: {}", e.getMessage()); throw e; }

Prevention

When it happens

Trigger: The Provider<T>.get() reads props.getProperty(property) and gets null while defaultPropertyValue == null and defaultKey == null (i.e. PolyBind.createChoice called without .defaultProperty or .defaultBind).

Common situations: Missing required property like druid.storage.type or druid.indexer.task.storage.type in runtime.properties; deployment template removed the property; using createChoice without supplying a default in a custom extension.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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