MongoError: "Invalid response header"
See original GitHub issueHi, I’m trying connect to MongoDb Atlas.
On localhost everything is OK, but when I deploy project on Deno Deploy it throw this error:
Error: MongoError: "Invalid response header" at WireProtocol.receive (https://deno.land/x/mongo@v0.29.3/src/protocol/protocol.ts:77:38)
I already have on Mongo network access with Deno Deploy IP.
This is my usage of your module: mongodb.ts
import { MongoClient } from "./deps.ts";
import "https://deno.land/x/dotenv@v3.2.0/load.ts";
const client = new MongoClient();
const MONGO_URI = Deno.env.get("MONGO_URI");
const db = await client.connect(MONGO_URI ? MONGO_URI : "");
export default db;
app.ts
import db from "../mongodb.ts";
const usersCollection = db.collection<IUserModel>("users");
export const authLogin = async(ctx: Context) =>
{
if (!ctx.request.hasBody) ctx.throw(Status.BadRequest, "Bad Request");
const model = await ctx.request.body().value;
if (!model) ctx.throw(Status.BadRequest, "Bad Request");
const user = await usersCollection.findOne(
{ email: model.email },
{ noCursorTimeout: false }
);
... // more code
}
As I say on localhost, everything works, but when I deploy it, it throw Crash Report.
Any idea how to solve this?
Issue Analytics
- State:
- Created a year ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Header error in saving a new entry in MongoDB by using ...
The reason for this issue is you are sending response to client twice. If there is an error you should return it as...
Read more >Issues · denodrivers/mongo - GitHub
MongoDB driver for Deno. Contribute to denodrivers/mongo ... Should we deprecate this module since importing with npm:mongodb is working well with Deno?
Read more >Administration Login fails, is something wrong with my Function?
Hello, I try to use the Realm Administration API and this is the function for getting the token. async function cloudLogin() { const ......
Read more >Azure Cosmos DB for Gremlin response headers
Header Type Sample Value When Included
x‑ms‑request‑charge double 11.3243 Success and Failure
x‑ms‑total‑request‑charge double 423.987 Success and Failure
x‑ms‑server‑time‑ms double 13.75 Success and Failure
Read more >HTTP security headers: An easy way to harden your web ...
Modern browsers support a wide array of HTTP headers that can improve ... hashes of valid certificate public keys for future communication.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@BrunoBernardino for now: https://github.com/erfanium/atlas_sdk is my current option
I also have this problem sporadically with M2 in Cloud Atlas. I think it’s when the primary server in the cluster switches, but basically for a few minutes this error shows up and blocks everything.
If there’s something I can do to improve support on this, I’m happy to help.