user11020868
user11020868

Reputation: 427

service on gke pod that was running fine for a year suddenly starts failing with db connection error

I have been a running a service on gke for more than a year without any problems, but just yesterday I started seeing "some backend services are in an UNHEALTHY" state on the kubernetes services/ingress dashboard. When I look into the pod I see the error message below. I never had any problem before and haven't changed anything with my configuration. How should I go about fixing this ?

/usr/local/lib/python3.7/site-packages/django/db/backends/base/base.py”, line 217, in ensure_connection self.connect() File “/usr/local/lib/python3.7/site-packages/django/db/backends/base/base.py”, line 195, in connect self.connection = self.get_new_connection(conn_params) File “/usr/local/lib/python3.7/site-packages/django/db/backends/postgresql/base.py”, line 178, in get_new_connection connection = Database.connect(**conn_params) File “/usr/local/lib/python3.7/site-packages/psycopg2/init.py”, line 126, in connect conn = _connect(dsn, connection_factory=connection_factory, **kwasync) psycopg2.OperationalError: could not connect to server: Connection refused

Upvotes: 0

Views: 194

Answers (1)

user11020868
user11020868

Reputation: 427

Ended up connecting to gke cluster pod and running

python manage.py runserver 0.0.0.0:8000

and problem resolved

Upvotes: 1

Related Questions