airflow - iam.gserviceaccount.com 没有 storage.buckets.get 访问权限
问题描述
我正在尝试使用气流 DAG 任务将文件存储到 GCS 中。我在气流连接页面的“keyfile json”字段中指定了我的服务帐户信息。但是,当 dag 运行时,即使 GCP 服务帐户具有“存储对象管理员”角色,我也会收到权限错误:
错误 - 403 获取https://www.googleapis.com/storage/v1/b/weather_api?projection=noAcl:airflow@xstack-developers-237307.iam.gserviceaccount.com 没有 storage.buckets.get 访问 weather_api。回溯(最后一次调用):文件“/Users/bilguun/env/lib/python3.7/site-packages/airflow/models/taskinstance.py”,第 922 行,在 _run_raw_task 结果 = task_copy.execute(context=context ) 文件“/Users/bilguun/env/lib/python3.7/site-packages/airflow/operators/python_operator.py”,第 113 行,在执行 return_value = self.execute_callable() 文件“/Users/bilguun/env/ lib/python3.7/site-packages/airflow/operators/python_operator.py”,第 118 行,在 execute_callable 中返回 self.python_callable(*self.op_args, **self.op_kwargs) 文件“/Users/bilguun/airflow/dags /dag_1.py",第 44 行,在 forecast_to_gcs 模式 = json.loads(gcs_hook.download(gcs_bucket, '
我多次检查了我的服务帐户的角色,它说:“存储对象管理员”
以前有人遇到过这个问题吗?
解决方案
推荐阅读
- python - 如何根据数据框标准制作脚本选择链接
- windows - 如何搜索/删除多个子文件夹?
- ruby-on-rails - Kubernetes:Rails 凭证还是 ConfigMap / Secret 方式?
- python - 将列添加到使用 groupby 计算不同列计数的 df
- airflow - 如何在运行类似的依赖子任务集的气流中设置并行任务
- unity3d - 如何将对撞机添加到线渲染器?
- google-assistant - Google Assistant Smart Home 测试套件问题
- ios - 如何将可变数量的纹理绑定到金属着色器?
- css - font-face local 在 Firefox 和 ie 中工作,而不是在 chrome 和 edge 中工作
- react-native - 网络请求失败错误 React Native,使用 Flask Python 作为后端