-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Description
Self Checks
- I have read the Contributing Guide and Language Policy.
- This is only for bug report, if you would like to ask a question, please head to Discussions.
- I have searched for existing issues search for existing issues, including closed ones.
- I confirm that I am using English to submit this report, otherwise it will be closed.
- 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
- Please do not modify this template :) and fill in all the required fields.
Dify version
1.10.0
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Traceback (most recent call last):
File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 917, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 902, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/flask_restx/api.py", line 404, in wrapper
resp = resource(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/flask/views.py", line 110, in view
return current_app.ensure_sync(self.dispatch_request)(**kwargs) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/flask_restx/resource.py", line 41, in dispatch_request
resp = meth(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/app/api/controllers/console/wraps.py", line 220, in decorated
return view(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/app/api/libs/login.py", line 75, in decorated_view
elif current_user is not None and not current_user.is_authenticated:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/werkzeug/local.py", line 318, in get
obj = instance._get_current_object()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/werkzeug/local.py", line 526, in _get_current_object
return get_name(local())
^^^^^^^
File "/app/api/libs/login.py", line 98, in
current_user: Any = LocalProxy(lambda: _get_user())
^^^^^^^^^^^
File "/app/api/libs/login.py", line 88, in _get_user
current_app.login_manager._load_user() # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/flask_login/login_manager.py", line 378, in _load_user
user = self._load_user_from_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/flask_login/login_manager.py", line 441, in _load_user_from_request
user = self._request_callback(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/extensions/ext_login.py", line 62, in load_user_from_request
logged_in_account = AccountService.load_logged_in_account(account_id=user_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/services/account_service.py", line 443, in load_logged_in_account
return AccountService.load_user(account_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/services/account_service.py", line 137, in load_user
account.set_tenant_id(current_tenant.tenant_id)
File "/app/api/models/account.py", line 162, in set_tenant_id
tenant_account_join = session.execute(query).first()
^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 2351, in execute
return self._execute_internal(
^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 2249, in _execute_internal
result: Result[Any] = compile_state_cls.orm_execute_statement(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/orm/context.py", line 306, in orm_execute_statement
result = conn.execute(
^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1419, in execute
return meth(
^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/sql/elements.py", line 526, in _execute_on_connection
return connection._execute_clauseelement(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1641, in _execute_clauseelement
ret = self._execute_context(
^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1846, in _execute_context
return self._exec_single_context(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
self._handle_dbapi_exception(
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 2355, in _handle_dbapi_exception
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
self.dialect.do_execute(
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/engine/default.py", line 951, in do_execute
cursor.execute(statement, parameters)
File "/app/api/.venv/lib/python3.12/site-packages/psycogreen/gevent.py", line 32, in gevent_wait_callback
state = conn.poll()
^^^^^^^^^^^
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) FATAL: terminating connection due to idle-session timeout
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
[SQL: SELECT tenants.id, tenants.name, tenants.encrypt_public_key, tenants.plan, tenants.status, tenants.custom_config, tenants.created_at, tenants.updated_at, tenant_account_joins.id AS id_1, tenant_account_joins.tenant_id, tenant_account_joins.account_id, tenant_account_joins.current, tenant_account_joins.role, tenant_account_joins.invited_by, tenant_account_joins.created_at AS created_at_1, tenant_account_joins.updated_at AS updated_at_1
FROM tenants, tenant_account_joins
WHERE tenants.id = %(id_2)s::UUID AND tenant_account_joins.tenant_id = tenants.id AND tenant_account_joins.account_id = %(account_id_1)s::UUID]
[parameters: {'id_2': 'e48ce911-7f13-4a88-8086-8998638e1f7b', 'account_id_1': 'a77e2d0a-68f2-4e7d-9e53-b36fc7fdaad4'}]
(Background on this error at: https://sqlalche.me/e/20/e3q8)
✔️ Expected Behavior
fixed
❌ Actual Behavior
No response