James Zhang

02/04/2023, 3:27 PM
hey guys, i’m trying to delete some zombie flow runs, but since my Prefect Postgres Pod was rescaled in K8s, there seem to be some sort data corruptions in the database, so when i try to delete the flow runs, i got this kind of error
sqlalchemy.exc.IntegrityError: (sqlalchemy.dialects.postgresql.asyncpg.IntegrityError) <class 'asyncpg.exceptions.ForeignKeyViolationError'>: update or delete on table "flow_run" violates foreign key constraint "fk_artifact__flow_run_id__flow_run" on table "artifact"
DETAIL:  Key (id)=(fb61f0a3-f3a6-4dde-87df-c1bff00011b7) is still referenced from table "artifact".
how can i then delete those zombie flow runs without complete reset of the database?