Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gcloud app deploy : This deployment has too many files

I got the below error, when I tried to deploy my GAE app through gcloud.

Updating service [default]...failed.                                                                  
ERROR: (gcloud.app.deploy) Error Response: [400] This deployment has too many files. New versions are limited to 10000 files for this app.

Details: [
  [
    {
      "@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[...]"
        }
      ]
    }
  ]
]

Is there any way to tackle this problem?

like image 653
Avinash Raj Avatar asked Feb 25 '17 03:02

Avinash Raj


2 Answers

If you really have more than the 10000 files quota in the service you're trying to deploy then you might have to reduce the number accordingly.

Other things to try:

  • you might be able to get a quota increase, see Getting error on GAE: Max number of files and blobs is 10000
  • delete whatever files are not actually needed, or just skip them during deployment see skip_files or, for the more recent cloud SDK versions, the .gcloudignore file.
  • if you have a lot of static files consider moving (some of) them to GCS instead, see Approaches for overcoming 10000 file limit on Google App Engine?
  • split the service into multiple smaller services - each with its own 10000 files limit.

Assuming you do not actually hit the files quota then the error usually indicates you have looping/circular referencing symlinks in your app directory. Which could also explain a path like the one you mentioned in a comment to this post: https://stackoverflow.com/a/42425048/4495081. You just have to fix the offending symlink(s). Again, a simple/consistent directory structure could help prevent such issues.

like image 53
Dan Cornilescu Avatar answered Oct 06 '22 09:10

Dan Cornilescu


gcloud app deploy writes a log file, and tells you where that log is early in its output. Examine that log. It'll tell you what's being uploaded.

Two common ways I've seen people get into trouble are

  1. Using virtualenv, but not adding venv (or .venv, if that's the name you picked) to skip_files.
  2. Using git, but forgetting to add .git to skip_files
like image 22
Dave W. Smith Avatar answered Oct 06 '22 08:10

Dave W. Smith