agentcraft icon indicating copy to clipboard operation
agentcraft copied to clipboard

数据库初始化的时候需要高权限账号

Open wss-git opened this issue 10 months ago • 0 comments

低权限账户,会报412,但是前端的报错却是显示 用户已经注册

Traceback (most recent call last):
  File "/opt/python/sqlalchemy/engine/base.py", line 1965, in _exec_single_context
    self.dialect.do_execute(
  File "/opt/python/sqlalchemy/engine/default.py", line 921, in do_execute
    cursor.execute(statement, parameters)
  File "/opt/python/psycopg/cursor.py", line 737, in execute
    raise ex.with_traceback(None)
psycopg.errors.InsufficientPrivilege: permission denied to create extension "vector"
HINT:  Must be superuser or user with all of rds_superuser to create this extension.

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

Traceback (most recent call last):
  File "/code/app/main.py", line 11, in <module>
    create_tables()
  File "/code/app/db.py", line 339, in create_tables
    session.execute(CREATE_VECTOR_EXTENSION)
  File "/opt/python/sqlalchemy/orm/session.py", line 2246, in execute
    return self._execute_internal(
  File "/opt/python/sqlalchemy/orm/session.py", line 2150, in _execute_internal
    result = conn.execute(
  File "/opt/python/sqlalchemy/engine/base.py", line 1412, in execute
    return meth(
  File "/opt/python/sqlalchemy/sql/elements.py", line 483, in _execute_on_connection
    return connection._execute_clauseelement(
  File "/opt/python/sqlalchemy/engine/base.py", line 1635, in _execute_clauseelement
    ret = self._execute_context(
  File "/opt/python/sqlalchemy/engine/base.py", line 1844, in _execute_context
    return self._exec_single_context(
  File "/opt/python/sqlalchemy/engine/base.py", line 1984, in _exec_single_context
    self._handle_dbapi_exception(
  File "/opt/python/sqlalchemy/engine/base.py", line 2339, in _handle_dbapi_exception
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "/opt/python/sqlalchemy/engine/base.py", line 1965, in _exec_single_context
    self.dialect.do_execute(
  File "/opt/python/sqlalchemy/engine/default.py", line 921, in do_execute
    cursor.execute(statement, parameters)
  File "/opt/python/psycopg/cursor.py", line 737, in execute
    raise ex.with_traceback(None)
sqlalchemy.exc.ProgrammingError: (psycopg.errors.InsufficientPrivilege) permission denied to create extension "vector"
HINT:  Must be superuser or user with all of rds_superuser to create this extension.
[SQL: CREATE EXTENSION IF NOT EXISTS vector]
(Background on this error at: https://sqlalche.me/e/20/f405)

wss-git avatar Mar 20 '25 02:03 wss-git