{"record":{"id":"86323a328abb93a7","repo":"apache/beam","slug":"failed-to-build-transform-s-from-spec-s-s","errorCode":null,"errorMessage":"Failed to build transform %s from spec %s: %s","messagePattern":"Failed to build transform (.+?) from 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":280,"sourceCode":"      } else {\n        try {\n          ExternalConfigurationPayload payload =\n              ExternalConfigurationPayload.parseFrom(spec.getPayload());\n          Row configRow =\n              RowCoder.of(SchemaTranslation.schemaFromProto(payload.getSchema()))\n                  .decode(new ByteArrayInputStream(payload.getPayload().toByteArray()));\n          PTransform transformFromRow = payloadTranslator.fromConfigRow(configRow, options);\n          if (transformFromRow != null) {\n            return transformFromRow;\n          } else {\n            throw new RuntimeException(\n                String.format(\n                    \"A transform cannot be initiated using the provided config row %s and the\"\n                        + \" TransformPayloadTranslator %s\",\n                    configRow, payloadTranslator));\n          }\n        } catch (Exception e) {\n          throw new RuntimeException(\n              String.format(\n                  \"Failed to build transform %s from spec %s: %s\",\n                  spec.getUrn(), spec, e.getMessage()),\n              e);\n        }\n      }\n    }\n\n    @Override\n    public InputT createInput(Pipeline p, Map<String, PCollection<?>> inputs) {\n      if (isSchemaTransform()) {\n        return (InputT) ExpansionServiceSchemaTransformProvider.of().createInput(p, inputs);\n      } else {\n        return TransformProvider.super.createInput(p, inputs);\n      }\n    }\n\n    @Override","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/expansion-service/src/main/java/org/apache/beam/sdk/expansion/service/ExpansionService.java#L262-L298","documentation":"ExpansionService.getTransform() wraps any exception raised while building a transform from a config-row-based spec into this RuntimeException, preserving the original as cause. The message includes the URN, the full spec, and the original exception message.","triggerScenarios":"Any Exception thrown inside the try block - schema/payload decoding errors, fromConfigRow failures, or translator construction errors - while resolving a transform by URN during pipeline expansion.","commonSituations":"Malformed payload schema proto; config Row deserialization failing; translator throwing during PTransform construction (bad connection params, missing files); URN belonging to a translator whose dependencies are missing on the classpath.","solutions":["Read the 'Caused by' exception - this message only summarizes the failure","Verify the spec's URN matches a translator available in the expansion service","Validate the payload bytes and schema proto are consistent with the translator's expectations","Ensure all connector dependencies are present in the expansion service classpath"],"exampleFix":"// before: expansion service without JDBC driver dependency\njava -jar expansion-service.jar\n// after: add driver to classpath\njava -cp expansion-service.jar:postgresql-42.7.3.jar org.apache.beam.sdk.expansion.service.ExpansionService ...","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { transform = service.getTransform(spec, options); } catch (RuntimeException e) { log.error(\"Expansion failed for URN {}: {}\", spec.getUrn(), e.getCause(), e); throw e; }","preventionTips":["Always diagnose via the cause chain - this wrapper hides the real problem","Ensure connector dependencies (JDBC drivers, cloud clients) are on the expansion service classpath","Validate URNs against the set of translators the service registers"],"tags":["java","beam","expansion-service","transform","wrapped-exception"],"backgroundTag":"api-request-failed","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"}