{"record":{"id":"9e04f384420887f3","repo":"apache/druid","slug":"serviceprefix-cannot-be-null-or-empty","errorCode":null,"errorMessage":"servicePrefix cannot be null or empty","messagePattern":"servicePrefix cannot be null or empty","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDiscoveryConfig.java","lineNumber":465,"sourceCode":"    private final String servicePrefix;\n    @Nullable\n    private final String datacenter;\n    @Nullable\n    private final Map<String, String> serviceTags;\n    private final Duration healthCheckInterval;\n    private final Duration deregisterAfter;\n\n    @JsonCreator\n    public ServiceConfig(\n        @JsonProperty(\"servicePrefix\") String servicePrefix,\n        @JsonProperty(\"datacenter\") @Nullable String datacenter,\n        @JsonProperty(\"serviceTags\") @Nullable Map<String, String> serviceTags,\n        @JsonProperty(\"healthCheckInterval\") @Nullable Duration healthCheckInterval,\n        @JsonProperty(\"deregisterAfter\") @Nullable Duration deregisterAfter\n    )\n    {\n      if (servicePrefix == null || servicePrefix.isEmpty()) {\n        throw new IAE(\"servicePrefix cannot be null or empty\");\n      }\n      this.servicePrefix = servicePrefix;\n      this.datacenter = datacenter;\n      this.serviceTags = serviceTags == null\n                         ? null\n                         : Collections.unmodifiableMap(new LinkedHashMap<>(serviceTags));\n      this.healthCheckInterval = validatePositive(healthCheckInterval, DEFAULT_HEALTH_CHECK_INTERVAL_MS, \"healthCheckInterval\");\n      this.deregisterAfter = validateNonNegative(deregisterAfter, DEFAULT_DEREGISTER_AFTER_MS, \"deregisterAfter\");\n    }\n\n    @JsonProperty\n    public String getServicePrefix()\n    {\n      return servicePrefix;\n    }\n\n    @JsonProperty\n    @Nullable","sourceCodeStart":447,"sourceCodeEnd":483,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDiscoveryConfig.java#L447-L483","documentation":"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.","triggerScenarios":"Thrown at extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDiscoveryConfig.java:465 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set servicePrefix in the service config block to a real prefix, e.g. druid/.","Fix empty-string values and verify the property binding."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}