{"record":{"id":"eddb7f962ab3d521","repo":"apache/beam","slug":"failed-to-get-dependencies-for-spec-s","errorCode":null,"errorMessage":"Failed to get dependencies for spec %s","messagePattern":"Failed to get dependencies for spec (.+?)","errorType":"exception","errorClass":"java.lang.RuntimeException","httpStatus":null,"severity":"error","filePath":"sdks/java/expansion-service/src/main/java/org/apache/beam/sdk/expansion/service/ExpansionService.java","lineNumber":353,"sourceCode":"                ExternalConfigurationPayload.parseFrom(spec.getPayload()), configClass));\n      } catch (Exception e) {\n        throw new RuntimeException(\n            String.format(\"Failed to build transform from spec %s: %s\", spec, e.getMessage()), e);\n      }\n    }\n\n    @Override\n    public List<String> getDependencies(RunnerApi.FunctionSpec spec, PipelineOptions options) {\n      try {\n        Class configClass = getConfigClass(transformBuilder);\n        Optional<List<String>> dependencies =\n            transformBuilder.getDependencies(\n                payloadToConfig(\n                    ExternalConfigurationPayload.parseFrom(spec.getPayload()), configClass),\n                options);\n        return dependencies.orElseGet(() -> TransformProvider.super.getDependencies(spec, options));\n      } catch (Exception e) {\n        throw new RuntimeException(\n            String.format(\"Failed to get dependencies for spec %s\", spec), e);\n      }\n    }\n\n    @Override\n    public boolean equals(@Nullable Object other) {\n      return other instanceof TransformProviderForBuilder\n          && Objects.equals(\n              transformBuilder, ((TransformProviderForBuilder) other).transformBuilder);\n    }\n\n    @Override\n    public int hashCode() {\n      return transformBuilder.hashCode();\n    }\n  }\n\n  private static <ConfigT> Class<ConfigT> getConfigClass(","sourceCodeStart":335,"sourceCodeEnd":371,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/expansion-service/src/main/java/org/apache/beam/sdk/expansion/service/ExpansionService.java#L335-L371","documentation":"ExpansionService.getDependencies() resolves a transform's artifact dependencies from its config; any exception during payload parsing or dependency resolution is wrapped in this RuntimeException. The expansion service needs these dependencies to stage files for cross-language execution.","triggerScenarios":"Calling getDependencies with a spec whose ExternalConfigurationPayload cannot be parsed, whose config class cannot be constructed, or whose transformBuilder.getDependencies() throws; also fires when the builder path fails before falling back to the default dependency list.","commonSituations":"Connector builders requiring files/URLs that do not exist to compute dependencies; malformed payload after client upgrade; config class schema drift between the sending SDK and the expansion service.","solutions":["Read the 'Caused by' to find whether payload parsing or getDependencies failed","Validate that any files/URLs referenced in the config exist and are reachable from the service","Ensure the ExternalConfigurationPayload schema matches the config class","Keep Beam versions aligned between the pipeline submitter and expansion service"],"exampleFix":"// before\nWriteToFiles.withFileLocation('/nonexistent/dir')\n// after: ensure the path exists and is accessible\nWriteToFiles.withFileLocation('/data/output')","handlingStrategy":"try-catch","validationCode":"// verify referenced dependency locations exist before expansion\nfor (String path : configDependencyPaths) { if (!Files.exists(Paths.get(path))) throw new FileNotFoundException(path); }","typeGuard":null,"tryCatchPattern":"try { deps = service.getDependencies(spec, options); } catch (RuntimeException e) { if (e.getMessage().startsWith(\"Failed to get dependencies\")) { /* check payload and referenced resources */ } throw e; }","preventionTips":["Verify all files/URLs referenced by configs are reachable from the expansion service host","Keep the payload schema and Beam versions aligned on both sides","Log the full cause chain for dependency resolution failures"],"tags":["java","beam","expansion-service","dependencies","staging"],"backgroundTag":"api-error-response","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}