{"record":{"id":"e254e5756bf6a064","repo":"apache/beam","slug":"error-parsing-deferred-artifact-payload","errorCode":null,"errorMessage":"Error parsing deferred artifact payload.","messagePattern":"Error parsing deferred artifact payload\\.","errorType":"exception","errorClass":"java.lang.RuntimeException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/util/construction/Environments.java","lineNumber":490,"sourceCode":"    return artifactsBuilder.build();\n  }\n\n  public static List<ArtifactInformation> getDeferredArtifacts(PipelineOptions options) {\n    List<String> stagingFiles = options.as(PortablePipelineOptions.class).getFilesToStage();\n    if (stagingFiles == null || stagingFiles.isEmpty()) {\n      return ImmutableList.of();\n    }\n\n    String key = UUID.randomUUID().toString();\n    DefaultArtifactResolver.INSTANCE.register(\n        (info) -> {\n          if (BeamUrns.getUrn(StandardArtifacts.Types.DEFERRED).equals(info.getTypeUrn())) {\n            RunnerApi.DeferredArtifactPayload deferredArtifactPayload;\n            try {\n              deferredArtifactPayload =\n                  RunnerApi.DeferredArtifactPayload.parseFrom(info.getTypePayload());\n            } catch (InvalidProtocolBufferException e) {\n              throw new RuntimeException(\"Error parsing deferred artifact payload.\", e);\n            }\n            if (key.equals(deferredArtifactPayload.getKey())) {\n              return Optional.of(getArtifacts(stagingFiles));\n            } else {\n              return Optional.empty();\n            }\n          } else {\n            return Optional.empty();\n          }\n        });\n\n    return ImmutableList.of(\n        ArtifactInformation.newBuilder()\n            .setTypeUrn(BeamUrns.getUrn(StandardArtifacts.Types.DEFERRED))\n            .setTypePayload(\n                RunnerApi.DeferredArtifactPayload.newBuilder().setKey(key).build().toByteString())\n            .build());\n  }","sourceCodeStart":472,"sourceCodeEnd":508,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/util/construction/Environments.java#L472-L508","documentation":"getDeferredArtifacts parses the typePayload of each DEFERRED artifact as a DeferredArtifactPayload proto message. If the bytes are not a valid protobuf (InvalidProtocolBufferException) it throws a RuntimeException. It means the deferred artifact's payload is corrupt or not in the expected proto encoding.","triggerScenarios":"An artifact registered with the DEFERRED type URN whose typePayload bytes were produced by an incompatible SDK version or hand-crafted/stale staged data, then read during environment creation.","commonSituations":"Mixing Beam versions between job submission and staging service; custom artifact injection writing raw bytes into typePayload; corrupted staged artifact metadata.","solutions":["Regenerate/re-stage the artifacts with the same Beam version used to run the pipeline","Align SDK versions between the submitting pipeline and the artifact staging service","Inspect the artifact typePayload — only valid DeferredArtifactPayload protobufs are accepted"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { artifacts = getDeferredArtifacts(...); } catch (RuntimeException e) { if (e.getMessage().equals(\"Error parsing deferred artifact payload.\")) { /* re-stage artifacts with matching Beam version */ } }","preventionTips":["Use the same Beam version for submission and staging","Do not hand-craft typePayload bytes for DEFERRED artifacts","Validate staged artifact metadata after staging"],"tags":["java","apache-beam","protobuf","artifact-staging"],"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"}