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

Invalid prisma.block.findFirst(), Invalid `prisma.block.aggregate() - invocation Timed out fetching a new connection from the connection pool. #255

Open
anarkrypto opened this issue Jan 17, 2025 · 2 comments

Comments

@anarkrypto
Copy link

I just reseted my chain data 4 times. Everytime it reaches more than 200K blocks, we have this kind of error when trying to fetch the Protokit module

It can be:

Invalid `prisma.block.findFirst()`  invocation Timed out fetching a new connection from the connection pool.
OR
Invalid `prisma.block.aggregate()` invocation Timed out fetching a new connection from the connection pool.
OR
nInvalid `prisma.state.findMany()`  invocation Timed out fetching a new connection from the connection pool.
OR
No Metadata has been set for block {\"height\":245780} yet

Query:

{"operationName":"StateRaw","query":"query StateRaw($path: String!) {\n  state(path: $path)\n}","variables":{"path":"16065717386198936724837320364046225795689660140832830837246559267598137910778"}}

Response example:

{
    "errors": [
        {
            "message": "\nInvalid `prisma.state.findMany()` invocation:\n\n\nTimed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 9)",
            "path": [
                "state"
            ]
        }
    ],
    "data": {
        "state": null
    }
}

Server Log:

Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 9)
    at si.handleRequestError (/app/node_modules/.pnpm/@[email protected][email protected]/node_modules/@prisma/client/runtime/library.js:125:6817)
    at si.handleAndLogRequestError (/app/node_modules/.pnpm/@[email protected][email protected]/node_modules/@prisma/client/runtime/library.js:125:6151)
    at si.request (/app/node_modules/.pnpm/@[email protected][email protected]/node_modules/@prisma/client/runtime/library.js:125:5859)
    at async l (/app/node_modules/.pnpm/@[email protected][email protected]/node_modules/@prisma/client/runtime/library.js:130:10025)
    at async PrismaTransactionStorage.getPendingUserTransactions (file:///app/node_modules/.pnpm/@[email protected]_tdl2jvgpdktg37cijcy3bniih4/node_modules/@proto-kit/persistance/dist/services/prisma/PrismaTransactionStorage.js:22:21)
    at async PrivateMempool.getTxs (file:///app/node_modules/.pnpm/@[email protected]_@[email protected][email protected]_tsyring_bktuhgt3hqwpzdd6xe2pr644um/node_modules/@proto-kit/sequencer/dist/mempool/private/PrivateMempool.js:41:16)
    at async TimedBlockTrigger.produceUnprovenBlock (file:///app/node_modules/.pnpm/@[email protected]_@[email protected][email protected]_tsyring_bktuhgt3hqwpzdd6xe2pr644um/node_modules/@proto-kit/sequencer/dist/protocol/production/trigger/TimedBlockTrigger.js:69:28)
    at async Timeout._onTimeout (file:///app/node_modules/.pnpm/@[email protected]_@[email protected][email protected]_tsyring_bktuhgt3hqwpzdd6xe2pr644um/node_modules/@proto-kit/sequencer/dist/protocol/production/trigger/TimedBlockTrigger.js:49:21) {
  code: 'P2024',
  clientVersion: '5.7.1',
  meta: { modelName: 'Transaction', connection_limit: 9, timeout: 10 }
}

Image

We can also see a lot of accumulated pending queries. I am ticking with 1 second

Image

System

Ubuntu 22.04.5 LTS
Docker version 27.3.1, build ce12230
Protokit: 0.1.1-develop.1088

I am using the StarteKit

I am running in a VPS 6GB ram, 4 vCPU Cores, SSD but don't see a high resources usage.

I even reseted the OS entirely, it does not help.

@ankur-arch
Copy link

Hi 👋 ,

Would it be possible for you to upgrade to the latest version of Prisma and try to see if the issue persists?

@anarkrypto
Copy link
Author

Hi 👋 ,

Would it be possible for you to upgrade to the latest version of Prisma and try to see if the issue persists?

thanks for the suggestion. I upgraded to 6.2.1 and I'am already testing it. Unfortunately it may take some weeks to see the results since I had to reset the chain AGAIN due to metadata missing, probably caused by the Prisma connections issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants