Hi all, I'm trying to get my docker compose to run properly but have been facing the following error...
a

arnmishra

over 2 years ago
Hi all, I'm trying to get my docker compose to run properly but have been facing the following error. Not sure why it can't detect the correct password/database:
2023-03-14 09:52:34 2023-03-14 16:52:34.972 UTC [129] FATAL:  role "doss-username" does not exist
2023-03-14 09:52:39 2023-03-14 16:52:39.086 UTC [131] FATAL:  password authentication failed for user "doss-username"
2023-03-14 09:52:39 2023-03-14 16:52:39.086 UTC [131] DETAIL:  Role "doss-username" does not exist.
2023-03-14 09:52:39     Connection matched pg_hba.conf line 99: "host all all all md5"
with the following docker compose:
version: '3.8'
services:
  # Database for developers running app locally
  doss-postgres-local:
    platform: linux/amd64
    container_name: doss-postgres-local
    image: postgis/postgis:12-3.3
    environment:
      POSTGRES_USER: doss-username
      POSTGRES_PASSWORD: doss-password
      POSTGRES_DB: doss-localdb
      PGDATA: /var/lib/postgresql/data
    ports:
      - 5432:5432
    networks:
      - app_network
    volumes:
      - doss-localdb:/var/lib/postgresql/data
    restart: unless-stopped
    healthcheck:
      test: ['CMD', 'pg_isready', '-U', 'doss-username']
      interval: 5s
      timeout: 5s
      retries: 5
    cap_add:
      - NET_ADMIN

  supertokens:
    image: registry.supertokens.io/supertokens/supertokens-postgresql:4.4
    depends_on:
      doss-postgres-local:
        condition: service_healthy
    ports:
      - 3567:3567
    environment:
      POSTGRESQL_CONNECTION_URI: 'postgresql://doss-username:doss-password@doss-postgres-local:5432/doss-localdb'
    networks:
      - app_network
    restart: unless-stopped
    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: 10s
      timeout: 5s
      retries: 5
Hey there, back with another few questions. 😇 I am planning the upgrade from `supertokens-core` `v...
n

n1ru4l

almost 3 years ago
Hey there, back with another few questions. 😇 I am planning the upgrade from
supertokens-core
v3.16.2
to
v4.0.0
and I have a few questions around the database changes for the
emailpassword_users
and
thirdparty_users
table: Why did you choose
VARCHAR(256)
and
VARCHAR(128)
over just
TEXT
? The latter would have required no database migration and would not require a database migration in the future if the value changes again. Is it safe for me to use
TEXT
instead of
VARCHAR(256)
- or does
supertokens-core
do some kind of database schema validation? How did you manage to roll this out in production? In my current understanding it is not possible to apply this migration without locking the full database table and rewriting every single row. Wouldn't it been smarter (and also less "breaking") to follow this strategy: 1. Add a new columns "thirdparty_users"."third_party_user_id_new" and "emailpassword_users"."password_hash_new" 2. Run a script during outside of a migration/lock that copies the values from the old column to the new column 3. Write the super tokens code in a way that it can deal with both the old and new columns for the duration of the copy from old to new column period Right now, for us running the migration will probably not take longer than a few seconds - however, I am concerned that in the future additional breaking database changes will make it harder for us to migrate to the latest versions. Since you probably have much more users running on your hosted solution, I am especially curious on any insights on how you manged this (of course only if it is possible to share that information)!