简体   繁体   English

运行数据流WordCount示例时badRequest API响应

[英]badRequest API response when running dataflow WordCount example

I am trying to get google cloud dataflow to run. 我正在尝试让Google Cloud数据流运行。 I am using a MacBook with MacOS 10.9. 我正在使用MacOS 10.9的MacBook。

I installed the google cloud sdk as well as the dataflow java sdk, following the instuctions of the GitHubPage 我按照GitHubPage的指示安装了Google Cloud SDK和Dataflow Java SDK

In order to get the dataflow sdk to compile with maven successfully, I had to set JAVA_HOME to the JDK 1.7 location. 为了使数据流sdk成功通过maven进行编译,我必须将JAVA_HOME设置为JDK 1.7位置。

In order to run the WordCount example, I had to install JDK 8 and use it as my runtime environment because otherwise I got the error that the "major.minor version is unknown: 51.0". 为了运行WordCount示例,我必须安装JDK 8并将其用作我的运行时环境,因为否则我会收到“ major.minor版本未知:51.0”的错误消息。

Now when I run the WordCount example with mvn (as suggested on the GitHub page ) the programs says it uploads 41 files to staging. 现在,当我使用mvn运行GitHub上的WordCount示例时(该程序在GitHub页面上建议),该程序表示它将上载41个文件到暂存中。 After that, I get an API error: 之后,我得到一个API错误:

{
  "code" : 400,
  "errors" : [ {
    "domain" : "global",
    "message" : "Request contains an invalid argument.",
    "reason" : "badRequest"
  } ],
  "message" : "Request contains an invalid argument.",
  "status" : "INVALID_ARGUMENT"
}

This is the command I run in the terminal: 这是我在终端中运行的命令:

mvn -e exec:java -pl examples   -Dexec.mainClass=com.google.cloud.dataflow.examples.WordCount   -Dexec.args="--project=${PROJECT} --stagingLocation=${STAGING} --runner=BlockingDataflowPipelineRunner --output=${OUTPUT}"

OUTPUT=gs://path/to/outfile.txt OUTPUT = gs://path/to/outfile.txt

STAGING=gs://path/to/staging (folder) STAGING = gs:// path / to / staging(文件夹)

PROJECT=(numeric ID of project) PROJECT =(项目的数字ID)

I believe that the PROJECT id is correct as well as the STAGING folder, as files are uploaded, according to the command line output. 我相信,根据命令行输出,随着文件上传,PROJECT id和STAGING文件夹也是正确的。

The OUTPUT file does not exist yet, but the folder does. OUTPUT文件尚不存在,但文件夹存在。

I fail to see where the problem is, can you point me in the right direction? 我看不出问题出在哪里,您能指出我正确的方向吗?

Thanks! 谢谢!

project should be the alphanumeric project id not the project number. 项目应该是字母数字项目ID,而不是项目编号。

Sorry for the horrible error message. 对不起,错误消息很严重。 A more informative error message should be returned with the 1.0.0 or newer release of the SDK. 1.0.0或更高版本的SDK应该返回更多信息的错误消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM