{"record":{"id":"0c5fcd6be7d7d5a6","repo":"apache/beam","slug":"expected-the-path-to-be-not-null","errorCode":null,"errorMessage":"Expected the path to be not null","messagePattern":"Expected the path to be not null","errorType":"exception","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/expansion-service/src/main/java/org/apache/beam/sdk/expansion/service/ExpansionServiceConfig.java","lineNumber":77,"sourceCode":"    Map<String, List<Dependency>> dependencies = new HashMap<>();\n    if (config.get(\"allowlist\") != null) {\n      allowList = (List<String>) config.get(\"allowlist\");\n    }\n\n    if (config.get(\"dependencies\") != null) {\n      Map<String, List<Object>> dependenciesFromConfig =\n          (Map<String, List<Object>>) config.get(\"dependencies\");\n      dependenciesFromConfig.forEach(\n          (k, v) -> {\n            if (v != null) {\n              List<Dependency> dependenciesForTransform =\n                  v.stream()\n                      .map(\n                          val -> {\n                            Map<String, Object> depProperties = (Map<String, Object>) val;\n                            String path = (String) depProperties.get(\"path\");\n                            if (path == null) {\n                              throw new IllegalArgumentException(\n                                  \"Expected the path to be not null\");\n                            }\n                            return Dependency.create(path);\n                          })\n                      .collect(Collectors.toList());\n              dependencies.put(k, dependenciesForTransform);\n            }\n          });\n    }\n    return ExpansionServiceConfig.create(allowList, dependencies);\n  }\n}\n","sourceCodeStart":59,"sourceCodeEnd":90,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/expansion-service/src/main/java/org/apache/beam/sdk/expansion/service/ExpansionServiceConfig.java#L59-L90","documentation":"Thrown by ExpansionServiceConfig.parseFromYamlStream while parsing the 'dependencies' section: each dependency entry must include a 'path' key identifying the jar/URL to stage. When a dependency map lacks 'path', the service cannot construct a Dependency and fails fast.","triggerScenarios":"A YAML config file with a dependencies entry that specifies other keys (or none) but no 'path', e.g. 'dependencies:\\n  transform: [{}]'.","commonSituations":"Hand-edited config file with a typo like 'paths:' or 'file:' instead of 'path'; a list item that is an empty map; copying an example and deleting the path value.","solutions":["Add the required 'path' key to every dependency entry in the YAML.","Fix the key spelling to exactly 'path'.","Remove empty map entries ({}) from the dependencies list."],"exampleFix":"// before\ndependencies:\n  org.example:MyTransform:\n    - paths: /jars/my.jar\n// after\ndependencies:\n  org.example:MyTransform:\n    - path: /jars/my.jar","handlingStrategy":"validation","validationCode":"Map<String, Object> cfg = new Yaml().load(new FileInputStream(configPath));\nfor (Map.Entry<String, Object> e : ((Map<String, Object>) cfg.getOrDefault(\"dependencies\", Map.of())).entrySet()) {\n  for (Object dep : (List<?>) e.getValue()) {\n    if (((Map<?, ?>) dep).get(\"path\") == null) {\n      throw new IllegalStateException(\"Dependency for \" + e.getKey() + \" missing 'path'\");\n    }\n  }\n}","typeGuard":"boolean hasPath(Object dep) { return dep instanceof Map && ((Map<?, ?>) dep).get(\"path\") instanceof String && !((String) ((Map<?, ?>) dep).get(\"path\")).isEmpty(); }","tryCatchPattern":"try {\n  cfg = ExpansionServiceConfig.parseFromYamlStream(stream);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().contains(\"path to be not null\")) { /* fix dependencies YAML */ }\n  throw e;\n}","preventionTips":["Validate the dependencies section against a JSON/YAML schema in CI.","Use the exact key 'path' in every dependency entry.","Keep example config files in the repo and lint against them."],"tags":["java","yaml","config","missing-key"],"backgroundTag":"missing-required-config-field","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}