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

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

Closed
mkoura opened this issue Aug 28, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@mkoura
Copy link
Contributor

mkoura commented Aug 28, 2024

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 = []}

@mkoura mkoura added the bug Something isn't working label Aug 28, 2024
@mkoura mkoura mentioned this issue Aug 28, 2024
9 tasks
@kderme kderme closed this as completed Aug 30, 2024
@kderme kderme added this to DBSync Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

2 participants