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: No such host is known #168

Closed
FSou1 opened this issue Jan 15, 2021 · 8 comments
Closed

Error: No such host is known #168

FSou1 opened this issue Jan 15, 2021 · 8 comments

Comments

@FSou1
Copy link
Contributor

FSou1 commented Jan 15, 2021

When I run this code:

import { MongoClient } from "https://deno.land/x/mongo@v0.21.0/mod.ts";

const client = new MongoClient();
await client.connect("mongodb+srv://admin:ReelmKTm3pr9f9MG@cluster0.vsk29.mongodb.net/test?retryWrites=true&w=majority");

I get the following error:

error: Uncaught (in promise) Error: No such host is known. (os error 11001)
    at processResponse (deno:core/core.js:223:11)
    at Object.jsonOpAsync (deno:core/core.js:240:12)
    at async Object.connect (deno:runtime/rt/30_net.js:224:13)
    at async MongoClient.connect (client.ts:41:14)
    at async mod.ts:4:1

The same host is normally connected with Node.js and the mongodb npm package.

@manyuanrong
Copy link
Member

Change mongodb+srv:// to mongodb://

@FSou1
Copy link
Contributor Author

FSou1 commented Jan 15, 2021

Change mongodb+srv:// to mongodb://

This does not work on my side.

Does it work for you?

@FSou1
Copy link
Contributor Author

FSou1 commented Jan 18, 2021

As I could see, this is a matter of the new URL format, which has been introduced as a part of the 3.6 version.

Actual hosts are located as SRV records and have to be obtained via the resolveDns API (which is under development).

This is how it works at the node mongodb driver.

@DryDemon
Copy link

Any solution or way to find a usable link?

@femave
Copy link

femave commented Jan 19, 2021

in v0.12.1 looks like all working well....

@DryDemon
Copy link

For information https://www.clever-cloud.com/en/ propose a mongo database tat works with the last version

@worldwidebaby
Copy link

worldwidebaby commented Jan 22, 2021

in v0.12.1 looks like all working well....

this doesn't work for me

@manyuanrong
Copy link
Member

closed by #198

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

5 participants