Deploy Symfony project to App Engine - ERROR: Too

2019-08-01 05:05发布

First time deploying a Symfony project to Google App Engine, ran gcloud app deploy.

Error:

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[...]

I suspect the problem is my app.yaml file:

runtime: php55
api_version: 1

handlers:
# tell appengine where our static assets live
- url: /public
  static_dir: public

(I think I'm at least missing something to tell it not to upload the vendor stuff eg. ignore).

How should I update my app.ymal file for project to deploy?

PS Project folders shown below:

enter image description here

2条回答
疯言疯语
2楼-- · 2019-08-01 05:26

I don't think there's anything wrong with your app.yaml, it looks good to me.

I think you are most likely hitting the deployment quota [1]:

The number of times the application has been uploaded by a developer. The current quota is 10,000 per day. An application is limited to 10,000 uploaded files per version. Each file is limited to a maximum size of 32 megabytes.

I would try to use different services [2] instead of having only one huge service. Another idea could be save some files in Google Cloud Storage [3] and access them by using Client libraries [4].

查看更多
ゆ 、 Hurt°
3楼-- · 2019-08-01 05:30

Increase the deployment verbosity using the --verbosity option for the gcloud app deploy command and you'll get the list of all the files uploaded. Then use the skip_files option in your app.yaml to specify the ones you want ignored:

Optional. The skip_files element specifies which files in the application directory are not to be uploaded to App Engine. The value is either a regular expression, or a list of regular expressions. Any filename that matches any of the regular expressions is omitted from the list of files to upload when the application is uploaded. Filenames are relative to the project directory.

The skip_files has the following default:

skip_files:
- ^(.*/)?#.*#$
- ^(.*/)?.*~$
- ^(.*/)?.*\.py[co]$
- ^(.*/)?.*/RCS/.*$
- ^(.*/)?\..*$

Note: watch out for overwriting the defaults for this config.

I may be wrong, but your project structure image suggests your app code resides in the src directory. If so I'd suggest moving the app.yaml file inside it - the directory containing the app.yaml file being deployed is considered to be the top dir of the app/service - its entire content will be uploaded to GAE. You may need to adjust some paths after such move - GAE considers all app/service paths relative to this app/service top dir. If you need them, you can selectively symlink some files/directories from the project directory into the src dir, deployment follows symlinks, replacing them with their actual content.

Some related posts:

查看更多
登录 后发表回答