All Questions
Tagged with google-cloud-run flask
80 questions
2
votes
0
answers
42
views
Support CONNECT flask server
I am trying to build a basic proxy server thats accessible form the internet to forward requests but also log them to firebase database. I deployed my code on Google Cloud Run by creating an instance ...
0
votes
2
answers
180
views
Gunicorn + Flask + GCR(Google cloud RUN) does not work properly on GCP
I have developed an algorithm in python and deployed it on GCP Cloud RUN using docker image. attached alognwith is the dockerfile for the same.
# Command to run the application
CMD ["gunicorn&...
1
vote
2
answers
207
views
Does Cloud Run Actually Stream? It is complaining about Content Length
I am running on Cloud Run and have set up streaming from Flask to Browser. It appears to work well to transmit binary data (in this case it has been pickled and compressed).
def transmit_binary_data(N)...
0
votes
0
answers
33
views
Run server-side task for specific duration
I'm running a Flask app on a Google Cloud Run service. When a user sends a request to route /api/start_task, a block of code starts running, which can take a very long time to run. For several reasons,...
0
votes
0
answers
58
views
Optimization Docker Image
I have a dockerfile for a Cloud Run app, it has certain idiosincracies that add size to the image,like the fact that i have to "RUN pip uninstall -y opencv-python && pip install --no-...
2
votes
2
answers
211
views
How to ACK PubSub push subscription events for long running tasks using Flask?
I am using EventArc to generate events and process them using Cloud Run. It uses Cloud PubSub as transport layer.
Following the solution explained here, my code has the following structure.
from flask ...
0
votes
1
answer
260
views
Launch multiple server apps in localhost with different port numbers within the same container in Cloud Run
I'm creating a webapp with 2 main services: Flask and Chainlit.
When I launch my webapp locally on localhost:8080, on my landing page, when I click on the "chat" button, it redirects me to ...
0
votes
0
answers
37
views
Bigquery API fails to deploy in google Run
I want to deploy a Dash (of Flask) App in Google Cloud Run.
The input data would come from a BigQuery table.
So I use the BigQuery python API.
The App works fine locally and I can deploy it to Cloud ...
0
votes
0
answers
93
views
Cloud Run service blocked from accessing another Cloud Run service in the same VPC by CORS
I have two Cloud Run services:
Service A, a nextJS frontend with Ingress Control set to All and accepting unauthenticated invocations. It's using a service account with the run.invoker permission, ...
0
votes
0
answers
65
views
Google Cloud Run: Python flask api keeps timing out
I am running a Flask app in Cloud Run, as an API service. When Cloud Run is bringing up a new instance to service an API, the Flask App is unable to service the API. From the Cloud Run console logs, ...
0
votes
0
answers
136
views
How to authenticate through openID with a flask web app deployed on google cloud run?
I have a Flask app deployed on google run. The login endpoint makes the user login through google openID authentication.
app = Flask(__name__)
login_manager = LoginManager()
login_manager.init_app(...
1
vote
1
answer
851
views
Flask app cannot run on google cloud run: service unavailable 503 error
I created a web app with Flask that exposes the 8080 port and shows some html pages, and I deployed it with google cloud run.
This is the basic code.
app = Flask(__name__)
@app.before_request
def ...
0
votes
2
answers
371
views
Flask web app deployment in Google Cloud App Engine gives favicon.ico error
I created a simple app to test Google Cloud App Engine deployments.
The app deploys successfully to google cloud but the site just says: "Service Unavailable" and shows the following error: ...
0
votes
1
answer
483
views
Getting ModuleNotFound error when deploying a gunicorn flask app in Cloud Run (works locally or in docker-compose)
I've been struggling with a strange issue. Deploying a gunicorn simple python flask API to Cloud Run consistenly gives me a ModuleNotFound error:
Dockerfile
FROM python:3.10-slim
RUN apt-get update &...
0
votes
0
answers
579
views
How do I deploy a Python Flask App that uses Playwright on Google Cloud Run?
I'm trying to deploy a Python Flask App that uses Playwright on Google Cloud Run with a docker image. I've read from this that you'd need to use the Playwright Python images provided by Microsoft. ...
0
votes
0
answers
47
views
GCP Cloud Run Flask app starting but not publishing data?
I have a Cloud Run service that operates as follows:
Health check connects to "/" endpoint, flask detects this and redirects to "/start".
connection made to "/start", ...
0
votes
1
answer
839
views
How does CloudRun in GCP coverts http 1.1 to http 2 for flask application
We have API's that are written in Flask application and by default flask only supports http 1.1 unless we use some reverse proxy like Nginx. I was experimenting to check if Classic Application Load ...
1
vote
1
answer
119
views
CloudRun flask deployment results in 503 error
I want to deploy a simply Flask app that uses the google bucket. But when I deploy It It results in error 503 - Service Unavailable
Im not sure if I forgot something critical but Im really not sure ...
0
votes
0
answers
175
views
Deploy flask paddleocr to Google Cloud Run error
Anybody have experience deploy a flask paddleocr app to google cloud run?
I encounter Service Unavailable when opening the url. In cloud run console: "ImportError: libssl.so.1.1: cannot open ...
0
votes
1
answer
189
views
CORS policy blocked when using google cloudrun
I have a web app that sends HTTP requests to an API (using Flask) that I hosted on google cloud run (hosted separately). When hosting the API and web app locally, it was working and sending requests ...
0
votes
1
answer
121
views
Running python Flask app with maven-like folder structure on Google Cloud Run
How to configure Google Cloud Run to be able to run (via gcloud run deploy) a python Flask app with the following source code structure?
root
│
├── src
│ └── app
│ └── main.py
│
├── ...
3
votes
1
answer
3k
views
ERROR: (gcloud.run.deploy) Revision 'revision' is not ready and cannot serve traffic. Container failed to start and listen on PORT=80
I'm trying to deploy my flask web application on gcp using cloud run.
It works fine locally but when I try to deploy it using gcloud I get this error:
ERROR: (gcloud.run.deploy) Revision 'my-flask-app-...
0
votes
1
answer
279
views
How to use Google Cloud SQL for a Flask web application without using SQLAlchemy
My app is a Flask web server that has a postgresql backend. Up to now, I have been running setting up the DB on the same compute engine the server is on. I am transitioning my database from the ...
0
votes
0
answers
97
views
Errors when executing queries using engine from sqlalchemy library
In my backend Python (Flask), (that is running on Google Cloud if that info helps) after some time of usage (during which connections to MySQL are used and made using sql alchemy engine) following ...
1
vote
1
answer
896
views
ModuleNotFoundError on Google Cloud Run, not locally
I am deploying a Python Flask application behind gunicorn on Google Cloud run. The container runs fine locally, but I notice when I build and push the service revision I get an error and my gunicorn ...
0
votes
0
answers
2k
views
Error on werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server
I'm trying to run a Flask app into Google Cloud RUn using gunicorn, but i'm getting this error when i try to access the '/' page in Cloud Run (but it's working well in localhost). How can I fix this?
...
0
votes
1
answer
161
views
What might cause environment variables to be missing in my Flask app when deployed on Google Cloud Run?
I deployed a flask app to google cloud run and want to put some API keys into the environment variables (mostly to keep them out of github since I set up continuous deployment from there). However, ...
1
vote
1
answer
387
views
Deploy a Flask App on Cloud Run GCP with python
I am trying to create a Cloud Run that fetches photo URLs from a web service and then uploads them to a GCP bucket.
On my local machine, it works perfectly fine, but during deployment, I encounter ...
0
votes
1
answer
666
views
How to run a Flask sever wrapped in a Class with gunicorn
I am having an issue when running a Flask server with guncicorn where the server code is wrapped in a Class.
Here is my server class:
class WebServer:
def __init__(self):
self.app = Flask(...
-1
votes
1
answer
187
views
Flask redirects POST requests automatically to GET requests but only in the cloud
I've built a Flask API using Flask RESTX. I've run it locally in a container and it's working as expected. My endpoints are expecting POST requests:
class MyAPIEndpoint(Resource):
def post(self):
...
0
votes
1
answer
819
views
Cloud Run: Why does python flask return 400 Bad request? But locally everything is fine
I have a simple flask application. And I need to run it on Cloud Run with enabled option "Manage authorized users with Cloud IAM."
app.py
from flask import Flask
api_app = Flask(__name__)
...
0
votes
1
answer
192
views
Google Cloud Run Second Flask Application - requirements.txt issue
I have a google cloud run flask application named "HelloWorld1" already up and running however i need to create a second flask application. I followed the below steps as per documentation:
1-...
4
votes
0
answers
1k
views
Cloud Run suddenly starts timing out when processing any request
We've been running a backend application on Cloud Run for about a year and a half now, and a month ago it suddenly stopped properly handling all requests at seemingly random times (about every couple ...
0
votes
1
answer
3k
views
Error: denied: Permission "artifactregistry.repositories.downloadArtifacts" denied on resource
I am new in Python. I am deploying Python code to Google Cloud Run and I am getting an error.
Here is the terminal:
Deploying from source. To deploy a container use [--image]. See https://cloud.google....
0
votes
1
answer
388
views
Flask redirect url_for generates Cloud Run service URL instead of domain
Background:
I've built and deployed an app with Google Cloud Firebase. At a high level, I have a Python Flask server running on Cloud Run, and I serve static JS files with Firebase hosting.
Issue:
...
1
vote
0
answers
935
views
Getting Error 400 when sending GET request with json field from one Cloud Run to another
I am trying to send a request from one Cloud Run service to another. Both are running on Flask. My issue is that there is an email field that I need to send as part of the body of both PUT and GET ...
1
vote
1
answer
899
views
How can I ensure a persistent connection to a specific GCP Cloud Run instance?
I've built an app (with flask, flask-login and dash) on GCP Cloud Run. The app allows users to login, look at some fancy dashboards and leave comments on certain pages. It works great performance-wise:...
1
vote
1
answer
729
views
Flask-login not working on Firebase, but working on Cloud Run
I am trying to deploy a site to firebase, with dynamic content being served by Cloud Run via Flask. I am using the flask-login package, and this is working fine locally, when using firebase serve, and ...
1
vote
1
answer
2k
views
Flask / Docker: Error: Could not import 'project.main.python'
I am trying to build and run a flask application using docker on GCP.
My file structure is as follows:
> /project
> static (contains some images)
> templates (contains html files)
>...
0
votes
1
answer
749
views
CORS Error in Flask Backend on GCP Cloud Run and Angular
I am developing a dashboard with frontend in Angular, Backend in MySQL and Flask. I had deployed the database on CloudSQL and Flask backend on GCP Cloud Run.
During production on my local computer, I ...
0
votes
1
answer
858
views
Telegram bot (Flask app on Google Cloud Run) stops responding after instance reloading
I'm trying to make my first Telegram bot on Python. I use the python-telegram-bot, Flask, run it in Google Cloud Run.
Locally on my machine everything works fine, when I deploy it (using Docker) to ...
0
votes
0
answers
480
views
Flask app deployed to GCP Run through bitbucket
I am struggling to get my dockerised flask app to a GCP run instance through bitbucket pipelines.
Here is my bitbucket-pipeline.yml:
image: python:3.9
pipelines:
default:
- parallel:
- ...
0
votes
1
answer
77
views
Twitter callback not working with Cloud Run
I'm trying to create a website to make F1 predictions with flask
We started developing in Heroku, and the twitter API is already configured, you can check
https://demoflaskdance.herokuapp.com/
But now ...
0
votes
1
answer
696
views
Video Upload in Cloud Run Flask Application is Giving No such file or directory
I am having a web application running locally on my laptop. Below is the python code snippet that takes the video from the HTML and uploads it to Cloud Storage:
@app.route('/' , methods=['POST', 'GET']...
1
vote
0
answers
381
views
CloudRun failing to server https flask app
I have a flask python API exposed in a gcloud run instance.
This seems to works fine, but, some errors lead me to think that my https requests are being redirected to http.
So, to test it, I've added ...
0
votes
1
answer
958
views
Google Cloud Run Sudden Traffic Spike Error
I am using cloud run to service requests sent by my Google App Engine asynchronously. It seems to work fine when I send a cluster of 10 or so async requests. When I send a cluster of 50 async requests ...
1
vote
2
answers
1k
views
HTTP 404 Error setting hooking up Google's Cloud Run to Firebase Hosting
I was following this guide https://medium.com/firebase-developers/hosting-flask-servers-on-firebase-from-scratch-c97cfb204579 and I'm stuck on firebase's ./node_modules/.bin/firebase serve command
I ...
0
votes
2
answers
537
views
Problem with @response.call_on_close in Google Cloud Run
I'm trying to write a script that uses @response.call_on_close on Google Cloud Run, to send an inmediate return to the invoker and do some processing after that, so that the invoker doesn't keep ...
0
votes
1
answer
828
views
Simple way to execute tasks defined as a DAG, in python?
I am running a series of tasks which depend one on each other, in a complex manner. I would like to describe these dependencies as a DAG (directed acyclic graph) and execute the graph when needed.
I ...
6
votes
2
answers
1k
views
Cloud Run Flask API container running shutit enters a sleep loop
The issue has appeared recently and the previously healthy container now enters a sleep loop when a shutit session is being created. The issue occurs only on Cloud Run and not locally.
Minimum ...