【发布时间】:2020-04-19 11:08:45
【问题描述】:
当文件到达基于云composer documentation 的 GCS 存储桶时,我一直在尝试在 Cloud Composer (composer-1.8.1-airflow-1.10.3) 中执行 DAG Python 中的云函数
我一直没能让它工作,每次触发,函数都会返回这个消息到日志中
Exception: Bad response from application: 400 / {'Date': 'Mon, 30 Dec 2019 18:07:02 GMT', 'Content-Type': 'text/html', 'Content-Length': '192', 'Server': 'gunicorn/19.9.0', 'Via': '1.1 google', 'Alt-Svc': 'quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000'} / '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>400 Bad Request</title>\n<h1>Bad Request</h1>\n<p>The browser (or proxy) sent a request that this server could not understand.</p>\n'
生成的请求 URL 和打开的 id 令牌似乎是正确的 在代码的最后部分引发了错误
resp = requests.request(
method, url,
headers={'Authorization': 'Bearer {}'.format(
google_open_id_connect_token)}, **kwargs)
if resp.status_code == 403:
raise Exception('Service account {} does not have permission to '
'access the IAP-protected application.'.format(
signer_email))
elif resp.status_code != 200:
raise Exception(
'Bad response from application: {!r} / {!r} / {!r}'.format(
resp.status_code, resp.headers, resp.text))
谢谢
【问题讨论】:
标签: python google-cloud-platform google-cloud-functions google-cloud-storage google-cloud-composer