{"record":{"id":"27fd4926b746f241","repo":"apache/beam","slug":"cannot-convert-unknown-s-to-s-s","errorCode":null,"errorMessage":"Cannot convert unknown %s to %s: %s","messagePattern":"Cannot convert unknown (.+?) to (.+?): (.+?)","errorType":"validation","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/util/construction/PCollectionTranslation.java","lineNumber":86,"sourceCode":"        return RunnerApi.IsBounded.Enum.UNBOUNDED;\n      default:\n        throw new IllegalArgumentException(\n            String.format(\"Unknown %s %s\", IsBounded.class.getSimpleName(), bounded));\n    }\n  }\n\n  static IsBounded fromProto(RunnerApi.IsBounded.Enum isBounded) {\n    switch (isBounded) {\n      case BOUNDED:\n        return IsBounded.BOUNDED;\n      case UNBOUNDED:\n        return IsBounded.UNBOUNDED;\n      case UNRECOGNIZED:\n      default:\n        // Whether or not this enum cannot be recognized by the proto (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 IsBounded means\n        throw new IllegalArgumentException(\n            String.format(\n                \"Cannot convert unknown %s to %s: %s\",\n                RunnerApi.IsBounded.class.getCanonicalName(),\n                IsBounded.class.getCanonicalName(),\n                isBounded));\n    }\n  }\n}\n","sourceCodeStart":68,"sourceCodeEnd":95,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/util/construction/PCollectionTranslation.java#L68-L95","documentation":"PCollectionTranslation.fromProto converts the RunnerApi.IsBounded.Enum back to the Java IsBounded. UNRECOGNIZED or unhandled proto values (proto schema newer than the linked generated code) throw this IllegalArgumentException naming the source proto enum and value.","triggerScenarios":"fromProto (or isBounded, which calls it) receiving a RunnerApi.IsBounded.Enum of UNRECOGNIZED, e.g. a pipeline proto produced by a newer Beam version with an IsBounded value the current generated code cannot map.","commonSituations":"Deserializing pipeline protos from newer Beam SDKs/runner with an older SDK version; hand-crafted or mutated protos containing values outside the known enum set.","solutions":["Upgrade the Beam SDK (and generated RunnerApi stubs) to a version that recognizes the incoming enum value.","Ensure all producers of pipeline protos use a compatible Beam version.","Inspect the pipeline proto to confirm the is_bounded field value is BOUNDED/UNBOUNDED."],"exampleFix":"// before: older SDK parsing a newer proto\nPipeline p = Pipeline.fromProto(newerProto);\n// after: upgrade dependency so enum values resolve\n// pom.xml: <dependency><groupId>org.apache.beam</groupId><artifactId>beam-sdks-java-core</artifactId><version>x.y.z (>= producer version)</version></dependency>","handlingStrategy":"validation","validationCode":"// before deserializing a pipeline proto\nif (proto.getComponents().getPcollectionsCount() > 0) { /* verify producer Beam version */ }","typeGuard":"boolean isKnown(IsBounded.Enum v) { return v != null && v != IsBounded.Enum.UNRECOGNIZED; }","tryCatchPattern":"try { fromProto(enumValue); } catch (IllegalArgumentException e) { /* upgrade Beam SDK to recognize the enum */ throw e; }","preventionTips":["Use the same Beam version for all proto producers and consumers","Upgrade SDKs before reading pipelines from newer runners","Avoid hand-editing pipeline protos"],"tags":["java","proto","enum","version-skew"],"backgroundTag":"unsupported-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"}