Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with creating a database at the organization stage #65

Open
vassilevev opened this issue Dec 27, 2023 · 2 comments
Open

problem with creating a database at the organization stage #65

vassilevev opened this issue Dec 27, 2023 · 2 comments

Comments

@vassilevev
Copy link

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

@usUpal
Copy link

usUpal commented Dec 27, 2023

#62 check this

@youyi1314
Copy link

youyi1314 commented Jan 19, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants