Giveth / impact-graph

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed donation investigation

aminlatifi opened this issue · comments

This donation is failed to saved on backend
https://optimistic.etherscan.io/tx/0xcae5e65adacf329190d4f59dae39feccf860c1116e8e3b933d58c2b6918116f0
These are the error I found around the donation time.

{
  "name": "giveth-impact-graph",
  "hostname": "1ab5e7226a63",
  "pid": 70,
  "level": 50,
  "msg": "createDonation() error Error: Currency is not valid\n    at throwHttpErrorIfJoiValidatorFails (/usr/src/app/build/src/utils/validators/graphqlQueryValidators.js:24:15)\n    at validateWithJoiSchema (/usr/src/app/build/src/utils/validators/graphqlQueryValidators.js:19:5)\n    at DonationResolver.createDonation (/usr/src/app/build/src/resolvers/donationResolver.js:471:64)\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)",
  "time": "2023-12-27T14:52:27.754Z",
  "v": 0
}
{
  "name": "giveth-impact-graph",
  "hostname": "1ab5e7226a63",
  "pid": 70,
  "level": 50,
  "msg": "updateDonationStatus() error Error: donation not found\n    at DonationResolver.updateDonationStatus (/usr/src/app/build/src/resolvers/donationResolver.js:600:23)\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)",
  "time": "2023-12-27T14:52:24.765Z",
  "v": 0
}

maybe something related to be USDCe ?

We have another similar error today:

{"name":"giveth-impact-graph","hostname":"4c0039aebb80","pid":69,"level":50,"msg":"createDonation() error Error: Currency is not valid\n    at throwHttpErrorIfJoiValidatorFails (/usr/src/app/build/src/utils/validators/graphqlQueryValidators.js:24:15)\n    at validateWithJoiSchema (/usr/src/app/build/src/utils/validators/graphqlQueryValidators.js:19:5)\n    at DonationResolver.createDonation (/usr/src/app/build/src/resolvers/donationResolver.js:471:64)\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)","time":"2023-12-27T12:17:14.343Z","v":0}

The error occurs in the joi schema validators, token / currency validation.
It's not clear what are the input params, we could improve the logs to tell us which field failed and what value. Right now we have no way of knowing.

Logs point to the token regex. That has been the same for 8 months at least if not more.

Tried to do some donations to multiple QF round projects to replicate the issue, but mine were successful.

With the new logs that we add, we reached these

createDonation() error { error: Error: Currency is not valid     at throwHttpErrorIfJoiValidatorFails
(/usr/src/app/build/src/utils/validators/graphqlQueryValidators.js:24:15)
  at validateWithJoiSchema (/usr/src/app/build/src/utils/validators/graphqlQueryValidators.js:19:5)
  at DonationResolver.createDonation (/usr/src/app/build/src/resolvers/donationResolver.js:485:64)
  at processTicksAndRejections (node:internal/process/task_queues:96:5), inputData: {   amount: 80,
    transactionId: '0xf6e7ea74359f3e5b19b463225113527e603ee44e9c392ede138bc67f0755cf07',
    transactionNetworkId: 10, 
    tokenAddress: '0x7f5c764cbc14f9669b88837ca1490cca17c31607',
    anonymous: false,   token: 'USDC.e',   projectId: 2880,
    nonce: 253,   transakId: undefined,   referrerId: null,
    userId: 10 }

so we removed currency validator in create donation webservi temporary in Giveth/giveth-dapps-v2#1222

I made another one, this one I was nasty and added the token in giveth list by pasting the contract, then donated through giveth, its also no displaying the transaction:

https://optimistic.etherscan.io/tx/0x78c9298280e29d35c62cec282c4b9a3f26a5ea2dbef78a46303ed47c73108a32

We had issue in resolving this token value

{"name":"giveth-impact-graph","hostname":"297e35a38b77","pid":68,"level":20,"msg":"Unable to fetch monoswap prices:  Error: Token PEPE not found for chainId 10\n    at getTokenFromList (/usr/src/app/node_modules/@giveth/monoswap/dist/src/token/token.js:25:15)\n    at SdkV3.<anonymous> (/usr/src/app/node_modules/@giveth/monoswap/dist/src/sdk/sdkV3.js:89:61)\n    at Generator.next (<anonymous>)\n    at /usr/src/app/node_modules/@giveth/monoswap/dist/src/sdk/sdkV3.js:31:71\n    at new Promise (<anonymous>)\n    at __awaiter (/usr/src/app/node_modules/@giveth/monoswap/dist/src/sdk/sdkV3.js:27:12)\n    at SdkV3.getTokenPrice (/usr/src/app/node_modules/@giveth/monoswap/dist/src/sdk/sdkV3.js:88:16)\n    at /usr/src/app/node_modules/@giveth/monoswap/dist/index.js:78:56\n    at Generator.next (<anonymous>)\n    at /usr/src/app/node_modules/@giveth/monoswap/dist/index.js:8:71\n    at new Promise (<anonymous>)\n    at __awaiter (/usr/src/app/node_modules/@giveth/monoswap/dist/index.js:4:12)\n    at getTokenPrice (/usr/src/app/node_modules/@giveth/monoswap/dist/index.js:77:12)\n    at /usr/src/app/node_modules/@giveth/monoswap/dist/index.js:66:61\n    at Array.map (<anonymous>)\n    at /usr/src/app/node_modules/@giveth/monoswap/dist/index.js:66:47\n    at new Promise (<anonymous>)\n    at /usr/src/app/node_modules/@giveth/monoswap/dist/index.js:65:16\n    at Generator.next (<anonymous>)\n    at /usr/src/app/node_modules/@giveth/monoswap/dist/index.js:8:71\n    at new Promise (<anonymous>)\n    at __awaiter (/usr/src/app/node_modules/@giveth/monoswap/dist/index.js:4:12)\n    at getTokenPrices (/usr/src/app/node_modules/@giveth/monoswap/dist/index.js:64:12)\n    at getMonoSwapTokenPrices (/usr/src/app/build/src/services/donationService.js:99:65)\n    at MonoswapPriceAdapter.getTokenPrice (/usr/src/app/build/src/adapters/price/MonoswapPriceAdapter.js:24:80)\n    at updateDonationPricesAndValues (/usr/src/app/build/src/services/donationService.js:57:86)\n    at DonationResolver.createDonation (/usr/src/app/build/src/resolvers/donationResolver.js:594:71)\n    at runMicrotasks (<anonymous>)\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)","time":"2023-12-28T15:20:31.179Z","v":0}

0x27538606b0438038d8e33d58d7cf982a0dfbf7163513ddd410853f78c9133d4f

Another one not computing or displaying

Another one that failed computing: https://optimistic.etherscan.io/tx/0x1860352078e5692d4af7cb5abd5b42697e3d069cb4d6819a02a2c8640c1bfad0

@sktbrd This transaction has been verified successfully
image

Another one that failed computing: https://optimistic.etherscan.io/tx/0x1860352078e5692d4af7cb5abd5b42697e3d069cb4d6819a02a2c8640c1bfad0

@sktbrd This transaction has been verified successfully image

@sktbrd What error did you receive during the donation?

Another one that failed computing: https://optimistic.etherscan.io/tx/0x1860352078e5692d4af7cb5abd5b42697e3d069cb4d6819a02a2c8640c1bfad0

@sktbrd This transaction has been verified successfully image

@sktbrd What error did you receive during the donation?

The same Error modal from the others one, that the donation failed computing

Glad to see that that one wen through either way

@CarlosQ96 Please keep track of transaction in this issue and be sure they will be involved in the patch

@aminlatifi @MohammadPCh tagging you as your are working on the FE side tx backup fix. please close this once you have completed. I am hoping we can complete this task max by tomorrow 6th Feb morning ?

Investigation is done. PR will be part of #1311