2

I'm using nodester with iriscouch. I've installed the couchdb-api package. This is my code:

console.log("Running");
//Appears in the logs

var dbServer = require("couchdb-api").srv('eric-wieser.iriscouch.com');
console.log(dbServer);
//Appears in the logs

dbServer.info(function (err, response) {
    console.log("Info!");

    //Never executed. Logs show:
    //Error: ECONNREFUSED, Could not contact DNS servers
    //    at IOWatcher.callback (dns.js:74:15)
});

Why is this not working? What is that error trying to tell me?

4
  • Running on nodester. So I'm assuming Linux, since their cli is for linux. I don't actually know though. Commented Sep 5, 2011 at 20:19
  • It seems there is a problem with the DNS server. I would have added nameserver 8.8.8.8 in /etc/resolv.conf, but i doubt you can change that on nodester :( Commented Sep 5, 2011 at 20:24
  • @stewe: So should it work with just an IP address? Commented Sep 5, 2011 at 21:14
  • Yes, using an ip solves the DNS problem, but it requires you to modify the HTTP Host Header to eric-wieser.iriscouch.com, so that iriscouch knows to which iriscouch-user to direct the request. Or else you would just see: 50.16.186.4 Commented Sep 5, 2011 at 21:40

1 Answer 1

3

Can't help you with nodester, have no experience with it. However that seems to indicate you cannot connected to iriscouch, which might mean you need to give the full url? Does the code work on your local machine?

If you are interested I wrote a blog for couchdb/node beginners yesterday: http://writings.nunojob.com/2011/09/getting-started-with-nodejs-and-couchdb.html

Sign up to request clarification or add additional context in comments.

3 Comments

I don't have node.js installed on my local machine - I don't have admininstrator access - so there's no easy way for me to test it. I tried initially with a full URL, but the documentation said it needed a hostname.
Have you tried following this tutorial I posted? did you get the same problem? Don't forget to install all dependencies by hand since nodester does not seem to do that for you
@Eric, You don't need to be an administrator to install nodejs for your account. If you don't have build dependencies installed (python, make, g++, ...) it is difficult, but otherwise it is quite easy.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.