{"record":{"id":"650421ed40b75d90","repo":"apache/druid","slug":"druid-segmentcache-locations-must-be-set-on-histor","errorCode":null,"errorMessage":"druid.segmentCache.locations must be set on historicals.","messagePattern":"druid\\.segmentCache\\.locations must be set on historicals\\.","errorType":"exception","errorClass":"ProvisionException","httpStatus":null,"severity":"critical","filePath":"server/src/main/java/org/apache/druid/guice/StorageNodeModule.java","lineNumber":119,"sourceCode":"\n  @Provides\n  @LazySingleton\n  public DataNodeService getDataNodeService(\n      @Nullable ServerTypeConfig serverTypeConfig,\n      DruidServerConfig config,\n      @Named(IS_SEGMENT_CACHE_CONFIGURED) Boolean isSegmentCacheConfigured\n  )\n  {\n    if (serverTypeConfig == null) {\n      throw new ProvisionException(\"Must override the binding for ServerTypeConfig if you want a DataNodeService.\");\n    }\n    if (!isSegmentCacheConfigured) {\n      log.info(\n          \"Segment cache not configured on ServerType [%s]. It will not be assignable for segment placement\",\n          serverTypeConfig.getServerType()\n      );\n      if (ServerType.HISTORICAL.equals(serverTypeConfig.getServerType())) {\n        throw new ProvisionException(\"druid.segmentCache.locations must be set on historicals.\");\n      }\n    }\n\n    return new DataNodeService(\n        config.getTier(),\n        config.getMaxSize(),\n        config.getStorageSize(),\n        serverTypeConfig.getServerType(),\n        config.getPriority(),\n        isSegmentCacheConfigured\n    );\n  }\n\n  @Provides\n  @ManageLifecycle\n  public StorageLoadingThreadPool getStorageLoadingThreadPool(SegmentLoaderConfig config)\n  {\n    return StorageLoadingThreadPool.createFromConfig(config);","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/guice/StorageNodeModule.java#L101-L137","documentation":"When building DataNodeService, if the segment cache is not configured and the node's ServerType is HISTORICAL, provisioning fails: historicals must have segment cache locations (druid.segmentCache.locations) to serve segments. Non-historical types only log a warning.","triggerScenarios":"Starting a historical with no druid.segmentCache.locations configured; isSegmentCacheConfigured is false while serverTypeConfig.getServerType() is HISTORICAL.","commonSituations":"Fresh historical deployments missing segment cache config; copying broker configs to historicals; cache locations pointing to invalid paths so cache is treated as unconfigured.","solutions":["Set druid.segmentCache.locations to one or more valid local directories","Verify druid.segmentCache.locations is parsed (correct JSON list form: [{\"path\":\"/var/druid/segment-cache\",\"maxSize\":...}])","If the node is not meant to be a historical, correct the configured ServerType"],"exampleFix":"// before\ndruid.segmentCache.locations=   # unset\n// after\ndruid.segmentCache.locations=[{\"path\":\"/var/druid/segment-cache\",\"maxSize\":300000000000}]","handlingStrategy":"validation","validationCode":"if (serverType == ServerType.HISTORICAL &&\n    (segmentCacheConfig == null || segmentCacheConfig.getLocations() == null || segmentCacheConfig.getLocations().isEmpty())) {\n  throw new IllegalArgumentException(\"historicals require druid.segmentCache.locations\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  injector.getInstance(DataNodeService.class);\n} catch (ProvisionException e) {\n  if (e.getMessage().contains(\"druid.segmentCache.locations\")) {\n    log.error(\"Configure druid.segmentCache.locations for this historical\");\n  }\n  throw e;\n}","preventionTips":["Template historical configs to always include druid.segmentCache.locations with a path and maxSize","Validate runtime.properties in CI before deploy","Use the same config linter for historical vs broker configs to catch role mismatches"],"tags":["configuration","segment-cache","startup"],"backgroundTag":"missing-required-config-field","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}