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

Groups web page load fails: Persona has been deleted #1478

Open
ThomaciousD opened this issue May 17, 2024 · 0 comments
Open

Groups web page load fails: Persona has been deleted #1478

ThomaciousD opened this issue May 17, 2024 · 0 comments

Comments

@ThomaciousD
Copy link
Contributor

Hi,

There is an issue when loading the groups page:
image

As seen from the logs, it looks like when a persona was attached to a group of users and that persona gets deleted, the group fails to load from the database:

raise ValueError("Persona has been deleted")

INFO: "GET /manage/admin/user-group HTTP/1.1" 400 Bad Request
File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 294, in app
raw_response = await run_endpoint_function(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 193, in run_endpoint_function
return await run_in_threadpool(dependant.call, **values)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 42, in run_in_threadpool
return await anyio.to_thread.run_sync(func, *args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/anyio/to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 807, in run
result = context.run(func, *args)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/ee/danswer/server/user_group/api.py", line 27, in list_user_groups
return [UserGroup.from_model(user_group) for user_group in user_groups]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/ee/danswer/server/user_group/api.py", line 27, in
return [UserGroup.from_model(user_group) for user_group in user_groups]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/ee/danswer/server/user_group/models.py", line 57, in from_model
personas=[
^
File "/app/ee/danswer/server/user_group/models.py", line 58, in
PersonaSnapshot.from_model(persona)
File "/app/danswer/server/features/persona/models.py", line 54, in from_model
raise ValueError("Persona has been deleted")
ValueError: Persona has been deleted

I don't know if it helps, but on the postgre database the persona are still attached to the groups although they were deleted:

select persona_id from public.persona__user_group where persona_id in (select id from persona where deleted is true);

id

2
3
6
8
11
(5 rows)

A workaround has been found, to "undelete" the persona in the database:

update persona set deleted=false where deleted is true;

Then the Groups web page loads successfully but this is not what we want. We want to be able to delete personas.

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

1 participant