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
Prisma MongoDB Connector findMany query failing (CursorNotFound) #8389
Comments
Same error here. The above error occurs when querying 100+ objects from a collection with 500 objects |
Hmm, I wasn't able to reproduce. Anyone willing to share a sample dataset that I can use in a reproduction? |
Heyo! Here's a dataset that i generated, which threw the error above: The schema is as follows:
|
Thanks for the dataset, I can reproduce this issue with that.
import { PrismaClient } from "@prisma/client";
async function main() {
const prisma = new PrismaClient();
const data = await prisma.dataset.findFirst();
console.log(data);
prisma.$disconnect();
}
main(); datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
previewFeatures = ["mongoDb"]
}
model dataset {
id String @id @default(dbgenerated()) @map("_id") @db.ObjectId
data String
} |
Can confirm the query works normally up to v2.26.0. Only fails in v2.27.0 and v2.28.0 |
Hey.
Prisma version: 2.24.1 |
Also getting this issue with version 2.30.3 and when I downgrade to 2.26 I get this issue instead: #6998 |
Prisma 3.0.2 here. Taking more than 100 records yields this error. |
I have the same issue, |
any update on this? Experiencing the same issue in 3.1.1 |
Still present in the brand new 3.2.0 release. My implementation fails when I start a cursor-based infinite pagination. |
Hate to be that guy whining on Github issues, but the fact that there's be no comment in 3 months from core developers on such major issue is kinda frightening. |
True. But I think is something related explicitly to MongoDB implementation which is a topic relatively new in the Prisma world and still in experimental stage. |
Seems like this is the same error I've been describing here: #9650 I'm not yet closing my issue since I'm not sure it's really a duplicate but wanted to at least mention this here. |
Hey folks, I spent some time investigating this issue today. I'm now waiting for confirmation from the MongoDB folks but it seems that the error comes from the Rust driver itself. I created an issue on their repo that you can find here: mongodb/mongo-rust-driver#482 I'll try to keep you up-to-date with further news once I know more |
In all my tests, |
Hey @redbaron76, yes the reason for that problem is laid out in this issue mongodb/mongo-rust-driver#482 On that note, a fix on the MongoDB Rust driver was just pushed, effectively closing mongodb/mongo-rust-driver#482. I've been told a new version of the driver would be released tomorrow, meaning that this issue might be fixed in time for the next Prisma release. |
Is there already a scheduled date for the next Prisma release? |
I can confirm the bug fix will be included in the next release. @redbaron76 The next release should be today. Thanks for the reports folks 🙏 |
Bug description
Querying a big collection, or getting all documents from a big collection results into a connection error thrown by Prisma.
Error Stack:
Possible related Stack Overflow thread(s):
How to reproduce
findMany()
Expected behavior
Prisma will throw
PrismaClientUnknownRequestError2
Error Stack:
Prisma information
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: