install mongodb with node.js: Cannot read property 'arbiterOnly' of undefined

I try to install remotely node.js + now.js + mongoDB on a newly created Ubuntu 11.04 system (64 bits).

I created a structure like this:

  • /home/xxx/server.js
  • /home/xxx/node/
  • /home/xxx/node_modules/now/
  • /home/xxx/http/index.html

No problem with node.js and now.js, it works just fine but I have a hard time trying to install and setup mongoDB.

I went to the root of my machine and installed Mongodb this way:

cd
sudo apt-get install mongodb

I don't know if I should but I created a data/db folder like this:

cd
mkdir /data/db
chown `id -u` /data/db

When done, I installed the mongodb driver for node on the appropriate folder:

cd /home/xxx/
npm install mongodb 

Then I started the node server. My static page appears as it should but this is what I get on the ssh terminal after about 10 seconds:

[TypeError: Cannot read property 'arbiterOnly' of undefined]
TypeError: Cannot read property 'arbiterOnly' of undefined
    at /home/xxx/node_modules/mongodb/lib/mongodb/connection/server.js:558:22
    at [object Object].checkoutReader     (/home/xxx/node_modules/mongodb/lib/mongodb/connection/server.js:575:16)
    at /home/xxx/node_modules/mongodb/lib/mongodb/db.js:1344:79
    at Db._executeQueryCommand (/home/xxx/node_modules/mongodb/lib/mongodb/db.js:1555:5)
    at Cursor.nextObject (/home/xxx/node_modules/mongodb/lib/mongodb/cursor.js:455:13)
    at Array.0 (/home/xxx/node_modules/mongodb/lib/mongodb/cursor.js:162:12)
    at EventEmitter._tickCallback (node.js:192:40)
Tue Apr 24 2012 07:12:45 GMT+0200 (CEST) [GET] http://www.verysurf.com/proxyheader.php
error loading file httphttp://www.verysurf.com/proxyheader.php:  { [Error: ENOENT, No such     file or directory 'httphttp://www.verysurf.com/proxyheader.php']
  errno: 33,
  code: 'ENOENT',
  path: 'httphttp://www.verysurf.com/proxyheader.php' }

What is this 'arbiterOnly' error message about? What do I do wrong? I googled this thing but there's not much to find about it.

And that "www.verysurf.com" url at the end of the error message, it's not always the same one. 5 minutes before I got this one (and I didn't change anything, just restarted the node server):

error loading file httphttp://59.53.91.9/proxy/judge.php:  { [Error: ENOENT, No such file     or directory 'httphttp://59.53.91.9/proxy/judge.php']
  errno: 33,
  code: 'ENOENT',
  path: 'httphttp://59.53.91.9/proxy/judge.php' }

I really don't know what these url's are about.

Any help please?

Thank you.

I don't know why it's triggering that particular error message, but it looks to me like someone is or someones are sniffing your webserver to see if it's an open proxy (which it isn't). Some HTTP servers, notably Apache, are easily misconfigured to proxy any request to a third party:

http://en.wikipedia.org/wiki/Open_proxy

I get the very same message ([TypeError: Cannot read property 'arbiterOnly' of undefined]) when trying to request the database before the connection is fully initialized.

Make sure db.open() has finished (successfully)