{"record":{"id":"427bfcd5d1c886a7","repo":"apache/beam","slug":"could-not-decode-provided-windows-with-the-provided-window","errorCode":null,"errorMessage":"Could not decode provided windows with the provided window coder","messagePattern":"Could not decode provided windows with the provided window coder","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/testing/WindowSupplier.java","lineNumber":82,"sourceCode":"    this.encodedWindows = encodedWindows;\n  }\n\n  @Override\n  public Collection<BoundedWindow> get() {\n    if (windows == null) {\n      decodeWindows();\n    }\n    return windows;\n  }\n\n  private synchronized void decodeWindows() {\n    if (windows == null) {\n      ImmutableList.Builder<BoundedWindow> windowsBuilder = ImmutableList.builder();\n      for (byte[] encoded : encodedWindows) {\n        try {\n          windowsBuilder.add(CoderUtils.decodeFromByteArray(coder, encoded));\n        } catch (CoderException e) {\n          throw new IllegalArgumentException(\n              \"Could not decode provided windows with the provided window coder\", e);\n        }\n      }\n      this.windows = windowsBuilder.build();\n    }\n  }\n}\n","sourceCodeStart":64,"sourceCodeEnd":90,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/testing/WindowSupplier.java#L64-L90","documentation":"WindowSupplier.get lazily decodes its pre-encoded window bytes; if CoderUtils.decodeFromByteArray fails for any entry it throws this IllegalArgumentException wrapping the CoderException. Indicates the stored bytes no longer match the coder being used.","triggerScenarios":"decodeWindows() invoked on first get() where encodedWindows bytes cannot be decoded by the supplied coder (corrupted bytes, coder changed since of() was called, Java serialization deserialization across class changes).","commonSituations":"WindowSupplier serialized/deserialized in a pipeline where the coder class changed between versions, or a coder whose decode is stricter than its encode.","solutions":["Ensure the same Coder instance/type is used to construct and to decode the WindowSupplier","Align Beam SDK versions across the pipeline that serialized the WindowSupplier","Rebuild the WindowSupplier via WindowSupplier.of with matching coder and windows"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  supplier.get();\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().contains(\"Could not decode provided windows\")) {\n    throw new IllegalStateException(\"WindowSupplier coder/bytes mismatch; rebuild supplier\", e);\n  }\n  throw e;\n}","preventionTips":["Use the identical Coder instance at of() time and at decode time","Avoid serializing WindowSupplier across incompatible Beam versions","Rebuild WindowSupplier.of(...) after any coder change"],"tags":["java","windows","coder","decoding"],"backgroundTag":"schema-validation-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"}