Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

File "/layers/google.python.pip/pip/lib/python3.11/site-packages/flask/app.py", line 2190, in wsgi_a

I am getting the following error when deploying a Python Flask App to Google Cloud.

File "/layers/google.python.pip/pip/lib/python3.11/site-packages/flask/app.py", line 2190, in wsgi_app response = self.full_dispatch_request()
 
 
Has anyone else experienced this?
0 3 2,552
3 REPLIES 3

Hello @azenk,

Welcome to Google Cloud Community!

I've managed to deploy some samples using Python Flask through localhost. Both worked on my end and no issues were encountered.

You may want to check the following to make sure that your project will deploy successfully:

For Cloud Run:

  1. Make sure to set the default project for your Cloud Run/Cloud Function.
  2. Make sure that requirements.txt is installed and all its dependencies needed are declared inside.
  3. Add a .dockerignore file if needed if you need to exclude files.
  4. Make sure to select your preferred region.

For Cloud Functions:

  1. Make sure to set the default project for your Cloud Run/Cloud Function.
  2. Make sure that requirements.txt is installed and all its dependencies needed are declared inside.
  3. Add a .dockerignore file if needed if you need to exclude files.
  4. Make sure to select your preferred region.
  5. Make sure to indicate if gen1 or gen2
  6. Set your preferred runtime, e.g., python311

I would highly suggest to check on the following documentation for your references:

Hope this helps.

hi @azenk , did you figure how to solve that error?

I'm getting that error in of my apps and I don't even know the request(s) causing it.

Thanks.

Never mind, I already solved it.

Top Solution Authors