problem with creating a database at the organization stage
vassilevev opened this issue ยท 2 comments
DEBUG:config:๐ Created organization: Pepe Corp.
๐ Created organization: Pepe Corp.
DEBUG:config:๐๏ธ Created project: Pepetamine
๐๏ธ Created project: Pepetamine
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1969, in _exec_single_context
self.dialect.do_execute(
File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 922, in do_execute
cursor.execute(statement, parameters)
psycopg2.errors.UndefinedFunction: operator does not exist: entity_status = integer
LINE 3: ...splay_name = 'project-pepetamine.md' AND document.status = 2
^
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/app/api/seed.py", line 162, in
create_document_by_file_path(
File "/app/api/helpers.py", line 284, in create_document_by_file_path
document = get_document_by_name(
File "/app/api/helpers.py", line 514, in get_document_by_name
return session.exec(
File "/usr/local/lib/python3.9/site-packages/sqlmodel/orm/session.py", line 68, in exec
results = super().execute(
File "/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/session.py", line 2308, in execute
return self._execute_internal(
File "/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/session.py", line 2190, in _execute_internal
result: Result[Any] = compile_state_cls.orm_execute_statement(
File "/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/context.py", line 293, in orm_execute_statement
result = conn.execute(
File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1416, in execute
return meth(
File "/usr/local/lib/python3.9/site-packages/sqlalchemy/sql/elements.py", line 516, in _execute_on_connection
return connection._execute_clauseelement(
File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1639, in _execute_clauseelement
ret = self._execute_context(
File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1848, in _execute_context
return self._exec_single_context(
File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1988, in _exec_single_context
self._handle_dbapi_exception(
File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 2343, in _handle_dbapi_exception
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1969, in _exec_single_context
self.dialect.do_execute(
File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 922, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedFunction) operator does not exist: entity_status = integer
LINE 3: ...splay_name = 'project-pepetamine.md' AND document.status = 2
^
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.
[SQL: SELECT document.id, document.uuid, document.organization_id, document.project_id, document.display_name, document.url, document.data, document.hash, document.version, document.status, document.created_at, document.updated_at
FROM document
WHERE %(param_1)s = document.project_id AND document.display_name = %(display_name_1)s AND document.status = %(status_1)s]
[parameters: {'param_1': 1, 'display_name_1': 'project-pepetamine.md', 'status_1': 2}]
(Background on this error at: https://sqlalche.me/e/20/f405)
make[1]: *** [Makefile:126: seed] Error 1
make[1]: Leaving directory '/var/www/docker_site/RasaGPT'
make: *** [Makefile:62: install] Error 2
Please, help
check and replace all ENTITY_STATUS.[ACTIVE|DEPRECATED|DELETED].value to non .value
example:
ENTITY_STATUS.ACTIVE.value
to
ENTITY_STATUS.ACTIVE
app/api/models.py
app/api/main.py
app/api/config.py
because app/api/models.py
set status type as enum at line 106 [status: Optional[ENTITY_STATUS] = Field(default=ENTITY_STATUS.ACTIVE)]
not Integer