viperadnan-git / google-drive-telegram-bot

A Google Drive Telegram Bot for managing, cloning files, uploading files on Google Drive
GNU General Public License v3.0
625 stars 1.59k forks source link

ERROR - (psycopg2.errors.AdminShutdown) terminating connection due to administrator command #85

Closed X-Gorn closed 3 years ago

X-Gorn commented 3 years ago

This error suddenly showing when i am trying to upload a file from telegram to gdrive

SSL connection has been closed unexpectedly

[SQL: SELECT "gDrive".chat_id AS "gDrive_chat_id", "gDrive".credential_string AS "gDrive_credential_string" 
FROM "gDrive" 
WHERE "gDrive".chat_id = %(param_1)s]
[parameters: {'param_1': 1691938668}]
(Background on this error at: http://sqlalche.me/e/13/e3q8)
Traceback (most recent call last):
  File "/app/.heroku/python/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
    self.dialect.do_execute(
  File "/app/.heroku/python/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
    cursor.execute(statement, parameters)
psycopg2.errors.AdminShutdown: terminating connection due to administrator command
SSL connection has been closed unexpectedly

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/.heroku/python/lib/python3.9/site-packages/pyrogram/dispatcher.py", line 194, in handler_worker
    if await handler.check(self.client, parsed_update):
  File "/app/.heroku/python/lib/python3.9/site-packages/pyrogram/handlers/handler.py", line 35, in check
    return await self.filters(client, update)
  File "/app/.heroku/python/lib/python3.9/site-packages/pyrogram/filters.py", line 78, in __call__
    y = await self.other(client, update)
  File "/app/.heroku/python/lib/python3.9/site-packages/pyrogram/filters.py", line 49, in __call__
    x = await client.loop.run_in_executor(
  File "/app/.heroku/python/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/app/bot/helpers/utils.py", line 7, in <lambda>
    auth_users = filters.create(lambda _, __, message: bool(gDriveDB.search(message.from_user.id)))
  File "/app/bot/helpers/sql_helper/gDriveDB.py", line 35, in search
    saved_cred = SESSION.query(gDriveCreds).get(chat_id)
  File "/app/.heroku/python/lib/python3.9/site-packages/sqlalchemy/orm/query.py", line 1018, in get
    return self._get_impl(ident, loading.load_on_pk_identity)
  File "/app/.heroku/python/lib/python3.9/site-packages/sqlalchemy/orm/query.py", line 1135, in _get_impl
    return db_load_fn(self, primary_key_identity)
  File "/app/.heroku/python/lib/python3.9/site-packages/sqlalchemy/orm/loading.py", line 286, in load_on_pk_identity
    return q.one()
  File "/app/.heroku/python/lib/python3.9/site-packages/sqlalchemy/orm/query.py", line 3490, in one
    ret = self.one_or_none()
  File "/app/.heroku/python/lib/python3.9/site-packages/sqlalchemy/orm/query.py", line 3459, in one_or_none
    ret = list(self)
  File "/app/.heroku/python/lib/python3.9/site-packages/sqlalchemy/orm/query.py", line 3535, in __iter__
    return self._execute_and_instances(context)
  File "/app/.heroku/python/lib/python3.9/site-packages/sqlalchemy/orm/query.py", line 3560, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/app/.heroku/python/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
    return meth(self, multiparams, params)
  File "/app/.heroku/python/lib/python3.9/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/app/.heroku/python/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1124, in _execute_clauseelement
    ret = self._execute_context(
  File "/app/.heroku/python/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1316, in _execute_context
    self._handle_dbapi_exception(
  File "/app/.heroku/python/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1510, in _handle_dbapi_exception
    util.raise_(
  File "/app/.heroku/python/lib/python3.9/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
    raise exception
  File "/app/.heroku/python/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
    self.dialect.do_execute(
  File "/app/.heroku/python/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
    cursor.execute(statement, parameters)