Horizon: Server: connect with rethinkdb as hostname fails

Created on 30 Jul 2016  路  5Comments  路  Source: rethinkdb/horizon

Server version: 2.0.0

So I'm using Docker and linking rethinkdb into my horizon container.

hz serve --dev --connect rethinkdb:28015 --secure=no --bind all --allow-anonymous=yes /usr/app throws:

error: Connection to RethinkDB terminated: ReqlDriverError: Could not connect to 28015:28015.
connect EINVAL 0.0.109.111:28015 - Local (0.0.0.0:0)

hz serve --dev --connect rdb:28015 --secure=no --bind all --allow-anonymous=yes /usr/app works fine though

Dumping the rdb_uri from url.parse(connect) I get:

Url {
  protocol: 'rethinkdb:',
  slashes: null,
  auth: null,
  host: '28015',
  port: null,
  hostname: '28015',
  hash: null,
  search: null,
  query: null,
  pathname: null,
  path: null,
  href: 'rethinkdb:28015' }
bug server

Most helpful comment

Seems like that's what's happening. You can work around it by using a full URI with protocol, like rethinkdb://rethinkdb:28015.

I think this can be fixed in horizon by requiring rdb_uri.slashes in serve.js to be true to accept a rethinkdb: protocol, which is only the case if the full rethinkdb:// prefix is used.

All 5 comments

Hmm is 0.0.109.111 a valid IP address? (@encryption ?)

The actual IP address that rethinkdb was resolving to was:

PING rethinkdb (172.20.0.5): 56 data bytes
64 bytes from 172.20.0.5: icmp_seq=0 ttl=64 time=0.145 ms

I believe the problem is the parser picking up the rethinkdb: from rethinkdb:28015 as a protocol.

The IP comes from 28015 as a hostname as can see via ping:

ping 28015
PING 28015 (0.0.109.111): 56 data bytes
ping: sendto: No route to host

Seems like that's what's happening. You can work around it by using a full URI with protocol, like rethinkdb://rethinkdb:28015.

I think this can be fixed in horizon by requiring rdb_uri.slashes in serve.js to be true to accept a rethinkdb: protocol, which is only the case if the full rethinkdb:// prefix is used.

Deleted my prev. comment. After I posted it, I spotted the 'rehinkdb' typo.

Changing the docker-compose.yml to the workaround until fixin would have saved a lot of time too :-/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marshall007 picture marshall007  路  8Comments

danielmewes picture danielmewes  路  7Comments

lirbank picture lirbank  路  8Comments

josephg picture josephg  路  6Comments

deontologician picture deontologician  路  3Comments