impact-graph icon indicating copy to clipboard operation
impact-graph copied to clipboard

P0 - Error in DB Schema - Duplicate key value violates

Open mhmdksh opened this issue 7 months ago • 0 comments

We are getting a lot of errors regarding the DB schema, sometimes our backend is failing and lagging. This is something that might be related.

Error Message:

error: error: duplicate key value violates unique constraint "UQ_c9db9fd133378af80c3521bb146" |  
  |   | query failed: INSERT INTO "public"."donation"("transactionId", "nonce", "transactionNetworkId", "safeTransactionId", "chainType", "isProjectVerified", "status", "isExternal", "blockNumber", "origin", "verifyErrorMessage", "speedup", "isCustomToken", "isFiat", "toWalletAddress", "fromWalletAddress", "tokenAddress", "currency", "anonymous", "amount", "valueEth", "valueUsd", "priceEth", "priceUsd", "givbackFactor", "powerRound", "projectRank", "bottomRankInRound", "projectId", "qfRoundId", "distributedFundQfRoundId", "userId", "recurringDonationId", "contactEmail", "qfRoundUserScore", "createdAt", "importDate", "donationType", "onramperTransactionStatus", "onramperId", "referrerWallet", "referralStartTimestamp", "isReferrerGivbackEligible", "transakStatus", "transakTransactionLink", "segmentNotified", "isTokenEligibleForGivback", "virtualPeriodStart", "virtualPeriodEnd") VALUES ($1, $2, $3, $4, $5, $6, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, $7, $8, $9, $10, $11, $12, $13, $14, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, $15, DEFAULT, DEFAULT, $16, DEFAULT, DEFAULT, DEFAULT, $17, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, $18, $19, DEFAULT, DEFAULT) RETURNING "id", "chainType", "isProjectVerified", "status", "isExternal", "speedup", "isCustomToken", "isFiat", "isReferrerGivbackEligible", "segmentNotified", "isTokenEligibleForGivback" -- PARAMETERS: ["0xb5dc375f13a2be9e99b2c1f2647b7c1cf35f28b0f5c9cb5c5adaf00f25c98c15",15,100,"","EVM",false,false,false,"0x8f951903c9360345b4e1b536c7f5ae8f88a64e79","0xd268c1afc282bac47feabd6e3cc7cedff4a217fe","0x4f4f9b8d5b4d0dc10506e5551b0513b61fd59e75","GIV",0,0.00005,1,729,"2024-06-29T08:20:06.515Z",0,1]

<br class="Apple-interchange-newline">

@jainkrati I have put this as a P0 since I didn't find any other errors that cause our backend to fail. Feel free to change it if it isn't important

mhmdksh avatar Jul 01 '24 07:07 mhmdksh