Skip to content
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

Error: MongoError: "Connection failed: Failed to decode base64" #411

Open
unpin opened this issue Apr 19, 2024 · 3 comments
Open

Error: MongoError: "Connection failed: Failed to decode base64" #411

unpin opened this issue Apr 19, 2024 · 3 comments

Comments

@unpin
Copy link

unpin commented Apr 19, 2024

After upgrading to [email protected], the connection consistently fails with the error "Connection failed: Failed to decode base64", occurring both locally and on Deno Deploy. I had to downgrade to [email protected] for now.

import { Database, MongoClient } from "mongo";

const DATABASE_URL = "mongodb+srv://<username>:<password>@<db_cluster_url>/<db_name>?authMechanism=SCRAM-SHA-1"

const client = new MongoClient();
await client.connect(DATABASE_URL);
@lucsoft
Copy link
Collaborator

lucsoft commented Apr 19, 2024

Can you give more backstory? what db cluster is this? Atlas?

Do you have non base64 decodable chars in your string?

@unpin
Copy link
Author

unpin commented Apr 19, 2024

Sure! I'm trying to connect to a free tier Atlas cluster and this is what my connection string basically looks like:

const DATABASE_URL = "mongodb+srv://admin:123456@cluster/db?authMechanism=SCRAM-SHA-1"

Username and password contain only Base64 chars. Connection establishes without any problems when using [email protected] or earlier, but fails when using [email protected].

@erfanium
Copy link
Member

I think it's related to #406

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants