cube-js / cube

📊 Cube — The Semantic Layer for Building Data Applications
https://cube.dev
Other
17.85k stars 1.77k forks source link

Docker Compose deploy failed with "Error: dbType, apiSecret are required option(s)" #4613

Open Stainless5792 opened 2 years ago

Stainless5792 commented 2 years ago

Describe the bug Follow the official doc "running in production" section with the docker compose, just copy the docker-compose file content, then bring it up and got "Error: dbType, apiSecret are required option(s)"

To Reproduce Steps to reproduce the behavior:

  1. Go to 'official doc "running in production" section '
  2. copy the docker-compose file content
  3. Run the command "docker-compose up "
  4. See error: "Error: dbType, apiSecret are required option(s)"
$ cat cube_compose_prod.yml
version: '2.2'
services:
  cubestore_router:
    restart: always
    image: cubejs/cubestore:latest
    environment:
      - CUBESTORE_SERVER_NAME=cubestore_router:9999
      - CUBESTORE_META_PORT=9999
      - CUBESTORE_WORKERS=cubestore_worker_1:9001,cubestore_worker_2:9001
      - CUBESTORE_REMOTE_DIR=/cube/data
    volumes:
      - .cubestore:/cube/data
  cubestore_worker_1:
    restart: always
    image: cubejs/cubestore:latest
    environment:
      - CUBESTORE_SERVER_NAME=cubestore_worker_1:9001
      - CUBESTORE_WORKER_PORT=9001
      - CUBESTORE_META_ADDR=cubestore_router:9999
      - CUBESTORE_WORKERS=cubestore_worker_1:9001,cubestore_worker_2:9001
      - CUBESTORE_REMOTE_DIR=/cube/data
    depends_on:
      - cubestore_router
    volumes:
      - .cubestore:/cube/data
  cubestore_worker_2:
    restart: always
    image: cubejs/cubestore:latest
    environment:
      - CUBESTORE_SERVER_NAME=cubestore_worker_2:9001
      - CUBESTORE_WORKER_PORT=9001
      - CUBESTORE_META_ADDR=cubestore_router:9999
      - CUBESTORE_WORKERS=cubestore_worker_1:9001,cubestore_worker_2:9001
      - CUBESTORE_REMOTE_DIR=/cube/data
    depends_on:
      - cubestore_router
    volumes:
      - .cubestore:/cube/data
  cube:
    image: cubejs/cube:latest
    ports:
      - 4000:4000
    environment:
      - CUBEJS_CUBESTORE_HOST=cubestore_router
    depends_on:
      - cubestore_router
    volumes:
      - .:/cube/conf

$ docker-compose -f cube_compose_prod.yml up
[+] Running 4/4
 ⠿ cubestore_router Pulled                                                                                                                                                                                    0.1s
 ⠿ cubestore_worker_2 Pulled                                                                                                                                                                                  0.1s
 ⠿ cubestore_worker_1 Pulled                                                                                                                                                                                  0.1s
 ⠿ cube Pulled                                                                                                                                                                                                0.1s
[+] Running 5/5
 ⠿ Network cubejs_default                 Created                                                                                                                                                             0.3s
 ⠿ Container cubejs-cubestore_router-1    Created                                                                                                                                                             0.1s
 ⠿ Container cubejs-cube-1                Created                                                                                                                                                             0.1s
 ⠿ Container cubejs-cubestore_worker_1-1  Created                                                                                                                                                             0.0s
 ⠿ Container cubejs-cubestore_worker_2-1  Created                                                                                                                                                             0.0s
