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

500 response on deleting a project's default dashboard #561

Open
mshriver opened this issue Feb 12, 2025 · 0 comments
Open

500 response on deleting a project's default dashboard #561

mshriver opened this issue Feb 12, 2025 · 0 comments
Assignees

Comments

@mshriver
Copy link
Contributor

When a user attempts to delete a dashboard that is a project default, a 500 occurs on the backend.

192.168.86.60 - - [12/Feb/2025 12:24:46] "DELETE /api/dashboard/2656b519-07d2-4f5f-8fc8-0904b97a1d5b HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/mnt/.backend_env/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
    self.dialect.do_execute(
  File "/mnt/.backend_env/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
    cursor.execute(statement, parameters)
psycopg2.errors.ForeignKeyViolation: update or delete on table "dashboards" violates foreign key constraint "projects_default_dashboard_id_fkey" on table "projects"
DETAIL:  Key (id)=(2656b519-07d2-4f5f-8fc8-0904b97a1d5b) is still referenced from table "projects".

The delete function in the backend needs to account for project's default dashboard selection, and clear that first before deleting the record.

After removing the default dashboard configuration for the project, the dashboard can be deleted successfully.

@mshriver mshriver self-assigned this Feb 12, 2025
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