我正在使用Google Dataflow Service为ETL运行一些apache-beam脚本。
这些作业最初需要4-5分钟才能完成,但现在它们在一小时后失败并出现以下错误。
工作流程失败。原因:(35af2d4d3e5569e4):数据流似乎卡住了。
看来这份工作并没有真正开始。
我是通过使用python SDK 2.1.0执行的。作为切换SDK时提到的this问题的答案,我尝试使用python SDK 2.0.0执行它但没有运气。
工作ID:2017-09-28_04_28_31-11363700448712622518
更新
在@BenChambers建议检查日志之后,由于工人开始失败,工作似乎没有启动
日志显示以下日志4次(如数据流文档中所述,在声明失败之前尝试了4次捆绑包)
Running setup.py install for dataflow-worker: finished with status 'done'
Successfully installed dataflow-worker-2.1.0
Executing: /usr/local/bin/pip install /var/opt/google/dataflow/workflow.tar.gz
Processing /var/opt/google/dataflow/workflow.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
IOError: [Errno 2] No such file or directory: '/tmp/pip-YAAeGg-build/setup.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-YAAeGg-build/
/usr/local/bin/pip failed with exit status 1
Dataflow base path override: https://dataflow.googleapis.com/
Failed to report setup error to service: could not lease work item to report failure (no work items returned)
答案 0 :(得分:1)
管道卡住的一个常见原因是工人无法启动。在UI中,您应该能够点击&#34; Logs&#34;靠近顶部,然后链接说&#34; Stackdriver&#34;。这会将您带到Stackdriver Logging页面,该页面配置为查看给定作业的worker
日志。如果您将其从worker
更改为worker-startup
,则应显示尝试启动工作人员的日志。如果在启动期间出现问题,他们应该出现在这里。
答案 1 :(得分:0)
当作业提交给数据流服务时,它会向工作人员安装最新版本的apache-beam。目前,最新版本的apache-beam是2.1.0。 apache beam或google cloud python包必须使用名为six
的python包进行内部实现。
正如this回答所示,最新版本的包six
,即1.11.0
不适用于apache-beam 2.1.0
。
我建议你提供一个数据流服务的设置文件,它会提到six
的版本应该是1.10,而不是1.11。您可以通过将install-requires
参数提供给设置文件
install_requires=[
'six==1.10.0',
]
您可以在this link
上阅读有关setuptools的信息您可以阅读有关如何在this link
处为数据流作业提供设置文件的信息<强>更新强>
当您将作业提交到数据流时,数据流服务会将计算引擎作为其工作者旋转,并安装数据流运行所需的所有要求。如果是这样,它安装的所有python包都在数据流服务的手中,它会安装它们的默认配置。这可能会导致诸如您的问题。
解决方法是通过向管道的requirements_file
提供pipeline_options
参数,为数据流作业提供需求文件。这将使数据流服务安装您在工作者的需求文件中提到的python包,并且可以避免由于包的版本控制而引起的问题。
您可以找到有关如何在this link
上向数据流管道提供需求文件的信息