Error connecting to mongodb
Describe the bug Error connecting mongodb and I find it to be a duplicate of #24 but here its not postgres and I am not sure which one fixes the error
To Reproduce
- Fetching DB schema
Cube.js Error ---------------------------------------
Error: connect ECONNREFUSED 127.0.0.1:5000
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14)
Any suggestions ?
Hey @PVinay737 ! On what port are you running your mongo BI server? Usually the port is 3307. Please see https://cube.dev/blog/building-mongodb-dashboard-using-node.js for more info.
Still the same error persists with port 3307 as well
@PVinay737 Are you running mongo BI server? If yes, could you please provide its logs?
Working !
The issue arises when one does not start mongo BI server
The succesful log should end with something like this
2019-06-19T23:14:06.389+0530 I NETWORK [conn1] connection accepted from 127.0.0.1:56754 #1 (1 connection now open)
2019-06-19T23:14:06.631+0530 I NETWORK [conn1] end connection 127.0.0.1:56754 (0 connections now open)
Hi @paveltiunov, I am trying to get this running and stuck with an error.
Error: connect ETIMEDOUT
at Connection._handleTimeoutError (/Users/devmachine/apps/cube/mongo-tutorial/node_modules/mysql2/lib/connection.js:178:17)
at listOnTimeout (internal/timers.js:531:17)
at processTimers (internal/timers.js:475:7)
.env file configuration is here
CUBEJS_DB_HOST=localhost CUBEJS_DB_NAME=test CUBEJS_DB_PORT=27017 CUBEJS_DB_TYPE=mongobi CUBEJS_API_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I am trying to run with MongoDB Atlas then after tried with localhost setup, getting same error.
Hi @paveltiunov,
it's working now, did't configure MongoBI with path and causing the issue.
Hi @paveltiunov paveltiunov, same error for me:
Error: connect ECONNREFUSED 17x.xx.xx.13:3307
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1134:16)
I've tried different combinations for .env configuration:
CUBEJS_DB_HOST=17x.xx.xx.13
CUBEJS_DB_NAME=xxxxAPI
CUBEJS_DB_USER=root
CUBEJS_DB_PASS=xxxx
CUBEJS_DB_PORT=3307
CUBEJS_DB_TYPE=mongobi
CUBEJS_API_SECRET=xxx
The BI connector seems to work fine :

@Matar91 Your MongoBI is listening on loopback's 127.0.0.1 address and you're trying to connect using real network interface address.
@Matar91 Your MongoBI is listening on loopback's 127.0.0.1 address and you're trying to connect using real network interface address.
Thanks @paveltiunov i managed to solve that problem. The only problem left with handshake, happens once Cube Js connects with BIconnector:

I am using SSL certificate as you suggested here https://stackoverflow.com/questions/58868085/cube-js-error-ssl-is-required-when-using-cleartext-authentication-using-mongod
@Matar91 Your MongoBI is listening on loopback's 127.0.0.1 address and you're trying to connect using real network interface address.
Thanks @paveltiunov i managed to solve that problem. The only problem left with handshake, happens once Cube Js connects with BIconnector:
I am using SSL certificate as you suggested here https://stackoverflow.com/questions/58868085/cube-js-error-ssl-is-required-when-using-cleartext-authentication-using-mongod
Solved, had to add this in cube.js .env file:
CUBEJS_DB_SSL=true
CUBEJS_DB_SSL_REJECT_UNAUTHORIZED=false
I got hit with the ECONNREFUSED error for MongoDB because I was running cube js locally on a mac in a Docker container and trying to connect to mongodb bi locally at 127.0.0.1. Needed to use host.docker.internal - https://docs.docker.com/docker-for-mac/networking/