使用DataFlowRunner时未实现Beam / DataFlow意外错误ProtocolMessageEnum

时间:2019-01-14 10:58:21

标签: protocol-buffers google-cloud-dataflow apache-beam dataflow

在本地运行我的Beam管道时,所有功能都能按预期工作,但是当尝试在DataflowRunner上运行它时,我突然收到以下错误。老实说,我什至不知道从哪里开始对此进行评估,因为DataflowRunner似乎是一个黑匣子。

Jan 14, 2019 11:26:51 AM org.apache.beam.runners.dataflow.DataflowRunner fromOptions
INFO: PipelineOptions.filesToStage was not specified. Defaulting to files from the classpath: will stage 165 files. Enable logging at DEBUG level to see which files will be staged.
Exception in thread "main" java.lang.IncompatibleClassChangeError: Class org.apache.beam.model.pipeline.v1.RunnerApi$StandardPTransforms$Primitives does not implement the requested interface com.google.protobuf.ProtocolMessageEnum
        at org.apache.beam.runners.core.construction.BeamUrns.getUrn(BeamUrns.java:27)
        at org.apache.beam.runners.core.construction.PTransformTranslation.<clinit>(PTransformTranslation.java:58)
        at org.apache.beam.runners.core.construction.UnconsumedReads$1.visitValue(UnconsumedReads.java:49)
        at org.apache.beam.sdk.runners.TransformHierarchy$Node.visit(TransformHierarchy.java:666)
        at org.apache.beam.sdk.runners.TransformHierarchy$Node.visit(TransformHierarchy.java:649)
        at org.apache.beam.sdk.runners.TransformHierarchy$Node.visit(TransformHierarchy.java:649)
        at org.apache.beam.sdk.runners.TransformHierarchy$Node.visit(TransformHierarchy.java:649)
        at org.apache.beam.sdk.runners.TransformHierarchy$Node.access$600(TransformHierarchy.java:311)
        at org.apache.beam.sdk.runners.TransformHierarchy.visit(TransformHierarchy.java:245)
        at org.apache.beam.sdk.Pipeline.traverseTopologically(Pipeline.java:458)
        at org.apache.beam.runners.core.construction.UnconsumedReads.ensureAllReadsConsumed(UnconsumedReads.java:40)
        at org.apache.beam.runners.dataflow.DataflowRunner.replaceTransforms(DataflowRunner.java:868)
        at org.apache.beam.runners.dataflow.DataflowRunner.run(DataflowRunner.java:660)
        at org.apache.beam.runners.dataflow.DataflowRunner.run(DataflowRunner.java:173)
        at org.apache.beam.sdk.Pipeline.run(Pipeline.java:313)
        at org.apache.beam.sdk.Pipeline.run(Pipeline.java:299)
        at (my code: pipe.run().waitUntilFinish();) 

1 个答案:

答案 0 :(得分:0)

检查Beam等的版本,并在可能的情况下升级依赖项。

我有相同的错误,看到您收到此错误后,我认为这一定是依赖性冲突,因为它以前不存在。

我正在使用scio部署到数据流,只是引用了他们正在使用的内容。 https://github.com/spotify/scio/blob/v0.7.1/build.sbt 我也更新了番石榴和protobuf。

我知道您使用的是Java,但是尝试将Beam更新到2.9.0,也许是番石榴,protobuf ...