Skip to content
This repository has been archived by the owner on May 28, 2021. It is now read-only.

[node] Withdrawal onchain tx query failing #1343

Open
LayneHaber opened this issue Jul 27, 2020 · 1 comment
Open

[node] Withdrawal onchain tx query failing #1343

LayneHaber opened this issue Jul 27, 2020 · 1 comment
Labels
Bug Something isn't working More Info Needed We need more info from the issue submitter

Comments

@LayneHaber
Copy link
Contributor

Describe the bug
Withdrawing on goerli succeeded, but had the following db error:

2020-07-27T20:00:54.203Z [WithdrawService] Withdrawal tx sent! Hash: 0x9f326203b8bb3b84f46db6fd3937aeb91c06363fb924d30a2157b1c0c0077eb5
query failed: UPDATE "withdraw" SET "onchainTransactionId" = $2, "updatedAt" = CURRENT_TIMESTAMP WHERE "id" IN ($1) RETURNING "updatedAt" -- PARAMETERS: [43,36]
error: error: duplicate key value violates unique constraint "REL_fe366fd9823feea6af8ad15717"
    at Parser.parseErrorMessage (/root/node_modules/pg-protocol/dist/parser.js:278:15)
    at Parser.handlePacket (/root/node_modules/pg-protocol/dist/parser.js:126:29)
    at Parser.parse (/root/node_modules/pg-protocol/dist/parser.js:39:38)
    at Socket.<anonymous> (/root/node_modules/pg-protocol/dist/index.js:8:42)
    at Socket.emit (events.js:210:5)
    at addChunk (_stream_readable.js:308:12)
    at readableAddChunk (_stream_readable.js:289:11)
    at Socket.Readable.push (_stream_readable.js:223:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:182:23) {
  length: 244,
  name: 'error',
  severity: 'ERROR',
  code: '23505',
  detail: 'Key ("onchainTransactionId")=(36) already exists.',
  hint: undefined,
  position: undefined,
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: 'public',
  table: 'withdraw',
  column: undefined,
  dataType: undefined,
  constraint: 'REL_fe366fd9823feea6af8ad15717',
  file: 'nbtinsert.c',
  line: '563',
  routine: '_bt_check_unique'
}

This relation comes from the following:

await queryRunner.query(
      `CREATE TABLE "withdraw" ("id" SERIAL NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), "amount" text NOT NULL, "assetId" text NOT NULL, "recipient" text NOT NULL, "appInstanceId" text NOT NULL, "data" text NOT NULL, "withdrawerSignature" text NOT NULL, "counterpartySignature" text, "finalized" text NOT NULL, "channelId" integer, "onchainTransactionId" integer, CONSTRAINT "REL_fe366fd9823feea6af8ad15717" UNIQUE ("onchainTransactionId"), CONSTRAINT "PK_5c172f81689173f75bf5906ef22" PRIMARY KEY ("id"))`,
      undefined,
    );
@LayneHaber LayneHaber added the Needs Triage Needs to be looked at and prioritized. label Jul 27, 2020
@ArjunBhuptani ArjunBhuptani added Bug Something isn't working More Info Needed We need more info from the issue submitter and removed Needs Triage Needs to be looked at and prioritized. labels Aug 3, 2020
@ArjunBhuptani
Copy link
Member

Did we fix this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working More Info Needed We need more info from the issue submitter
Projects
None yet
Development

No branches or pull requests

2 participants