Bryan Z
09/16/2022, 6:36 PMprisma.tagRank.create()
invocation:`when running my app in a docker container but the error doesn't appear when running in local dev and build modes.
Is there a way to get a more detailed log of which part of the .create() invocation is invalid? (ie. is it a syntax problem, arguments the wrong type etc) Thanks.Raphael Etim
09/16/2022, 6:48 PMDEBUG
environment variable as described hereBryan Z
09/16/2022, 7:02 PMBryan Z
09/16/2022, 7:29 PM2022-09-16T19:13:49.125Z prisma:client Generated request: 2022-09-16T19:13:49.125Z prisma:client mutation { createOneTagRank(data: { name: "writing" count: 1 tagRankListId: "2082572d-df1d-4c6a-9e41-61ac68efbdb7" }) { id name count tagRankListId } }
The schema:
model TagRank {
id String @id @default(uuid())
name String
count Int
TagRankList _TagRankList_ @relation(fields: [tagRankListId], references: [id])
tagRankListId String
@@index(tagRankListId)
}
I'm still getting the ``Invalid prisma.tagRank.create()
invocation` even though the item is saved to the databaseBryan Z
09/16/2022, 7:40 PM2022-09-16T19:13:59.596Z prisma:client:request_handler PrismaClientKnownRequestError: 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: 13) at prismaGraphQLToJSError (/app/node_modules/@prisma/client/runtime/index.js:20426:12) at LibraryEngine.buildQueryError (/app/node_modules/@prisma/client/runtime/index.js:26363:12) at LibraryEngine.request (/app/node_modules/@prisma/client/runtime/index.js:26297:22) at async RequestHandler.request (/app/node_modules/@prisma/client/runtime/index.js:29873:24) at async PrismaClient._request (/app/node_modules/@prisma/client/runtime/index.js:30864:16) at async eval (webpack-internal:///(api)/./db-commands/rank-tags.ts:58:17) { code: 'P2024', clientVersion: '4.3.1', meta: { connection_limit: 13, timeout: 10 } }
Which is then followed by the invalid created() invocation. Sorry for the long logs!Raphael Etim
09/16/2022, 7:53 PMBryan Z
09/16/2022, 7:56 PMRaphael Etim
09/16/2022, 8:01 PMBryan Z
09/16/2022, 8:35 PMquery {
fetchTagsRanked {
name
count
}
}
```
and the part that calls it:
const tagRankList = await prisma.tagRankList.create({
data: {
type,
start,
end,
},
})
const data: any = await RankTagQuery()
console.log('data', data.fetchTagsRanked)
data.fetchTagsRanked.forEach(async (tag: TagRank) => {
if (typeof tag.name !== 'undefined') {
await prisma.tagRank.create({
data: {
name: tag.name,
count: tag.count,
tagRankListId: tagRankList.id,
},
})
I am saving 300-600 items to a PostGres DB (Supabase) around the same time using the forEach loop so not sure if that might be overloading the connection poolJarupong
09/17/2022, 12:26 AMBryan Z
09/17/2022, 1:07 AMRaphael Etim
09/19/2022, 7:28 AMBryan Z
09/19/2022, 6:29 PMRaphael Etim
09/19/2022, 6:31 PM