Google cloud dataflow DataflowRunner以“退出”;找不到要暂存的文件。”;
我想从运行Google cloud dataflow DataflowRunner以“退出”;找不到要暂存的文件。”;,google-cloud-dataflow,Google Cloud Dataflow,我想从运行WordCountjava示例,但不知何故,我得到了一个错误,ClasspathScanningResourcesDetector没有找到要暂存的文件。我完全按照网站上的描述运行示例: mvn compile exec:java -Dexec.mainClass=org.apache.beam.examples.WordCount \ -Dexec.args="--runner=DataflowRunner --project=<your-gcp-project>
WordCount
java示例,但不知何故,我得到了一个错误,ClasspathScanningResourcesDetector
没有找到要暂存的文件。我完全按照网站上的描述运行示例:
mvn compile exec:java -Dexec.mainClass=org.apache.beam.examples.WordCount \
-Dexec.args="--runner=DataflowRunner --project=<your-gcp-project> \
--gcpTempLocation=gs://<your-gcs-bucket>/tmp \
--inputFile=gs://apache-beam-samples/shakespeare/* --output=gs://<your-gcs-bucket>/counts" \
-Pdataflow-runner
我使用的是最新的beam版本
<beam.version>2.19.0</beam.version>
2.19.0
你知道怎么解决这个问题吗
编辑:
这是2.19.0中的一个bug。它在2.18.0中工作
编辑:
我正在Windows上使用Redhat OpenJDK 8
编辑:
此外,标准字数示例中的一些单元测试失败
DebuggingWordCountTest失败,原因是
org.apache.beam.sdk.Pipeline$PipelineExecutionException: java.io.FileNotFoundException: No files matched spec: /Users/<redacted>/AppData/Local/Temp/junit7907687962995108435/junit2682353785908929665.tmp
at org.apache.beam.sdk.Pipeline.run(Pipeline.java:321)
at org.apache.beam.sdk.Pipeline.run(Pipeline.java:301)
org.apache.beam.sdk.Pipeline$PipelineExecutionException:java.io.FileNotFoundException:No文件匹配spec:/Users//AppData/Local/Temp/junit7907687962995108435/junit26835378590892665.tmp
位于org.apache.beam.sdk.Pipeline.run(Pipeline.java:321)
位于org.apache.beam.sdk.Pipeline.run(Pipeline.java:301)
- 当您运行数据流时,它将尝试查找并上载数据流 依赖关系李>
- 我假设您得到的错误是“没有要暂存的文件” “由于某些类路径问题而被发现”李>
- 尝试使用--filesToStage 用于手动向stage提供jar或类的选项
Mar 08, 2020 7:37:41 PM org.apache.beam.runners.dataflow.options.DataflowPipelineOptions$StagingLocationFactory create
INFO: No stagingLocation provided, falling back to gcpTempLocation
Mar 08, 2020 7:37:42 PM org.apache.beam.runners.dataflow.DataflowRunner fromOptions
INFO: PipelineOptions.filesToStage was not specified. Defaulting to files from the classpath: will stage 114 files. Enable logging at DEBUG level to see which files will be staged.
Mar 08, 2020 7:37:43 PM org.apache.beam.runners.dataflow.DataflowRunner run
INFO: Executing pipeline on the Dataflow Service, which will have billing implications related to Google Compute Engine usage and other Google Cloud Services.
Mar 08, 2020 7:37:43 PM org.apache.beam.runners.dataflow.util.PackageUtil stageClasspathElements
INFO: Uploading 114 files from PipelineOptions.filesToStage to staging location to prepare for execution.
Mar 08, 2020 7:37:48 PM org.apache.beam.runners.dataflow.util.PackageUtil stageClasspathElements
INFO: Staging files complete: 114 files cached, 0 files newly uploaded
您可以尝试以下命令来生成所需的源代码,并运行管道来转移依赖项
mvn archetype:generate \
-DarchetypeGroupId=org.apache.beam \
-DarchetypeArtifactId=beam-sdks-java-maven-archetypes-examples \
-DarchetypeVersion=2.8.0 \
-DgroupId=org.example \
-DartifactId=first-dataflow \
-Dversion="0.1" \
-Dpackage=org.apache.beam.examples \
-DinteractiveMode=false
您也可以在Qwiklab中免费试用:
您能确认您用实际值替换了和吗?另外,您能确认运行作业的Java版本吗?是的,我这样做了,但不想在这里显示您在Windows计算机上吗?我的团队中的一些成员遇到了这个问题,我们认为这可能只是Windows上的问题。@Florian,我们也在使用java 8。到目前为止,我所知道的所有案例唯一的共同点就是它们都在Windows上。我申请了。我在Windows10中遇到了同样的问题,降到2.18修复了它。听起来好像2.20的时候有个补丁。(根据BEAM-9471)我实际使用了这个生成命令。我会尽快更新你的答案,只要我能更新,它就不会从类路径中获取已编译的类。我知道“-filesToStage”选项,但我认为它应该自动选择它。也许这是一个bug,我应该打开一个问题?对于beam版本2.19.0和openjdk版本“1.8.0_242”,管道运行时没有任何问题,并且-DarchetypeVersion=2.19.0。
mvn archetype:generate \
-DarchetypeGroupId=org.apache.beam \
-DarchetypeArtifactId=beam-sdks-java-maven-archetypes-examples \
-DarchetypeVersion=2.8.0 \
-DgroupId=org.example \
-DartifactId=first-dataflow \
-Dversion="0.1" \
-Dpackage=org.apache.beam.examples \
-DinteractiveMode=false