GCP App Engine Flex PHP72 : New versions are limited to 10000 files for this app. But 11821 are google PHP library !

173 views
Skip to first unread message

Thomas Manson

unread,
Jan 19, 2019, 9:21:16 AM1/19/19
to Google Cloud Developers
Hi,

I'm trying to use the Google App Engine Flex with PHP 7.2 (Beta).

When I'm uploading my project I got the following error  : 

Beginning deployment of service [default]...
╔════════════════════════════════════════════════════════════╗
╠═ Uploading 16900 files to Google Cloud Storage            ═╣
╚════════════════════════════════════════════════════════════╝
File upload done.
ERROR: (gcloud.beta.app.deploy) INVALID_ARGUMENT: This deployment has too many files. New versions are limited to 10000 files for this app.
  fieldViolations:
  - description: This deployment has too many files. New versions are limited to 10000
      files for this app.
    field: version.deployment.files[...]
2019/01/19 14:39:23 Received TERM signal. Waiting up to 0s before terminating.
Updated property [core/project].

While if I look inside a previous version that runs PHP7.1, I can see that most of the files are from Google library, with a count of file already exceeding the limit : 11821 !



root@e7486400bc7d:/app/server/vendor# for i in $(ls -a); do echo -n "$i : "; find $i | wc -l; done 
. : 14922
.. : 15175
autoload.php : 1
bin : 3
composer : 10
container-interop : 21
firebase : 10
fzaninotto : 718
google : 11821
grpc : 20
guzzlehttp : 100
lcobucci : 99
monolog : 205
nesbot : 90
nikic : 50
paragonie : 14
phpmailer : 117
phpseclib : 43
pimple : 64
psr : 49
ralouphie : 11
ramsey : 65
rize : 35
robmorgan : 197
sendgrid : 198
slim : 72
symfony : 908
root@e7486400bc7d:/app/server/vendor#


And most of the files are from 


root@e7486400bc7d:/app/server/vendor/google# for i in $(ls -a); do echo -n "$i : "; find $i | wc -l; done 
. : 11821
.. : 14922
apiclient : 34
apiclient-services : 8801
auth : 93
cloud-core : 152
cloud-pubsub : 84
cloud-storage : 26
gax : 394
grpc-gcp : 29
protobuf : 2207
root@e7486400bc7d:/app/server/vendor/google# 

This guy has a dirty workaround : 


$ cd laravel
$ mv vendor/google/apiclient-services/src/Google/Service/Gmail /tmp
$ mv vendor/google/apiclient-services/src/Google/Service/Gmail.php /tmp
$ rm -rf vendor/google/apiclient-services/src/Google/Service/*
$ mv /tmp/Gmail vendor/google/apiclient-services/src/Google/Service/
$ mv /tmp/Gmail.php vendor/google/apiclient-services/src/Google/Service/

$ ls -FR | grep -v / | grep -v "^$" | wc -l
5832
(previous count was above 10'000)


Do you know if there's a cleaner way to handle that ?

Regards,
Thomas.


Thomas Manson

unread,
Jan 20, 2019, 2:45:21 PM1/20/19
to Google Cloud Developers
I found out while trying to solve this issue, that my project deployment was not good.

my project layout was : 
/                     # project root
gcp-deploy.sh         # my deploy script
server/
server/composer.json  # my dependencies
server/public_html    # my project angular App
server/src/           # my project src
server/vendor/        # third party library (google-api-php-client-services included)

"gcloud app deploy -q"
was run from the project root
app.yaml had document_root : server/public_html
so when the docker image is being built, composer.json was not found at the root of the project (it's in server/composer.json)
So I had to keep the vender folder and the thousands of files.

Now, if run 
gcloud app deploy -q
from the server folder and change the document_root to public_html
the composer install  is done from the docker machine, so I don't have the issue with  the max number of file.
Reply all
Reply to author
Forward
0 new messages