Skip to content

Dashboard breaks if user is deleted that is currently viewed #416

@trivialkettle

Description

@trivialkettle

Hi, after an update to 0.21.0 I could not login into the dashboard. I tried core version 8 and 9 via registry.supertokens.io/supertokens/supertokens-postgresql:<version>

The logs say:

st-backend-1         | com.supertokens {t: "2024-06-20T07:37:11Z", message: "errorHandler: Checking recipe for match: emailpassword", file: "/build/vendor/github.com/supertokens/supertokens-golang/supertokens/supertokens.go:337" sdkVer: "0.21.0"}
st-backend-1         | 
st-backend-1         | com.supertokens {t: "2024-06-20T07:37:11Z", message: "errorHandler: Matched with recipeId: emailpassword", file: "/build/vendor/github.com/supertokens/supertokens-golang/supertokens/supertokens.go:339" sdkVer: "0.21.0"}
st-backend-1         | 
st-backend-1         | com.supertokens {t: "2024-06-20T07:37:11Z", message: "errorHandler: Checking recipe for match: session", file: "/build/vendor/github.com/supertokens/supertokens-golang/supertokens/supertokens.go:337" sdkVer: "0.21.0"}
st-backend-1         | 
st-backend-1         | com.supertokens {t: "2024-06-20T07:37:11Z", message: "errorHandler: Matched with recipeId: session", file: "/build/vendor/github.com/supertokens/supertokens-golang/supertokens/supertokens.go:339" sdkVer: "0.21.0"}
st-backend-1         | 
st-backend-1         | com.supertokens {t: "2024-06-20T07:37:11Z", message: "errorHandler: Checking recipe for match: dashboard", file: "/build/vendor/github.com/supertokens/supertokens-golang/supertokens/supertokens.go:337" sdkVer: "0.21.0"}
st-backend-1         | 
st-backend-1         | com.supertokens {t: "2024-06-20T07:37:11Z", message: "errorHandler: Matched with recipeId: dashboard", file: "/build/vendor/github.com/supertokens/supertokens-golang/supertokens/supertokens.go:339" sdkVer: "0.21.0"}
st-backend-1         | 
st-backend-1         | com.supertokens {t: "2024-06-20T07:37:11Z", message: "errorHandler: Checking recipe for match: emailverification", file: "/build/vendor/github.com/supertokens/supertokens-golang/supertokens/supertokens.go:337" sdkVer: "0.21.0"}
st-backend-1         | 
st-backend-1         | com.supertokens {t: "2024-06-20T07:37:11Z", message: "errorHandler: Matched with recipeId: emailverification", file: "/build/vendor/github.com/supertokens/supertokens-golang/supertokens/supertokens.go:339" sdkVer: "0.21.0"}
st-backend-1         | 
st-backend-1         | com.supertokens {t: "2024-06-20T07:37:11Z", message: "errorHandler: Checking recipe for match: usermetadata", file: "/build/vendor/github.com/supertokens/supertokens-golang/supertokens/supertokens.go:337" sdkVer: "0.21.0"}
st-backend-1         | 
st-backend-1         | com.supertokens {t: "2024-06-20T07:37:11Z", message: "errorHandler: Matched with recipeId: usermetadata", file: "/build/vendor/github.com/supertokens/supertokens-golang/supertokens/supertokens.go:339" sdkVer: "0.21.0"}
st-backend-1         | 
st-backend-1         | com.supertokens {t: "2024-06-20T07:37:11Z", message: "errorHandler: Checking recipe for match: multitenancy", file: "/build/vendor/github.com/supertokens/supertokens-golang/supertokens/supertokens.go:337" sdkVer: "0.21.0"}
st-backend-1         | 
st-backend-1         | com.supertokens {t: "2024-06-20T07:37:11Z", message: "errorHandler: Matched with recipeId: multitenancy", file: "/build/vendor/github.com/supertokens/supertokens-golang/supertokens/supertokens.go:339" sdkVer: "0.21.0"}

My docker-compose.yaml:

services:
  st-core:
    image: registry.supertokens.io/supertokens/supertokens-postgresql:9.0
    restart: unless-stopped
    depends_on:
      - st-db
    ports:
      - "${ST_CORE_EXTERNAL_PORT:-3567}:3567"
    environment:
      POSTGRESQL_CONNECTION_URI: "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@st-db:5432/${POSTGRES_DB}"
    healthcheck:
      test: >
        bash -c 'exec 3<>/dev/tcp/127.0.0.1/3567 && echo -e "GET /hello HTTP/1.1\r\nhost: 127.0.0.1:3567\r\nConnection: close\r\n\r\n" >&3 && cat <&3 | grep "Hello"'
      interval: 60s
      timeout: 5s
      retries: 5
    logging:
      options:
        max-file: "1"
        max-size: "100m"

  st-backend:
    image: eu.gcr.io/iot4u-smartmetering/supertokens-backend:latest
    ports:
      - "${ST_BACKEND_EXTERNAL_PORT:-3001}:3001"
    restart: unless-stopped
    depends_on:
      - st-core
    environment:
      API_BASE_PATH: /api/v1/auth/
      CORE: http://st-core:3567
      SUPERTOKENS_DEBUG: 1
      ORIGIN: ${BACKEND_ORIGIN}
      API_DOMAIN: ${BACKEND_API_DOMAIN}
      PORT: 3001
    logging:
      options:
        max-file: "1"
        max-size: "100m"

  st-db:
    image: postgres:16-alpine
    environment:
      POSTGRES_USER: ${POSTGRES_USER}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
      POSTGRES_DB: ${POSTGRES_DB}
    ports:
      - "${ST_POSTGRES_EXTERNAL_PORT:-5432}:5432"
    restart: unless-stopped
    volumes:
      - ./data/psql:/var/lib/postgresql/data
    healthcheck:
      test: [ "CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB" ]
      interval: 1s
      timeout: 1s
      retries: 5
    logging:
      options:
        max-file: "1"
        max-size: "100m"

A downgrade to v0.20.0 fixes this vor core 8 and core 9.

Edit: I copied the wrong log. Though I saw that also sdk 0.20.0 throws this error but does not break.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions