{"record":{"id":"ace6294b78ffdf45","repo":"apache/beam","slug":"cannot-convert-unknown-s-to-s-s-windowingstrategytranslation","errorCode":null,"errorMessage":"Cannot convert unknown %s to %s: %s","messagePattern":"Cannot convert unknown (.+?) to (.+?): (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/util/construction/WindowingStrategyTranslation.java","lineNumber":69,"sourceCode":"import org.joda.time.Duration;\n\n/** Utilities for working with {@link WindowingStrategy WindowingStrategies}. */\npublic class WindowingStrategyTranslation implements Serializable {\n\n  public static AccumulationMode fromProto(RunnerApi.AccumulationMode.Enum proto) {\n    switch (proto) {\n      case DISCARDING:\n        return AccumulationMode.DISCARDING_FIRED_PANES;\n      case ACCUMULATING:\n        return AccumulationMode.ACCUMULATING_FIRED_PANES;\n      case RETRACTING:\n        return AccumulationMode.RETRACTING_FIRED_PANES;\n      case UNRECOGNIZED:\n      default:\n        // Whether or not it is proto that cannot recognize it (due to the version of the\n        // generated code we link to) or the switch hasn't been updated to handle it,\n        // the situation is the same: we don't know what this OutputTime means\n        throw new IllegalArgumentException(\n            String.format(\n                \"Cannot convert unknown %s to %s: %s\",\n                RunnerApi.AccumulationMode.class.getCanonicalName(),\n                AccumulationMode.class.getCanonicalName(),\n                proto));\n    }\n  }\n\n  public static RunnerApi.AccumulationMode.Enum toProto(AccumulationMode accumulationMode) {\n    switch (accumulationMode) {\n      case DISCARDING_FIRED_PANES:\n        return RunnerApi.AccumulationMode.Enum.DISCARDING;\n      case ACCUMULATING_FIRED_PANES:\n        return RunnerApi.AccumulationMode.Enum.ACCUMULATING;\n      case RETRACTING_FIRED_PANES:\n        return RunnerApi.AccumulationMode.Enum.RETRACTING;\n      default:\n        throw new IllegalArgumentException(","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/util/construction/WindowingStrategyTranslation.java#L51-L87","documentation":"WindowingStrategyTranslation.fromProto converts a RunnerApi.AccumulationMode proto enum into the Java SDK AccumulationMode enum. When the proto value is UNRECOGNIZED (or hits an unhandled case) — typically because the runner/SDK linking against older generated proto code encounters a newer enum value — it throws this IllegalArgumentException naming both classes and the offending value.","triggerScenarios":"fromProto(RunnerApi.AccumulationMode) is called (via accumulationMode()/closingBehavior()/onTimeBehavior() path) with a proto enum value the linked generated code cannot recognize, or a value added in a newer Beam proto that this switch does not handle.","commonSituations":"Job submitted by a newer Beam SDK to an older runner/expansion service; proto descriptor version skew; hand-crafted strategy protos with invalid enum numbers.","solutions":["Align Beam versions: run the pipeline with an SDK version equal to or newer than the one that produced the proto.","Upgrade the runner's Beam dependency so its generated RunnerApi protos recognize the enum value.","Re-translate the pipeline so the windowing strategy uses a supported accumulation mode.","If you control the graph, set an explicitly supported accumulation mode (DISCARDING_FIRED_PANES / ACCUMULATING_FIRED_PANES / RETRACTING_FIRED_PANES)."],"exampleFix":"// before: newer SDK proto -> older runner\n// runner on Beam 2.x cannot recognize a new AccumulationMode enum value\n// after: upgrade the runner's Beam dependency to >= the submitting SDK version\nimplementation 'org.apache.beam:beam-runners-direct-java:2.50.0' // match SDK version","handlingStrategy":"try-catch","validationCode":"// Pre-check that the proto enum is resolvable before translation\nif (proto == RunnerApi.AccumulationMode.Enum.UNRECOGNIZED) {\n  throw new IllegalArgumentException(\"Unknown AccumulationMode proto value; upgrade Beam dependency\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  mode = WindowingStrategyTranslation.accumulationMode(strategyProto);\n} catch (IllegalArgumentException e) {\n  if (String.valueOf(e.getMessage()).contains(\"Cannot convert unknown\")) {\n    // upgrade runner Beam dependency to >= submitting SDK, then resubmit\n  }\n  throw e;\n}","preventionTips":["Keep runner/expansion Beam versions >= the SDK version that produced the job proto.","Avoid mixed Beam jar versions on the runner classpath.","When authoring pipelines, use only accumulation modes supported by your target runner's Beam version."],"tags":["windowing","enum","proto-translation","version-skew","java"],"backgroundTag":"invalid-enum-value","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"}