Python版GCF函数测试失败:无法获取构建器镜像
Google Cloud Run Python函数Test Function功能构建失败问题
问题详情
日常使用Google Cloud Run开发Python函数,此前页面顶部的Test Function功能(仅支持Python、Node.js)可正常测试,本周初使用无异常,项目权限未变更。当前点击该功能时触发构建错误,所有Python版本均受影响,但Node.js的Test Function功能正常。函数可正常部署,仅测试功能异常,已提交Google问题工单。
错误日志
[5:37:05 PM] - Error: Command failed: cd /gcf-working-dir/function-sources && pack build gcf-ui-function --builder gcr.io/gae-runtimes/buildpacks/google-gae-22/python/builder --pull-policy if-not-present --env GOOGLE_FUNCTION_TARGET=hello_http --env GOOGLE_FUNCTION_SIGNATURE_TYPE=cloudevent --env GOOGLE_DEVMODE=1 --env GOOGLE_RUNTIME_VERSION=3.12 ERROR: failed to build: failed to fetch builder image 'gcr.io/gae-runtimes/buildpacks/google-gae-22/python/builder:latest': image 'gcr.io/gae-runtimes/buildpacks/google-gae-22/python/builder:latest' does not exist on the daemon: not found at checkExecSyncError (node:child_process:826:11) at execSync (node:child_process:900:15) at buildFunction (/app/app.runfiles/google3/cloud/console/web/functions/external/testing_server/workers/build_function_worker.js:17:38) at Object.<anonymous> (/app/app.runfiles/google3/cloud/console/web/functions/external/testing_server/workers/build_function_worker.js:35:131) at Module._compile (node:internal/modules/cjs/loader:1095:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1124:10) at Module.load (node:internal/modules/cjs/loader:975:32) at Function.Module._load (node:internal/modules/cjs/loader:816:12) at Function.executeUserEntryPoint [as runMain] (node:internal/main/worker_thread:79:12) at MessagePort.<anonymous> (node:internal/main/worker_thread:183:24) ERROR: failed to build: failed to fetch builder image 'gcr.io/gae-runtimes/buildpacks/google-gae-22/python/builder:latest': image 'gcr.io/gae-runtimes/buildpacks/google-gae-22/python/builder:latest' does not exist on the daemon: not found
原因分析与临时解决方案
- 核心原因:Test Function功能调用的
gcr.io/gae-runtimes/buildpacks/google-gae-22/python/builder:latest构建镜像不存在,推测是Google侧Python构建镜像服务变更(上周1.8版本已停用)导致。 - 临时替代方案:
- 本地完成函数测试后直接部署,利用Cloud Run部署后的服务端点进行验证。
- 使用
gcloud命令行工具触发函数测试,示例命令:gcloud run services invoke 你的服务名称 --region 你的区域 --data '{"key": "value"}' - 等待Google官方修复对应问题工单。
内容的提问来源于stack exchange,提问作者Alex Mindock
相关产品推荐
相关产品推荐

