{"record":{"id":"acc83876912912a7","repo":"apache/druid","slug":"could-not-determine-druidnode-for-discoverydruidno","errorCode":null,"errorMessage":"Could not determine DruidNode for DiscoveryDruidNode[%s]","messagePattern":"Could not determine DruidNode for DiscoveryDruidNode\\[(.+?)\\]","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"server/src/main/java/org/apache/druid/server/http/BaseDynamicConfigSyncer.java","lineNumber":261,"sourceCode":"  /**\n   * Adds a broker to the set of inSyncBrokers if the dynamic config has not changed.\n   */\n  private synchronized void markBrokerAsSynced(DynamicConfig config, ServiceLocation broker)\n  {\n    if (config.equals(lastKnownConfig.get())) {\n      inSyncBrokers.add(new BrokerSyncStatus(broker, System.currentTimeMillis()));\n    }\n  }\n\n  /**\n   * Utility method to convert {@link DiscoveryDruidNode} to a {@link ServiceLocation}\n   */\n  @Nullable\n  private static ServiceLocation convertDiscoveryNodeToServiceLocation(DiscoveryDruidNode discoveryDruidNode)\n  {\n    final DruidNode druidNode = discoveryDruidNode.getDruidNode();\n    if (druidNode == null) {\n      log.warn(\"Could not determine DruidNode for DiscoveryDruidNode[%s]\", discoveryDruidNode);\n      return null;\n    }\n\n    return new ServiceLocation(\n        druidNode.getHost(),\n        druidNode.getPlaintextPort(),\n        druidNode.getTlsPort(),\n        \"\"\n    );\n  }\n\n  private void emitStat(CoordinatorStat stat, RowKey rowKey, long value)\n  {\n    ServiceMetricEvent.Builder eventBuilder = new ServiceMetricEvent.Builder();\n    rowKey.getValues().forEach(\n        (dim, dimValue) -> eventBuilder.setDimension(dim.reportedName(), dimValue)\n    );\n    emitter.emit(eventBuilder.setMetric(stat.getMetricName(), value));","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/server/http/BaseDynamicConfigSyncer.java#L243-L279","documentation":"BaseDynamicConfigSyncer converts DiscoveryDruidNode entries (from the cluster view) into ServiceLocation objects for dynamic config sync. If a discovered node has no DruidNode attached, the converter logs this warning and returns null, meaning that node is excluded from sync targets (e.g. broker list). It signals a node advertised itself to the discovery/DruidNodeService without complete node data.","triggerScenarios":"brokerLocation() (or syncer refresh) encounters a DiscoveryDruidNode whose getDruidNode() is null — e.g. a node registered an empty/partial DiscoveryDruidNode in the service inventory, or a node type that does not carry a DruidNode.","commonSituations":"Partially started or misconfigured service announcing itself; custom node types/extensions emitting DiscoveryDruidNode without the inner node; transient cluster-view inconsistencies.","solutions":["Inspect the offending node's registration (look at its logs/startup) so it registers with a valid DruidNode","Check for extension or custom service-emitting code that constructs DiscoveryDruidNode without a DruidNode","Restart the misbehaving node so it re-registers fully in the cluster view"],"exampleFix":"// before (extension code)\nnew DiscoveryDruidNode(null, NodeType.BROKER, null)\n// after\nnew DiscoveryDruidNode(new DruidNode(\"broker\", host, true, port, null, TLSMode.DISABLED, false), NodeType.BROKER, null)","handlingStrategy":"type-guard","validationCode":"if (discoveryNode.getDruidNode() == null) { skip; }","typeGuard":"Optional<ServiceLocation> toLocation(DiscoveryDruidNode n) { return Optional.ofNullable(n).map(DiscoveryDruidNode::getDruidNode).filter(Objects::nonNull).map(d -> new ServiceLocation(d.getHost(), d.getPlaintextPort(), ...)); }","tryCatchPattern":"try { ServiceLocation loc = syncer.brokerLocation(node); if (loc == null) { LOG.warn(\"Node {} has no DruidNode; excluding\", node); } } catch (Exception e) { /* treat as unavailable */ }","preventionTips":["Ensure all services register complete DruidNode data at startup","Audit extensions that create DiscoveryDruidNode instances","Handle null ServiceLocation in sync callers defensively"],"tags":["discovery","cluster-view","http","sync"],"backgroundTag":"resource-not-found","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"}