【发布时间】:2021-03-23 15:41:42
【问题描述】:
我的生产站点是在 CodeIgniter 框架中开发的,它有超过 10k 的文件,我上周成功部署,没有任何问题。今天我的部署失败了,我只是更正了脚本中的一个查询。
我遇到了以下问题
C:\myproject>gcloud app deploy --version 13 app.yaml
Services to deploy:
descriptor: [C:\myproject\app.yaml]
source: [C:\myproject]
target project: [xyz]
target service: [uat]
target version: [13]
target url: [https://uat-dot-xyz.appspot.com]
Do you want to continue (Y/n)? Y
Beginning deployment of service [uat]...
#============================================================#
#= Uploading 0 files to Google Cloud Storage =#
#============================================================#
File upload done.
ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: This deployment has too many files. New versions are limited to 10000 files for this app.
- '@type': type.googleapis.com/google.rpc.BadRequest
fieldViolations:
- description: This deployment has too many files. New versions are limited to 10000
files for this app.
field: version.deployment.files[...]
我参考了下面的 SO 帖子
gcloud app deploy failed because deployment has too many files for PHP CodeIgnitor files
gcloud app deploy : This deployment has too many files Approaches for overcoming 10000 file limit on Google App Engine?
Communicating between google app engine services
我按照以下启用了 .gcloudignore 文件并在 myproject 中创建
https://cloud.google.com/sdk/gcloud/reference/topic/gcloudignore
How to include files in .gcloudignore that are ignored in .gitignore
C:\>gcloud config set gcloudignore/enabled true
Updated property [gcloudignore/enabled].
C:\>gcloud config list
[accessibility]
screen_reader = False
[compute]
region = region-name
zone = zone-name
[core]
account = xyz@domainname.com
disable_usage_reporting = True
project = xyz
[gcloudignore]
enabled = true
我当前的 Cloud SDK 版本是:320.0.0
从版本安装组件:320.0.0
我找不到解决方案。为什么突然我的部署失败了使用Gcloud SDK到GAE柔性环境(注意:我的项目有超过10k的文件,直到上周我没有遇到这个问题)
请帮我解决这个问题,如果我错过了任何内容, 提前致谢。
【问题讨论】:
-
您可能正在部署安装在本地环境中的应用程序 + 库文件,检查此项并仅部署您的代码文件。如果您无法通过从环境中删除库来解决此问题,您可以尝试请求增加配额或对您的应用进行 docker 化
-
以@Chris32 的评论为基础。您可以使用 app.yaml 中的“skip_files”属性来确保不会部署项目中不需要的文件/目录。 cloud.google.com/appengine/docs/standard/php/config/appref
-
@Chris32 和 Zack,感谢您的友好回复,我会检查并通知您。
-
@Chris32,Zack,我在 app.yaml 中尝试了“skip_files”属性,但是,相同的部署问题超过 10k 个文件。我正在使用这个库github.com/googleapis/google-api-php-client,是否有任何解决方法可以从谷歌应用程序引擎中获取这个库?你能帮我吗?提前致谢。
-
能否在运行此命令后再次尝试部署? gcloud config set app/trigger_build_server_side false
标签: codeigniter google-app-engine google-cloud-platform app-engine-flexible google-cloud-sdk