psycopg2.DatabaseError:状态为PGRES_TUPLES_OK的错误,Flask芹菜应用程序中没有来自libpq错误的消息

2024-10-05 14:29:55 发布

您现在位置:Python中文网/ 问答频道 /正文

在随机出现的情况下,我注意到使用SQLAlchemy的Flask芹菜应用程序中存在这样的错误

当我检查数据库连接时,一切正常。应用程序似乎不知何故失去了与PostgreSQL数据库服务器的连接

    [2021-02-08 00:01:00,124: ERROR/ForkPoolWorker-1] Task gbms.celery_service.create_recurring_tasks[04c258ab-9162-44ed-86ff-f90c4a214fd2] raised unexpected: DatabaseError('(psycopg2.DatabaseError) error with status PGRES_TUPLES_OK and no message from the libpq')
Traceback (most recent call last):
  File "/gbmsenv/lib64/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
    self.dialect.do_execute(
  File "/gbmsenv/lib64/python3.8/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
    cursor.execute(statement, parameters)
psycopg2.DatabaseError: error with status PGRES_TUPLES_OK and no message from the libpq

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

我应该采取什么步骤来确定原因并解决问题


Tags: andthenofrom数据库应用程序messageexecute