更新:我已经缩小了一点问题,所以我删除了不必要的代码和示例:
更新2:离开cron作业以12小时的间隔运行一段时间后(每次结束都成功,但没有在BQ中写入任何内容)我们震惊地发现,大约一周后,其中一个cron作业成功完成写入BigQuery,以及Stackdriver日志,声明"此请求导致为您的应用程序启动一个新进程(...)",如下所示.以下工作再次停止写作.现在我想知道这是否以某种方式连接到缓存的应用程序状态(有一些过期时间)或凭据到期日期,以某种方式阻止在第一次之后进一步写入BigQuery,但不会导致错误.
问题描述:
我正在尝试在App Engine中设置一个cron作业(标准)来查询并将数据写回BigQuery(数据集与部署的应用程序在同一个项目中)并且cron作业成功执行但只写入BigQuery部署后首次执行,之后它们仍然成功执行但不写入.
我发现的主要区别在于Stackdriver日志,对于正确写入的执行,有额外的调试和信息,对于后续的没有这样的消息:
2018-04-19 04:44:03.933 CEST
Converted retries value: 3 -> Retry(total=3, connect=None, read=None, redirect=None, status=None) (/base/data/home/apps/e~<redacted>/lib/urllib3/util/retry.py:200)
2018-04-19 04:44:04.154 CEST
Making request: POST https://accounts.google.com/o/oauth2/token (/base/data/home/apps/e~<redacted>/lib/google/auth/transport/requests.py:117)
2018-04-19 04:44:04.160 CEST
Starting new HTTPS connection (1): accounts.google.com (/base/data/home/apps/e~<redacted>/lib/urllib3/connectionpool.py:824)
2018-04-19 04:44:04.329 CEST
https://accounts.google.com:443 "POST /o/oauth2/token HTTP/1.1" 200 None (/base/data/home/apps/e~<redacted>/lib/urllib3/connectionpool.py:396)
2018-04-19 04:44:04.339 CEST
Starting new HTTPS connection (1): www.googleapis.com (/base/data/home/apps/e~<redacted>/lib/urllib3/connectionpool.py:824)
2018-04-19 04:44:04.802 CEST
https://www.googleapis.com:443 "POST /bigquery/v2/projects/<redacted>/jobs HTTP/1.1" 200 None (/base/data/home/apps/e~<redacted>/lib/urllib3/connectionpool.py:396)
2018-04-19 04:44:04.813 CEST
This request caused a new process to be started …Run Code Online (Sandbox Code Playgroud)