我有一个名为CC的脚本,它收集数据并将其推入数据仓库。 我为它创建了一个dag
Task_I = BashOperator(
task_id="CC",
run_as_user="koa",
bash_command="sudo /home/koa/CC"
)
我还通过修改/etc/sudoers添加了在不输入密码的情况下运行它的权限
koa ALL = (ALL) NOPASSWD: /home/koa/CC
但是,当任务失败时,日志会说明需要密码
{bash_operator.py:146} INFO - Running command: sudo /home/koa/CC
{bash_operator.py:153} INFO - Output:
{bash_operator.py:157} INFO - sudo: a terminal is required to read
the password; either use the -S option to read from standard input or configure an askpass
helper
{bash_operator.py:159} INFO - Command exited with return code 1
伙计们,如果你们能帮我的话,那就太好了。我对气流还不熟悉,在过去的几个小时里一直在努力解决这个问题
目前没有回答
相关问题 更多 >
编程相关推荐