apache/druid · error · IllegalArgumentException

servicePrefix cannot be null or empty

Error message

servicePrefix cannot be null or empty

What it means

Validation in the @JsonCreator constructor of ServiceConfig: the required servicePrefix JSON/property was missing, null, or the empty string. Every service registered/discovered via this config must have a non-empty prefix, so the deserializer rejects the config; supply a valid servicePrefix.

Solutions

  1. Set servicePrefix in the service config block to a real prefix, e.g. druid/.
  2. Fix empty-string values and verify the property binding.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDiscoveryConfig.java:465 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDiscoveryConfig.java:465

    private final String servicePrefix;
    @Nullable
    private final String datacenter;
    @Nullable
    private final Map<String, String> serviceTags;
    private final Duration healthCheckInterval;
    private final Duration deregisterAfter;

    @JsonCreator
    public ServiceConfig(
        @JsonProperty("servicePrefix") String servicePrefix,
        @JsonProperty("datacenter") @Nullable String datacenter,
        @JsonProperty("serviceTags") @Nullable Map<String, String> serviceTags,
        @JsonProperty("healthCheckInterval") @Nullable Duration healthCheckInterval,
        @JsonProperty("deregisterAfter") @Nullable Duration deregisterAfter
    )
    {
      if (servicePrefix == null || servicePrefix.isEmpty()) {
        throw new IAE("servicePrefix cannot be null or empty");
      }
      this.servicePrefix = servicePrefix;
      this.datacenter = datacenter;
      this.serviceTags = serviceTags == null
                         ? null
                         : Collections.unmodifiableMap(new LinkedHashMap<>(serviceTags));
      this.healthCheckInterval = validatePositive(healthCheckInterval, DEFAULT_HEALTH_CHECK_INTERVAL_MS, "healthCheckInterval");
      this.deregisterAfter = validateNonNegative(deregisterAfter, DEFAULT_DEREGISTER_AFTER_MS, "deregisterAfter");
    }

    @JsonProperty
    public String getServicePrefix()
    {
      return servicePrefix;
    }

    @JsonProperty
    @Nullable

View on GitHub (pinned to 9b90983fd2)