Our Personal Data Server from scratch! tranquil.farm
pds rust database fun oauth atproto

Failed to delete account: invite is still referenced from table "invite_code_uses". #673

Open corviform.gay
Open opened by corviform.gay

When attempting to delete an account using the admin panel, the action falis (without any UI changes). The following is logged to the console:

mun #7 22 15:31:00 tranquil postgres[433]: [433] ERROR:  update or delete on table "invite_codes" violates foreign key constraint "invite_code_uses_code_fkey" on table "invite_code_uses"
mun #7 22 15:31:00 tranquil postgres[433]: [433] DETAIL:  Key (code)=(social-corviform-gay-txo24-2zzke) is still referenced from table "invite_code_uses".
mun #7 22 15:31:00 tranquil postgres[433]: [433] STATEMENT:  DELETE FROM invite_codes WHERE created_by_user = $1
mun #7 22 15:31:00 tranquil postgres[433]: [433] ERROR:  current transaction is aborted, commands ignored until end of transaction block
mun #7 22 15:31:00 tranquil postgres[433]: [433] STATEMENT:  DELETE FROM user_keys WHERE user_id = $1
mun #7 22 15:31:00 tranquil tranquil-server[317]: 2026-07-22T19:31:00.543077Z ERROR tranquil_pds::api::error: DB error deleting account: Query("current transaction is aborted, commands ignored until end of transaction block")

The referenced invite code is present, and was used to register another account on the instance.

Sign up or Sign in to add to the discussion.