denodrivers / denodrivers/mongo

Unable to connect to mongodb Atlas

Open
#319 7 comments 0 reactions 0 assignees View on GitHub
atlas
Dominant language
TypeScript
Stars
511
Forks
89
PR merge metrics
No merged PRs in 30d

Description

Hey, it works with local db but fails with mongodb atlas connection string, I'm using the syntax like this:
```ts
await client.connect(
"mongodb+srv://user:password@name.mongodb.net/db?authMechanism=SCRAM-SHA-1"
);

// also tried this

await client.connect(
"mongodb+srv://user:password@name.mongodb.net/db?retryWrites=true&w=majority&authMechanism=SCRAM-SHA-1"
);

// and this

await client.connect(
"mongodb+srv://user:password@name.mongodb.net/db?retryWrites=true&w=majority"
);
```

It always fails here: https://deno.land/x/mongo@v0.29.0/src/client.ts#L41
with error:
```json
{
"ok":0,
"errmsg":"Authentication failed.",
"code":18,
"codeName":"AuthenticationFailed",
"$clusterTime":{"clusterTime":{"$timestamp":"7043035952079437828"},"signature":{"hash":"z8hkCMby/OYpTnJXHNS7+rZfBvI=","keyId":{"high":1625418439,"low":1,"unsigned":false}}},
"operationTime":{"$timestamp":"7043035952079437828"}
}
```

Can you share if it's a known issue or do I need to provide some additional params?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at src/client.ts:41 and reproduce the failure with the MongoDB Atlas connection strings shown in the issue. Compare the local-database and Atlas connection paths, then verify the reported AuthenticationFailed response; done means identifying whether the driver needs additional parameters or documenting the required connection syntax.

Written by the indexing model from the issue text.

Assessment

Tech stack
mongodb, typescript
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.