meatier
meatier copied to clipboard
Setting DATABASE_HOST generates connection errors
Issue - Bug
- OS: OSX
- Node version:
v4.4.4 - NPM version:
3.9.0 - RethinkDB version:
2.3.2
I'm trying to get meatier to connect to a local Docker container of rethinkdb. I set the DATABASE_HOST in the .env file, but I'm still getting this error when I run npm run quickstart (as it's still trying to connect to 127.0.0.1):
Fail to create a new connection for the connection pool. Error:{"message":"Failed to connect to localhost:28015\nFull error:\n{\"code\":\"ECONNREFUSED\",\"errno\":\"ECONNREFUSED\",\"syscall\":\"connect\",\"address\":\"127.0.0.1\",\"port\":28015}.","isOperational":true}
Also, I'm able to connect to the RethinkDB administration URL on the container just fine...
can you verify that rethinkdb is currently running on 28015? Also try to debug getRethinkConfig and see if it's picking up your process variables, since it'll default to localhost
Thanks, I'll try debugging the getRethinkConfig... DATABASE_HOST is set to 192.168.99.100, so since the error is still specifying localhost, it's gotta be missing the dotenv config somewhere.
Actually there is no call to getDotenv function to expand process.ENV variables in setupDB script Quick fix, add to the beginning of file src/server/database/getRethinkConfig.js
import {getDotenv} from '../../universal/utils/dotenv';
getDotenv();
fixed by set DATABASE_HOST=127.0.0.1 in the file .env