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?

Eric
  • 95,302
  • 53
  • 242
  • 374
  • Running on nodester. So I'm assuming Linux, since their cli is for linux. I don't actually know though. – Eric Sep 05 '11 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 :( – stewe Sep 05 '11 at 20:24
  • @stewe: So should it work with just an IP address? – Eric Sep 05 '11 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: http://50.16.186.4/ – stewe Sep 05 '11 at 21:40

1 Answers1

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

dscape
  • 2,506
  • 1
  • 22
  • 20
  • 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. – Eric Sep 05 '11 at 21:14
  • 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 – dscape Sep 06 '11 at 00:01
  • @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. – Marcello Nuccio Sep 06 '11 at 08:11