{"record":{"id":"95663baa90e4189d","repo":"apache/druid","slug":"pod-template-file-not-specified-for-s","errorCode":null,"errorMessage":"Pod template file not specified for [%s]","messagePattern":"Pod template file not specified for \\[(.+?)\\]","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/DynamicConfigPodTemplateSelector.java","lineNumber":102,"sourceCode":"  {\n    Set<String> taskAdapterTemplates = new HashSet<>();\n\n    for (String runtimeProperty : properties.stringPropertyNames()) {\n      if (runtimeProperty.startsWith(TASK_PROPERTY)) {\n        String[] taskAdapterPropertyPaths = runtimeProperty.split(\"\\\\.\");\n        taskAdapterTemplates.add(taskAdapterPropertyPaths[taskAdapterPropertyPaths.length - 1]);\n      }\n    }\n\n    return taskAdapterTemplates;\n  }\n\n  private PodTemplate loadPodTemplate(String key, Properties properties) throws IAE\n  {\n    String property = TASK_PROPERTY + key;\n    String podTemplateFile = properties.getProperty(property);\n    if (podTemplateFile == null) {\n      throw new IAE(\"Pod template file not specified for [%s]\", property);\n    }\n\n    try {\n      // Use Optional to assert unmarshal result is non-null.\n      Optional<PodTemplate> maybeTemplate = Optional.of(Serialization.unmarshal(\n          Files.newInputStream(new File(podTemplateFile).toPath()),\n          PodTemplate.class\n      ));\n\n      return maybeTemplate.get();\n    }\n    catch (Exception e) {\n      throw new IAE(e, \"Failed to load pod template file for [%s] at [%s]\", property, podTemplateFile);\n    }\n  }\n\n  @SuppressWarnings(\"ResultOfMethodCallIgnored\")\n  private void validateTemplateSupplier(Supplier<PodTemplate> templateSupplier) throws IAE","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/DynamicConfigPodTemplateSelector.java#L84-L120","documentation":"Thrown by DynamicConfigPodTemplateSelector.loadPodTemplate when the property druid.indexer.runner.k8s.podTemplate.<key> exists in the selector's key set (so a template for this key was registered) but its value is null — i.e. no pod template file path was actually specified. The lazy supplier runs when a task first requests the template, surfacing this IllegalArgumentException at task launch time.","triggerScenarios":"A podTemplate key was discovered in the properties (key present with empty/blank handling differences) but properties.getProperty(TASK_PROPERTY + key) returns null when the supplier executes — e.g. the key was registered from taskAdapterTemplates keys but the file path property was never set, or the property was removed between selector construction and template load.","commonSituations":"Config hot-reload / dynamic reconfiguration removing the file path while the selector still knows the template name; typos leaving a key entry without its path value; partial config deployments where only some Overlords have the file path property.","solutions":["Set the file path for the missing template key, e.g. druid.indexer.runner.k8s.podTemplate.<key>=/path/to/template.yaml","Confirm the property is present on ALL Overlord instances and not removed by dynamic config updates","Restart/redeploy the Overlord so the selector re-reads a consistent properties set"],"exampleFix":"// before\n# template key registered but no path\ndruid.indexer.runner.k8s.podTemplate.batch=\n\n// after\ndruid.indexer.runner.k8s.podTemplate.batch=/etc/druid/k8s/batch.yaml","handlingStrategy":"validation","validationCode":"// Ensure every podTemplate key has a non-empty file path before use\nString prop = \"druid.indexer.runner.k8s.podTemplate.\" + key;\nString path = props.getProperty(prop);\nif (path == null || path.trim().isEmpty()) {\n    throw new IllegalArgumentException(prop + \" must point to a pod template file\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never leave podTemplate.<key> properties empty in config management","Verify all Overlord instances carry identical podTemplate properties after hot reloads","Diff runtime properties across Overlords after dynamic config changes"],"tags":["kubernetes","pod-template","configuration","druid-overlord"],"backgroundTag":"missing-config-value","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"}