BradleyB19
BradleyB19

Reputation: 177

Error on 'gcloud app deploy' for large flask project

I'm trying to deploy a flask API onto google app engine. The project is large due to having a 8 neural network models. When trying to deploy, it say there are over 30 000 files to upload to google cloud storage. Deployment runs for 5 hours then crashes with many repeated errors:

MaxRetrialsException: last_result=(None, (<type 'exceptions.IOError'>, IOError(24, 'Too many open files'), <traceback object at 0x120e07830>)), last_retrial=3, time_passed_ms=61927,time_to_wait=0

MaxRetrialsException: last_result=(None, (<class 'httplib2.python2.httplib2.ServerNotFoundError'>, ServerNotFoundError('Unable to find the server at www.googleapis.com',), <traceback object at 0x1171f0bd8>)), last_retrial=3, time_passed_ms=93989,time_to_wait=0

OperationalError: unable to open database file

(3 lines repeated a lot)

Upvotes: 0

Views: 241

Answers (1)

JKleinne
JKleinne

Reputation: 1310

App Engine deployments are limited to 10,000 files per version and as such, deployments where the there is a need to upload over that threshold will fail.

However, there are some workarounds to this issue. For instance, you can split your app into multiple modules (now called services) so as to stagger the number of files uploaded.

Another possible workaround is that in the event where most of your files are static, consider storing it and serving it from Google Cloud Storage or even from Cloud CDN.

Upvotes: 1

Related Questions