简体   繁体   English

Google Cloud Build 找不到 Python venv... 对于 Java Spring 启动项目

[英]Google Cloud Build can't find Python venv… For Java Spring Boot project

I have a usual Java 11 Spring Boot application that is deployed to Heroku at the moment.我有一个常用的 Java 11 Spring 目前部署到 Heroku 的引导应用程序。

I can deploy the app manually to AppEngine via a local call to gcloud app deploy我可以通过本地调用gcloud app deploy将应用手动部署到 AppEngine

However, I'm struggling for about 2 hours to make the Google Cloud Build to build and deploy the application automatically.但是,为了让 Google Cloud Build 自动构建和部署应用程序,我苦苦挣扎了大约 2 个小时。 It crashes not being able to find python, but I have absolutely no idea why does it try to look for the python anyway.它崩溃无法找到 python,但我完全不知道它为什么要尝试寻找 python。

Here is the cloubuild.yaml :这是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']

Here is the app yaml in the same root folder:这是同一根文件夹中的应用程序 yaml:

runtime: java11
env: standard
instance_class: F2
automatic_scaling:
  max_instances: 1

Here is the error part of the output:这是output的错误部分:

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

It appeared that some time ago we've added a few python scripts for db migration.似乎前段时间我们为数据库迁移添加了一些 python 脚本。 In addition to the script, a venv folder was created.除了脚本之外,还创建了一个venv文件夹。

Looks like AppEngine triggers it as a clue that the project is Python-based, even if you set a particular app.yaml telling to use Java.看起来 AppEngine 触发它作为该项目基于 Python 的线索,即使您设置了特定的app.yaml告诉使用 Java。

Deleting the venv folder resolved the issue.删除venv文件夹解决了该问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法使用Spring Boot构建Maven项目 - Can't build Maven project with Spring Boot Google Cloud Debugger 找不到 Spring Boot web 应用部署为 Cloud Run 服务 - Google Cloud Debugger can't find Spring Boot web app deployed as Cloud Run service Java Spring 启动时不连接 Google Cloud Logging,需要项目 ID - Java Spring Boot don't connect with Google Cloud Logging, requires project ID Spring Boot在多模块项目中找不到jsp - Spring boot can't find jsp in multi modules project Spring 启动应用程序在部署到 Google App Engine 时无法连接到 Google Cloud SQL (PostgreSQL) - Spring Boot app can't connect to Google Cloud SQL (PostgreSQL) when deploying to Google App Engine 在 Google Cloud App Engine 上构建 Spring Boot 应用程序的触发器 - Build trigger for Spring Boot application on Google Cloud App Engine Eclipse:我在项目属性中找不到 Java 构建路径 - Eclipse: I can't find Java Build Path in Project Properties 如何为 Spring Boot 项目设置 Google Cloud Compute Engine? - How to setup Google Cloud Compute Engine for Spring Boot project? 将另一个Spring MVC项目添加为依赖项后,Spring Boot无法找到适当的URL映射 - Spring boot can't find the appropriate URL mapping after adding another spring MVC project as a dependency 无法让 Spring 引导应用程序在 Google Cloud Platform Flexible Environment 上工作 - Can't get Spring Boot application to work on Google Cloud Platform Flexible Environment
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM