Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Duplicate key value violates unique constraint error #4668

Closed
ManuGowda opened this issue Jan 9, 2020 · 0 comments
Closed

Duplicate key value violates unique constraint error #4668

ManuGowda opened this issue Jan 9, 2020 · 0 comments
Assignees
Milestone

Comments

@ManuGowda
Copy link
Contributor

Expected behavior

  • The transaction and blocks should be unique

Actual behavior

08:51:47.465Z ERROR lisk-framework: Database monitoring error (module=http_api:database, err.code=23505)
    error: duplicate key value violates unique constraint "trs_pkey"
        at Connection.parseE (/home/lisk/lisk-3.0.0-alpha.1-6b5449dab-7eed397-Linux-x86_64/node_modules/pg/lib/connection.js:554:11)
        at Connection.parseMessage (/home/lisk/lisk-3.0.0-alpha.1-6b5449dab-7eed397-Linux-x86_64/node_modules/pg/lib/connection.js:379:19)
        at Socket.<anonymous> (/home/lisk/lisk-3.0.0-alpha.1-6b5449dab-7eed397-Linux-x86_64/node_modules/pg/lib/connection.js:119:22)
        at Socket.emit (events.js:210:5)
        at Socket.EventEmitter.emit (domain.js:475:20)
        at addChunk (_stream_readable.js:309:12)
        at readableAddChunk (_stream_readable.js:290:11)
        at Socket.Readable.push (_stream_readable.js:224:10)
        at TCP.onStreamRead (internal/stream_base_commons.js:182:23)
08:51:47.465Z DEBUG lisk-framework: error: duplicate key value violates unique constraint "trs_pkey" (module=http_api:database, event=error)
08:51:47.465Z DEBUG lisk-framework: tx(Chain:processBlock): INSERT INTO trs ("id","blockId","type","timestamp","senderPublicKey","senderId","recipientId","amount","fee","signature","signSignature","signatures","asset","transferData") VALUES ('814601505962577633','8219325540227641308',8,114449377,DECODE('5c554d43301786aec29a09b13b485176e81d1532347a351aeafe018c199fd7ca', 'hex'),'11237980039345381032L','15434101281521902796L','10000000000','10000000',DECODE('431ab41fc3b6de25089913a5d89033d9408c1c20486a9be09d3c35c7965fd9eb620473f8269376e2688806101b1d49a217fe2fbec10e196e9d766e220bb57a0f', 'hex'),NULL,'','{"amount":"10000000000","recipientId":"15434101281521902796L"}',null),('3990583211438032221','8219325540227641308',8,114449377,DECODE('5c554d43301786aec29a09b13b485176e81d1532347a351aeafe018c199fd7ca', 'hex'),'11237980039345381032L','17990970658876008489L','10000000000','10000000',DECODE('4ce852e7059f24152d9d10900425048110c7d50a161a7fb6ab2fa841b684ac71d9f87f774f00b1f4472d4354c0f4e92a55022e1fa8cf0e03c661338ff4965101', 'hex'),NULL,'','{"amount":"10000000000","recipientId":"17990970658876008489L"}',null),('17437801466367108287','8219325540227641308',8,114449377,DECODE('5c554d43301786aec29a09b13b485176e81d1532347a351aeafe018c199fd7ca', 'hex'),'11237980039345381032L','9530745724204924118L','10000000000','10000000',DECODE('a9b3944bf64f505e3f1880468bb5642bb3141d47e5604fc2718450bf7c90fdddcb94e866d20b25b063f2e9ebbc4ef12aaeb2a36ef6a478508c4d588169c72d05', 'hex'),NULL,'','{"amount":"10000000000","recipientId":"9530745724204924118L"}',null),('9594368500141566051','8219325540227641308',8,114449377,DECODE('5c554d43301786aec29a09b13b485176e81d1532347a351aeafe018c199fd7ca', 'hex'),'11237980039345381032L','18136279674274511923L','10000000000','10000000',DECODE('a2e2b38f985a82a711de191e62531babe3119aa821b1f599fb38c1b453a46d0c97f818e50ff0d6067b3488038834ea376bcdc1fb41f63f88c599f4b35d382708', 'hex'),NULL,'','{"amount":"10000000000","recipientId":"18136279674274511923L"}',null),('14316736066249191314','8219325540227641308',8,114449377,DECODE('5c554d43301786aec29a09b13b485176e81d1532347a351aeafe018c199fd7ca', 'hex'),'11237980039345381032L','13282687687341784400L','10000000000','10000000',DECODE('33425ff2bfdc66b21c0b77859997d127c34b2484c6157846a03f00df37103d7598d20225958e7c0f830fa0cfd71c3cdd53eb4bf7d6dab18a68a635d4818cf20e', 'hex'),NULL,'','{"amount":"10000000000","recipientId":"13282687687341784400L"}',null),('16874768264956893696','8219325540227641308',8,114449377,DECODE('5c554d43301786aec29a09b13b485176e81d1532347a351aeafe018c199fd7ca', 'hex'),'11237980039345381032L','12685398266786738838L','10000000000','10000000',DECODE('7126bd367fe26e3180f6f057c5fa6cf44669caad63f5bf648b8edd1c1d45908987dbc87a766c55347b4d60e95eff00629d58e0b695483776026d507a42fbae09', 'hex'),NULL,'','{"amount":"10000000000","recipientId":"12685398266786738838L"}',null),('7438348693280358811','8219325540227641308',8,114449377,DECODE('5c554d43301786aec29a09b13b485176e81d1532347a351aeafe018c199fd7ca', 'hex'),'11237980039345381032L','17051941029510150140L','10000000000','10000000',DECODE('bdba55a51f4fa614f3de1ebbc1b639a1290beb0a28b59f52b9ed11b059149420b4764a153e2d9a6c5afa910935f5f961cd033b7b5c84ad02641f4f2bbbaee207', 'hex'),NULL,'','{"amount":"10000000000","recipientId":"17051941029510150140L"}',null),('17881484338437648848','8219325540227641308',8,114449377,DECODE('5c554d43301786aec29a09b13b485176e81d1532347a351aeafe018c199fd7ca', 'hex'),'11237980039345381032L','8656579465107650632L','10000000000','10000000',DECODE('9df5da587e92b756281479fa4a9f2948dfe11a82c62dc004f56b8a39b365900cf8fb7bec96c779fc2c9c8a1f5c14f3209e8a7fea5652615bc4b7994ba6c89705', 'hex'),NULL,'','{"amount":"10000000000","recipientId":"8656579465107650632L"}',null); (module=http_api:database, event=error)

Steps to reproduce

Which version(s) does this affect? (Environment, OS, etc...)

3.0.0-beta.3

@ManuGowda ManuGowda added this to the Next Sprint milestone Jan 9, 2020
shuse2 added a commit that referenced this issue Jan 9, 2020
Fix processor block save ordering - Closes #4668
@shuse2 shuse2 closed this as completed Jan 9, 2020
@shuse2 shuse2 reopened this Jan 21, 2020
shuse2 added a commit that referenced this issue Jan 21, 2020
@shuse2 shuse2 closed this as completed Jan 21, 2020
shuse2 added a commit that referenced this issue Jan 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants