Skip to content

db-sync failed with violation of foreign key constraint "committee_member_committee_id_fkey" #1831

@mkoura

Description

@mkoura

OS
Your OS: Fedora 40

Versions
The db-sync version (eg cardano-db-sync --version): 13.4.0.0
PostgreSQL version: 14.9

Build/Install Method
The method you use to build or install cardano-db-sync: nix

Run method
The method you used to run cardano-db-sync (eg Nix/Docker/systemd/none): shell script

Additional context
Happens in Conway era, tested on node 9.1.0.

Problem Report
After rollback, db-sync failed with violation of foreign key constraint "committee_member_committee_id_fkey":

[34m[db-sync-node:Info:79][0m [2024-08-28 09:07:37.42 UTC] Delaying delete of 1 blocks after Just 1073 while rolling back to (slot 10628, hash 9e3b20e6ba9ee3e6b65fea99f683b01db616df032c3fd2af76a4e242f5754168). Applying blocks until a new block is found. The node is currently at Tip (SlotNo 10642) c84794eecd577678c2df9b9e4b276edaab421a269bbf3c06496ab90772b3df07 (BlockNo 1074)
[34m[db-sync-node:Info:79][0m [2024-08-28 09:07:37.42 UTC] Found in memory ledger snapshot at slot 10628, hash 9e3b20e6ba9ee3e6b65fea99f683b01db616df032c3fd2af76a4e242f5754168
[34m[db-sync-node:Info:79][0m [2024-08-28 09:07:37.42 UTC] Setting ConsistencyLevel to DBAheadOfLedger
[34m[db-sync-node:Info:79][0m [2024-08-28 09:07:37.42 UTC] Received block which is not in the db with HeaderFields {headerFieldSlot = SlotNo 10642, headerFieldBlockNo = BlockNo 1074, headerFieldHash = c84794eecd577678c2df9b9e4b276edaab421a269bbf3c06496ab90772b3df07}. Time to restore consistency.
[34m[db-sync-node:Info:79][0m [2024-08-28 09:07:37.42 UTC] Deleting 1 numbered equal to or greater than BlockNo 1074
[31m[db-sync-node:Error:79][0m [2024-08-28 09:07:37.42 UTC] runDBThread: SqlError {sqlState = "23503", sqlExecStatus = FatalError, sqlErrorMsg = "update or delete on table "committee" violates foreign key constraint "committee_member_committee_id_fkey" on table "committee_member"", sqlErrorDetail = "Key (id)=(2) is still referenced from table "committee_member".", sqlErrorHint = ""}
[31m[db-sync-node:Error:103][0m [2024-08-28 09:07:37.42 UTC] ChainSyncWithBlocksPtcl: AsyncCancelled
[31m[db-sync-node.Subscription:Error:99][0m [2024-08-28 09:07:37.42 UTC] Identity Application Exception: LocalAddress "/home/martink/Source/repos/cardano-node-tests7/run_workdir/state-cluster0/bft1.socket" SubscriberError {seType = SubscriberWorkerCancelled, seMessage = "SubscriptionWorker exiting", seStack = []}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions