{"record":{"id":"d55088a06bb43cad","repo":"apache/beam","slug":"s-translated-s-with-urn-s-but-payload-was-not-a-s","errorCode":null,"errorMessage":"%s translated %s with URN '%s' but payload was not a %s","messagePattern":"(.+?) translated (.+?) with URN '(.+?)' but payload was not a (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/util/construction/WindowIntoTranslation.java","lineNumber":93,"sourceCode":"      transformProto =\n          PTransformTranslation.toProto(application, Collections.emptyList(), components);\n    } catch (IOException exc) {\n      throw new RuntimeException(exc);\n    }\n\n    checkArgument(\n        PTransformTranslation.ASSIGN_WINDOWS_TRANSFORM_URN.equals(\n            transformProto.getSpec().getUrn()),\n        \"Illegal attempt to extract %s from transform %s with name \\\"%s\\\" and URN \\\"%s\\\"\",\n        Window.Assign.class.getSimpleName(),\n        application.getTransform(),\n        application.getFullName(),\n        transformProto.getSpec().getUrn());\n\n    try {\n      return WindowIntoPayload.parseFrom(transformProto.getSpec().getPayload());\n    } catch (InvalidProtocolBufferException exc) {\n      throw new IllegalStateException(\n          String.format(\n              \"%s translated %s with URN '%s' but payload was not a %s\",\n              PTransformTranslation.class.getSimpleName(),\n              application,\n              PTransformTranslation.ASSIGN_WINDOWS_TRANSFORM_URN,\n              WindowIntoPayload.class.getSimpleName()),\n          exc);\n    }\n  }\n\n  public static @Nullable WindowFn<?, ?> getWindowFn(AppliedPTransform<?, ?, ?> application) {\n    return WindowingStrategyTranslation.windowFnFromProto(\n        getWindowIntoPayload(application).getWindowFn());\n  }\n\n  /** A {@link PTransformTranslation.TransformPayloadTranslator} for {@link Window}. */\n  public static class WindowIntoPayloadTranslator\n      implements PTransformTranslation.TransformPayloadTranslator<Window.Assign<?>> {","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/util/construction/WindowIntoTranslation.java#L75-L111","documentation":"WindowIntoTranslation.getWindowIntoPayload() parses the payload of a PTransform whose URN is ASSIGN_WINDOWS, expecting a serialized WindowIntoPayload protobuf. If protobuf parsing fails (InvalidProtocolBufferException), it throws this IllegalStateException indicating the transform that claimed to be a window-assignment transform has a payload of the wrong type.","triggerScenarios":"Rehydrating a pipeline proto (e.g. a runner reading a submitted job graph, or BeamFnApi translation) where the transform with URN 'beam:transform:assign_windows:v1' has a spec payload that is not a valid serialized WindowIntoPayload — corrupted graph, hand-crafted proto, or a runner/SDK version mismatch producing a different payload message.","commonSituations":"Custom runners deserializing job protos produced by a different Beam version; pipelines built/modified programmatically that put the wrong payload into an assign-windows PTransform; corrupted job submissions.","solutions":["Regenerate/retranslate the pipeline with the same Beam SDK version so the payload is a proper WindowIntoPayload.","Verify no code manually writes PTransform specs with the assign-windows URN and a foreign payload.","Check runner/SDK version compatibility; upgrade the runner harness to a matching Beam version.","Inspect the failing transform's spec payload bytes to identify what actually got serialized."],"exampleFix":"// before: manually building an assign-windows transform with a foreign payload\nPTransform.newBuilder().setSpec(FunctionSpec.newBuilder().setUrn(ASSIGN_WINDOWS_URN)\n    .setPayload(anyOtherProtoBytes)).build();\n// after: let translation build it from WindowInto\npc.apply(Window.into(FixedWindows.of(Duration.standardMinutes(1))));","handlingStrategy":"try-catch","validationCode":"// Validate the transform proto payload parses before translating\ntry {\n  WindowIntoPayload.parseFrom(transformProto.getSpec().getPayload());\n} catch (InvalidProtocolBufferException e) {\n  throw new IllegalStateException(\"Assign-windows transform payload is not a WindowIntoPayload\", e);\n}","typeGuard":null,"tryCatchPattern":"try {\n  strategy = WindowingStrategyTranslation.fromProto(windowingStrategyProto);\n} catch (IllegalStateException e) {\n  if (String.valueOf(e.getMessage()).contains(\"payload was not a\")) {\n    // regenerate/retranslate the pipeline with a matching Beam version\n  }\n  throw e;\n}","preventionTips":["Never hand-craft PTransform specs with the assign-windows URN and foreign payloads.","Keep runner and SDK Beam versions aligned so translation round-trips cleanly.","Avoid mutating pipeline protos after submission.","Test custom runners against standard SDK-generated pipeline protos."],"tags":["pipeline-graph","protobuf","windowing","translation","java"],"backgroundTag":"protobuf-unmarshal-failed","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"}