Can't access to login page after /api/setup/ api call

Hi,

I would like to setup metabase automatically.

I setup my local metabase instance with /api/setup/ endpoint but after success setup api call, I can't access to login page :pensive:

Details

This is my docker-compose.yml:

version: '3.9'
services:
  metabase:
    image: metabase/metabase:v0.39.0.1
    ports:
      - 3000:3000
    environment:
      MB_DB_TYPE: postgres
      MB_DB_DBNAME: metabase
      MB_DB_PORT: 5432
      MB_DB_USER: metabase
      MB_DB_PASS: password
      MB_DB_HOST: metabase-postgres
      MB_SETUP_TOKEN: setup_token
      MB_PASSWORD_COMPLEXITY: weak

  metabase-postgres:
    image: postgres:12.2-alpine
    environment:
      POSTGRES_USER: metabase
      POSTGRES_DB: metabase
      POSTGRES_PASSWORD: password
    volumes:
      - ./volumes/metabase-postgres/:/var/lib/postgresql/data/

  data-analysis:
    image: postgres:13.2-alpine
    environment:
      POSTGRES_USER: dataanalysis
      POSTGRES_DB: dataanalysis
      POSTGRES_PASSWORD: password
    volumes:
      - ./volumes/data-analysis-postgres/:/var/lib/postgresql/data/

After all services starting, I execute this curl commands:

curl -X POST \
    -H "Content-Type: application/json" \
    http://localhost:3000/api/setup/ \
    --data-binary @- << EOF
{
    "token": "setup_token",
    "user": {
        "first_name": "John",
        "last_name": "Doe",
        "email": "admin@example.com",
        "password": "password"
    },
    "database": {
        "name": "dataanalysis",
        "engine": "postgres",
        "details": {
            "host": "data-analysis",
            "port": "5432",
            "dbname": "dataanalysis",
            "user": "dataanalysis",
            "password": "password"
        }
    },
    "prefs": {
        "allow_tracking": true,
        "site_name": "yyzz"
    }
}
EOF
{"id":"76889ed1-cc93-4000-becf-6f03183c6b35"}%

Next, I go to http://127.0.0.1:3000 and I'm redirect to setup page (http://127.0.0.1:3000/setup).

Question: what missing?

Best regards,
Stéphane

Hi @stephane-klein
You would need to remove the MB_SETUP_TOKEN or get it dynamically.
You're seeing this issue:
https://github.com/metabase/metabase/issues/12874 - upvote by clicking :+1: on the first post

1 Like

Thanks :+1: @flamber