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 #185

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

Error: No such host is known #185

FSou1 opened this issue Jan 15, 2021 · 4 comments

Comments

@FSou1
Copy link

FSou1 commented Jan 15, 2021

When I use the following host:

const connector = new MongoDBConnector({
  uri:
    "mongodb://admin:RehlmKTm5pr9f9MG@cluster0.vsk29.mongodb.net/test?retryWrites=true&w=majority",
  database: "test",
});

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:20:18)
    at async MongoDBConnector._makeConnection (mongodb-connector.ts:42:7)  
    at async MongoDBConnector.query (mongodb-connector.ts:65:5)
    at async Database.query (database.ts:227:21)
    at async Function.createTable (model.ts:161:5)
    at async Database.sync (database.ts:197:7)

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

@eveningkid
Copy link
Owner

Hi Maxim,

This might be an error coming from deno_mongo which is the driver used in denodb for Mongo.

Could you see if connecting to your URI from their documentation example works for you?

If it does, then it might be a case of upgrading this driver version which I can help with.
Otherwise, this should be dealt with on their repository instead.

Let me know so we can figure this out together!

@FSou1
Copy link
Author

FSou1 commented Jan 17, 2021

Hi Arnaud,

No, it does not work (I've also created an issue in their repository).

I managed to connect to my local instance with mongodb://localhost:27017. However, the initial URL (mongodb+srv://) is used to connect to the MongoDB Cloud instance, which isn't something unusual and probably has to be supported.

@eveningkid
Copy link
Owner

Mmm, I believe most people are using their cloud service so you're right it should be supported.

For now, I will close this issue since this isn't directly related to denodb and will eventually be fixed with the driver.

If there is anything else, let me know :)

@FSou1
Copy link
Author

FSou1 commented Jan 18, 2021

Yes, you are right.

This fix should be applied to the driver side once the Deno resolveDns API becomes available.

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

2 participants