cube icon indicating copy to clipboard operation
cube copied to clipboard

error connecting to cube with mongo

Open jfparrado opened this issue 4 months ago • 2 comments

Problem i am trying to use mongo db with cube. This is my container on docker:

  cube:
    container_name: cube
    image: cubejs/cube
    ports:
      - 3001:3000
      - 4000:4000
    environment:
   

      - CUBEJS_DEV_MODE=true
      - CUBEJS_DB_TYPE=mongobi
      - CUBEJS_DB_HOST=mongodb
      - CUBEJS_DB_PORT=27017
      - CUBEJS_DB_NAME=mydatabase
      - CUBEJS_DB_USER=user
      - CUBEJS_DB_PASS=password
      - CUBEJS_API_SECRET=SECRET
      - CUBEJS_WEB_SOCKETS=true
      - CUBEJS_DB_SSL=true
      # - CUBEJS_DB_SSL_CA=./certs/fullchain.pem
      # - CUBEJS_DB_SSL_KEY=./certs/privkey.pem
    volumes:
      - .:/cube/conf
    networks:
      - app-tier

I am sure of the values i am putting there. but i am getting this error "Error while loading DB schema Error: connect ETIMEDOUT at PromiseConnection.connect (/cube/node_modules/mysql2/promise.js:171:22) at Object.create (/cube/node_modules/@cubejs-backend/mongobi-driver/src/MongoBIDriver.ts:112:30) at MongoBIDriver.testConnection (/cube/node_modules/@cubejs-backend/mongobi-driver/src/MongoBIDriver.ts:182:63) at CubejsServerCore.getDriver (/cube/node_modules/@cubejs-backend/server-core/src/core/server.ts:800:20) at processTicksAndRejections (node:internal/process/task_queues:96:5) at /cube/node_modules/@cubejs-backend/server-core/src/core/DevServer.ts:108:22 at /cube/node_modules/@cubejs-backend/server-core/src/core/DevServer.ts:78:9"

jfparrado avatar Mar 07 '24 21:03 jfparrado

Hello @jfparrado,

As I can see from your configuration CUBEJS_DB_PORT=27017, you are trying to connect Cube directly to Mongo, which is not a Mongo BI connector.

To use Cube with MongoDB you need to install the MongoDB Connector for BI.

Learn more about setup for MongoDB here.

Thanks

ovr avatar Mar 11 '24 12:03 ovr

@jfparrado Did the advice above help?

igorlukanin avatar May 14 '24 10:05 igorlukanin