Attaching to cubejs-cube-1, cubejs-cubestore_router-1, cubejs-cubestore_worker_1-1, cubejs-cubestore_worker_2-1
cubejs-cubestore_router-1    | 2022-05-29 03:44:57,871 INFO  [cubestored] <pid:1> Cube Store version 0.30.7
cubejs-cubestore_router-1    | 2022-05-29 03:44:57,881 INFO  [cubestore::http::status] <pid:1> Serving status probes at 0.0.0.0:3031
cubejs-cubestore_router-1    | 2022-05-29 03:44:57,882 INFO  [cubestore::metastore] <pid:1> Creating metastore from scratch in /cube/.cubestore/data/metastore
cubejs-cubestore_router-1    | 2022-05-29 03:44:57,908 INFO  [cubestore::cluster] <pid:1> Meta store port open on 0.0.0.0:9999
cubejs-cubestore_router-1    | 2022-05-29 03:44:57,908 INFO  [cubestore::http] <pid:1> Http Server is listening on 0.0.0.0:3030
cubejs-cubestore_router-1    | 2022-05-29 03:44:57,908 INFO  [cubestore::mysql] <pid:1> MySQL port open on 0.0.0.0:3306
cubejs-cubestore_worker_1-1  | 2022-05-29 03:44:58,387 INFO  [cubestored] <pid:1> Cube Store version 0.30.7
cubejs-cubestore_worker_1-1  | 2022-05-29 03:44:58,397 INFO  [cubestore::cluster] <pid:1> Worker port open on 0.0.0.0:9001
cubejs-cubestore_worker_1-1  | 2022-05-29 03:44:58,408 INFO  [cubestored] <pid:28 sel1> Cube Store version 0.30.7
cubejs-cubestore_worker_1-1  | 2022-05-29 03:44:58,419 INFO  [cubestored] <pid:32 sel2> Cube Store version 0.30.7
cubejs-cubestore_worker_1-1  | 2022-05-29 03:44:58,429 INFO  [cubestored] <pid:48 sel3> Cube Store version 0.30.7
cubejs-cubestore_worker_1-1  | 2022-05-29 03:44:58,439 INFO  [cubestored] <pid:66 sel4> Cube Store version 0.30.7
cubejs-cubestore_worker_2-1  | 2022-05-29 03:44:58,493 INFO  [cubestored] <pid:1> Cube Store version 0.30.7
cubejs-cubestore_worker_2-1  | 2022-05-29 03:44:58,503 INFO  [cubestore::cluster] <pid:1> Worker port open on 0.0.0.0:9001
cubejs-cubestore_worker_2-1  | 2022-05-29 03:44:58,514 INFO  [cubestored] <pid:29 sel1> Cube Store version 0.30.7
cubejs-cubestore_worker_2-1  | 2022-05-29 03:44:58,524 INFO  [cubestored] <pid:34 sel2> Cube Store version 0.30.7
cubejs-cubestore_worker_2-1  | 2022-05-29 03:44:58,533 INFO  [cubestored] <pid:49 sel3> Cube Store version 0.30.7
cubejs-cubestore_worker_2-1  | 2022-05-29 03:44:58,542 INFO  [cubestored] <pid:67 sel4> Cube Store version 0.30.7
cubejs-cube-1                | Warning. There is no cube.js file. Continue with environment variables
cubejs-cube-1                |
cubejs-cube-1                | Cube.js Error ---------------------------------------
cubejs-cube-1                |
cubejs-cube-1                | Error: dbType, apiSecret are required option(s)
cubejs-cube-1                |     at CubejsServerCore.handleConfiguration (/cube/node_modules/@cubejs-backend/server-core/src/core/server.ts:483:15)
cubejs-cube-1                |     at new CubejsServerCore (/cube/node_modules/@cubejs-backend/server-core/src/core/server.ts:122:25)
cubejs-cube-1                |     at Function.create (/cube/node_modules/@cubejs-backend/server-core/src/core/server.ts:546:12)
cubejs-cube-1                |     at new CubejsServer (/cube/node_modules/@cubejs-backend/server/src/server.ts:79:26)
cubejs-cube-1                |     at ServerContainer.runServerInstance (/cube/node_modules/@cubejs-backend/server/src/server/container.ts:234:20)
cubejs-cube-1                |     at makeInstance (/cube/node_modules/@cubejs-backend/server/src/server/container.ts:344:33)
cubejs-cube-1                |     at ServerContainer.start (/cube/node_modules/@cubejs-backend/server/src/server/container.ts:357:20)
cubejs-cube-1                |     at Server.run (/cube/node_modules/@cubejs-backend/server/src/command/server.ts:25:5)
cubejs-cube-1                |     at Command.<anonymous> (/cube/node_modules/cubejs-cli/src/command/proxy-command.ts:51:13)
cubejs-cube-1                |
cubejs-cube-1                | Need some help? -------------------------------------
cubejs-cube-1                |
cubejs-cube-1                |   Ask this question in Cube.js Slack: https://slack.cube.dev
cubejs-cube-1                |   Post an issue: https://github.com/cube-js/cube.js/issues
cubejs-cube-1                |
cubejs-cube-1 exited with code 1
cubejs-cubestore_router-1    | 2022-05-29 03:45:27,911 INFO  [cubestore::metastore] <pid:1> Persisting meta store snapshot: done (2.918515ms)

Env Info

$ docker version
Client: Docker Engine - Community
 Version:           20.10.16
 API version:       1.41
 Go version:        go1.17.10
 Git commit:        aa7e414
 Built:             Thu May 12 09:19:45 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.16
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.17.10
  Git commit:       f756502
  Built:            Thu May 12 09:18:08 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.4
  GitCommit:        212e8b6fa2f44b9c21b2798135fc6fb7c53efc16
 runc:
  Version:          1.1.1
  GitCommit:        v1.1.1-0-g52de29d
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

$ docker-compose version
Docker Compose version v2.5.0

$ docker images | grep cube
cubejs/cube                      latest              e1da64c1fba1   2 days ago     939MB
cubejs/cubestore                 latest              111b376e77e8   2 days ago     165MB
ivan-vdovin commented 2 years ago

Hi @Stainless5792 ! Could you try the following guide to run Cube in dev mode and set up a DB connection before moving to prod setup? https://cube.dev/docs/getting-started/docker/compose

Stainless5792 commented 2 years ago

Hi @Stainless5792 ! Could you try the following guide to run Cube in dev mode and set up a DB connection before moving to prod setup? https://cube.dev/docs/getting-started/docker/compose

Hi @ivan-vdovin , I've tried the dev mode and it does can work, but not for the prod setup.

paveltiunov commented 2 years ago

@Stainless5792 Provided configuration isn't sufficient to run production deployment. We should make it clear in docs. cc @hassankhan