Repository navigation
Server has closed the connection #7389
|
findMany with "include" issue. generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
model Advertisement {
id String @id @default(cuid()) @db.Char(25)
title String? @db.MediumText
icon String @db.MediumText
created_at DateTime @default(now())
updated_at DateTime @updatedAt
AdvertisementDetail AdvertisementDetail?
}
model AdvertisementDetail {
id String @id @default(cuid()) @db.Char(25)
summary String? @db.MediumText
description String? @db.MediumText
image1 String? @db.MediumText
created_at DateTime @default(now())
updated_at DateTime @updatedAt
advertisement String? @unique @db.Char(25)
Advertisement Advertisement? @relation(fields: [advertisement], references: [id])
}const prisma = new PrismaClient({
log: ["error", "info", "warn", "query"]
});
...
await prisma.advertisement.findMany({
include: {
AdvertisementDetail: true
}
});How can I solve this? |
Replies: 4 comments 12 replies
|
I think this is happening due to lot of items in the relation. Could you try by adding a limit to what is fetched in the relation and then check: await prisma.advertisement.findMany({
include: {
AdvertisementDetail: { take: 10 },
}
}); |
|
I am getting a similar error, in my server it says "Server has closed the connection." but on my Postgres DB logs it says "[107] LOG: could not receive data from client: Connection reset by peer" |
|
I'm seeing exactly the same behaviour as @mavthedev. |
|
Hi there, To keep our discussions organized and focused on the most relevant topics, we’re reviewing and tidying up our backlog. As part of this process, we’re closing discussions that have already been marked as answered but remain open. If this discussion still requires further input or clarification, feel free to reopen it or start a new one with updated details. Your contributions are invaluable to the community, and we’re here to help! For more details about our priorities and vision for the future of Prisma ORM, check out our latest blog post: https://www.prisma.io/blog/prisma-orm-manifesto. Thank you for your understanding and ongoing support of the Prisma community! |
@koreagpa-jayce 👋
I think this is happening due to lot of items in the relation. Could you try by adding a limit to what is fetched in the relation and then check: