{"record":{"id":"6c38bf5d432f0e15","repo":"apache/beam","slug":"could-not-find-a-transform-with-the-id","errorCode":null,"errorMessage":"Could not find a transform with the ID ","messagePattern":"Could not find a transform with the ID ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/util/construction/TransformUpgrader.java","lineNumber":197,"sourceCode":"    }\n\n    if (service != null) {\n      service.shutdown();\n    }\n\n    return pipeline;\n  }\n\n  private RunnerApi.Pipeline updateTransformViaTransformService(\n      RunnerApi.Pipeline runnerAPIpipeline,\n      String transformId,\n      Endpoints.ApiServiceDescriptor transformServiceEndpoint,\n      PipelineOptions options)\n      throws IOException {\n    RunnerApi.PTransform transformToUpgrade =\n        runnerAPIpipeline.getComponents().getTransformsMap().get(transformId);\n    if (transformToUpgrade == null) {\n      throw new IllegalArgumentException(\"Could not find a transform with the ID \" + transformId);\n    }\n\n    byte[] payloadBytes = null;\n\n    if (!transformToUpgrade.getSpec().getUrn().equals(BeamUrns.getUrn(SCHEMA_TRANSFORM))) {\n      ByteString configRowBytes =\n          transformToUpgrade.getAnnotationsOrThrow(\n              BeamUrns.getConstant(ExternalTransforms.Annotations.Enum.CONFIG_ROW_KEY));\n      ByteString configRowSchemaBytes =\n          transformToUpgrade.getAnnotationsOrThrow(\n              BeamUrns.getConstant(ExternalTransforms.Annotations.Enum.CONFIG_ROW_SCHEMA_KEY));\n      SchemaApi.Schema configRowSchemaProto =\n          SchemaApi.Schema.parseFrom(configRowSchemaBytes.toByteArray());\n      payloadBytes =\n          ExternalTransforms.ExternalConfigurationPayload.newBuilder()\n              .setSchema(configRowSchemaProto)\n              .setPayload(configRowBytes)\n              .build()","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/util/construction/TransformUpgrader.java#L179-L215","documentation":"updateTransformViaTransformService looks up the transform to upgrade by ID in the runner API pipeline proto. If the ID is absent from the pipeline's transforms map, the upgrade cannot proceed and it throws IllegalArgumentException.","triggerScenarios":"Passing a transformId in transformsToOverride map that doesn't exist in the current pipeline proto (stale ID, renamed transform, or wrong pipeline).","commonSituations":"Transform IDs changed after earlier rewriting/optimization passes; overriding transforms in a different pipeline than the one the IDs came from; typos in transform IDs.","solutions":["Use the exact composite/transform ID present in the pipeline proto (inspect via pipeline.toString() or RunnerApi dump)","Re-run upgrader before other rewrites that might rename transforms","Remove the stale ID from transformsToOverride"],"exampleFix":"// before\noptions.setTransformsToOverride(ImmutableMap.of(\"old_id\", \"urn:beam:...\")); // id not in pipeline\n// after\n// find real id from pipeline proto, e.g. \"External/Read\" \noptions.setTransformsToOverride(ImmutableMap.of(\"External/Read\", \"urn:beam:...\"));","handlingStrategy":"validation","validationCode":"// Check IDs against the pipeline proto before upgrading:\nMap<String, RunnerApi.PTransform> transforms =\n    RunnerApi.Pipeline.parseFrom(pipelineBytes).getComponents().getTransformsMap();\nfor (String id : requestedIds) {\n  if (!transforms.containsKey(id)) throw new IllegalStateException(\"No transform with ID: \" + id);\n}","typeGuard":null,"tryCatchPattern":"try { pipeline.run(); } catch (IllegalArgumentException e) {\n  if (e.getMessage().startsWith(\"Could not find a transform with the ID\")) { /* fix the ID */ }\n  else throw e;\n}","preventionTips":["Derive transform IDs from the current pipeline proto, not cached copies","Avoid renaming rewrites between ID capture and the upgrade step"],"tags":["java","beam","transform","not-found"],"backgroundTag":"resource-not-found","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"}