I am getting this error when executing my code in Python.
Here is my Python - DataBaseHelper.py:
import psycopg2
#class
class DataBaseHelper:
database = "testdata";user = "test";password = "pass123"; host = "mtest.75tyey.us-east-1.rds.amazonaws.com"
#create and return the connection of database
def getConection(self):
self.conn = psycopg2.connect(database=self.database, user = self.user, password = self.password, host = self.host, port = "5432")
return self.conn
Then I am importing this file and using in another python file - MyScript.py:
import sys
import uuid
from DBHelper import DataBaseHelper
from ExecutionLogHelper import ExecutionLogHelper
from GotUtility import GotUtility
class MyScript:
def __init__(self,):
self.con = DataBaseHelper().getConection()
self.logHelper = ExecutionLogHelper()
self.uuid = self.logHelper.Get_TEST_Run_Id()
When I run my code concurrently, it gives me this error:
psycopg2.errors.AdminShutdown: terminating connection due to administrator command
SSL connection has been closed unexpectedly
I am not able to understand why am I getting this error. When I run the Python program again, it works. And I checked the Postgres server is in running, no restart, no signal to shutdown. This keeps on happening every few hours for me.