cube-js / cube

📊 Cube — Universal semantic layer platform for AI, BI, spreadsheets, and embedded analytics
https://cube.dev
Other
18.02k stars 1.78k forks source link

error connecting to cube with mongo #7882

Open jfparrado opened 8 months ago

jfparrado commented 8 months ago

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"

ovr commented 8 months ago

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

igorlukanin commented 6 months ago

@jfparrado Did the advice above help?