-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
npm:mongodb fails on v1.35.1 #19831
Comments
Today I tried with v1.35.1 again, without restarting my server (not even restart Mongodb), it worked normally, so I think it was some kind of memory issue. Edit: just after I put the comment, the issue occurred again. |
@osddeitf thanks for the report. Is there any reproduction code you'd be able to provide to help debug the problem? |
For now, I don't think I have any useful reproduction code. I wrote my website in Fresh, and I served some static resources for my web at a route. The route only reads binary data from mongodb with I guess it happens at TLS layer ( v1.35.2 has been released, so I will try with it. |
I also experience this error intermittently and cannot share a reproduction because it only happens intermittently but here is my stack trace:
EDIT:
|
I am also seeing this issue when upgrading Deno The issue only arose for me when there were concurrent operations being sent to the Node Mongo Driver ie. The error produced by the Node Mongo Driver is always either Looking at the release for Deno Here's a minimal reproduction (it uses the sample dataset provided by MongoDB Atlas, but you can change it to whatever): import { MongoClient } from 'npm:mongodb@5.7.0'
const url = '<YOUR_MONGO_CONNECTION_STRING>'
const query = (db) => (collection) =>
db
.collection(collection)
.find({}, { limit: 10 })
.toArray()
async function main() {
let client = new MongoClient(url)
await client.connect()
const db = client.db('sample_airbnb')
await Promise.all(Array(10).fill('listingsAndReviews').map(query(db)))
.then(res => console.log(res.length))
.finally(() => client.close())
}
main() |
Same issue still occurring on Deno 1.36.1. |
Just ran into the same problem while upgrading Deno. Currently stuck on 1.34.2 because it's the only version that supports @bartlomieju here's a minimal and reliable reproduction with the latest version of Deno (1.36.3) and import { MongoClient } from "npm:mongodb@5.8.1";
let client = new MongoClient(`mongodb://localhost:27017/deno-bug-test`, {});
let db = client.db("deno-bug-test");
// await db.collection("col1").deleteMany({});
// if collection is empty, insert 10 dummy docs for testing:
if(!await db.collection("col1").findOne({})) {
console.log("Inserting dummy docs...");
// note: it may be possible to reproduce with simpler docs than this - haven't tried to chisel them down
let docs = await fetch("https://gist.githubusercontent.com/josephrocca/88db398d7785b96aacd037fbf1bdce7e/raw/63b5922460e149677f78e8b3280ffc792279b739/denoMongoDbDebugDummyDocs.json").then(r => r.json());
for(let doc of docs) {
await db.collection("col1").insertOne(doc);
}
}
console.log("Starting...");
await Promise.all([
db.collection("col1").find({}).limit(10).toArray(),
db.collection("col1").find({}).limit(10).toArray(),
db.collection("col1").find({}).limit(10).toArray(),
db.collection("col1").find({}).limit(10).toArray(),
db.collection("col1").find({}).limit(10).toArray(),
]);
console.log("Done."); Some notes:
There are several different types of errors that I get and they occur randomly depending on the data, so I think TillaTheHun0 is correct that there's some sort of compression/decompression bug that's feeding MongoDB driver some garbled data:
|
Thanks for the report. We'll try to debug it this week. |
Hey, this is fixed in canary ( |
@littledivy Just tested and can verify that it seems to be fixed - thanks! |
Glad to hear this is now fixed, but I can't try canary, because my environment is Arm64. I will try it when the next version get released. |
The lastest 1.36.3 can still repruduce this issue. Does anyone know which verion will fix this issue? |
v1.37 will fix it, you can update to canary ( |
@bartlomieju Any plans on the release date of the 1.37? |
September 18th |
…gh the mongo driver Helps hedge against this issue denoland/deno#19831
I just update my Deno build to v1.35.1 from v1.35.0 and my Fresh app fails occasionally due to failed Mongodb query:
I'm not sure this is a bug or not, because I used unofficial build from https://github.com/LukeChannings/deno-arm64.
The text was updated successfully, but these errors were encountered: