我有一个常见的Java 11 Spring Boot应用程序,目前已部署到Heroku。
我可以通过本地调用gcloud app deploy将应用程序手动部署到AppEngine
然而,为了让Google Cloud构建自动构建和部署应用程序,我花了大约2个小时的时间。如果找不到python,它就会崩溃,但我完全不知道它为什么要去寻找python。
这是cloubuild.yaml
- name: maven:3.6.3-adoptopenjdk-11
entrypoint: mvn
args: ['--version']
- name: maven:3.6.3-adoptopenjdk-11
entrypoint: mvn
args: ['package']
- name: 'gcr.io/cloud-builders/gcloud'
args: ['app', 'deploy', 'app.yaml']下面是同一根文件夹中的应用程序yaml:
runtime: java11
env: standard
instance_class: F2
automatic_scaling:
max_instances: 1以下是输出的错误部分:
Step #2: descriptor: [/workspace/app.yaml]
Step #2: source: [/workspace]
Step #2: target project: [atomic-parity-282520]
Step #2: target service: [default]
Step #2: target version: [20200711t113051]
Step #2: target url: [https://atomic-parity-282520.ew.r.appspot.com]
Step #2:
Step #2:
Step #2: Do you want to continue (Y/n)?
Step #2: Beginning deployment of service [default]...
Step #2: Created .gcloudignore file. See `gcloud topic gcloudignore` for details.
Step #2: ERROR: gcloud crashed (OSError): [Errno 2] No such file or directory: '/workspace/venv/bin/python3'
Step #2:
Step #2: If you would like to report this issue, please run the following command:
Step #2: gcloud feedback
Step #2:
Step #2: To check gcloud for common problems, please run the following command:
Step #2: gcloud info --run-diagnostics
Finished Step #2
ERROR
ERROR: build step 2 "gcr.io/cloud-builders/gcloud" failed: step exited with non-zero status: 1发布于 2020-07-12 17:25:15
前段时间我们似乎添加了一些用于数据库迁移的python脚本。除了脚本之外,还创建了一个venv文件夹。
看起来AppEngine触发它是为了暗示项目是基于Python的,即使您设置了一个特定的app.yaml通知来使用Java。
删除venv文件夹解决了此问题。
https://stackoverflow.com/questions/62848647
复制相似问题