[Bug]: error: role "planka" does not exist #770

Closed
opened 2026-02-04 21:16:47 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @AnthonyLELUYER on GitHub (Jul 30, 2025).

Where is the problem occurring?

None

What browsers are you seeing the problem on?

No response

Current behavior

Hello,

When the container planka is starting, I receive this error:

/app/node_modules/pg-protocol/dist/parser.js:285
        const message = name === 'notice' ? new messages_1.NoticeMessage(length, messageValue) : new messages_1.DatabaseError(messageValue, length, name);
                                                                                                 ^

error: role "planka" does not exist
    at Parser.parseErrorMessage (/app/node_modules/pg-protocol/dist/parser.js:285:98)
    at Parser.handlePacket (/app/node_modules/pg-protocol/dist/parser.js:122:29)
    at Parser.parse (/app/node_modules/pg-protocol/dist/parser.js:35:38)
    at Socket.<anonymous> (/app/node_modules/pg-protocol/dist/index.js:11:42)
    at Socket.emit (node:events:517:28)
    at addChunk (node:internal/streams/readable:368:12)
    at readableAddChunk (node:internal/streams/readable:341:9)
    at Readable.push (node:internal/streams/readable:278:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
  length: 98,
  severity: 'FATAL',
  code: '28000',
  detail: undefined,
  hint: undefined,
  position: undefined,
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'miscinit.c',
  line: '799',
  routine: 'InitializeSessionUserId'
}

Node.js v18.20.8

Is it an OIDC role issue or something on the database?
Here is my docker-compose:

secrets:
  database_password:
    file: "./secrets/database_password.secret"
  oidc_client_secret:
    file: "./secrets/oidc_client_secret.secret"
  secret_key:
    file: "./secrets/secret_key.secret"

services:
  planka:
    image: ghcr.io/plankanban/planka:2.0.0-rc.3
    restart: on-failure
    volumes:
      - favicons:/app/public/favicons
      - user-avatars:/app/public/user-avatars
      - background-images:/app/public/background-images
      - attachments:/app/private/attachments
    user: 1000:1000
    tmpfs:
      - /app/.tmp:mode=770,uid=1000,gid=1000
    ports:
      - 3000:1337
    environment:
      - BASE_URL=https://#######.fr
      - DATABASE_URL=postgresql://planka:$${DATABASE_PASSWORD}@planka-postgres-1/planka
      - DATABASE_PASSWORD__FILE=/run/secrets/database_password
      - SECRET_KEY__FILE=/run/secrets/secret_key
      - LOG_LEVEL=debug
      - DEFAULT_LANGUAGE=fr-FR
      - OIDC_ISSUER=https://######/realms/######
      - OIDC_CLIENT_ID=######
      - OIDC_CLIENT_SECRET__FILE=/run/secrets/oidc_client_secret
    secrets:
      - oidc_client_secret
      - database_password
      - secret_key
    networks:
      - proxy
      - planka
    depends_on:
      postgres:
        condition: service_healthy

  postgres:
    image: postgres:16-alpine
    restart: on-failure
    volumes:
      - db-data:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=planka
      - POSTGRES_HOST_AUTH_METHOD=trust
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres -d planka"]
      interval: 10s
      timeout: 5s
      retries: 5
    networks:
      - planka

volumes:
  favicons:
  user-avatars:
  background-images:
  attachments:
  db-data:

networks:
  planka:
    internal: true
  proxy:
    external: true

Desired behavior

No response

Steps to reproduce

I followed the documentation here: https://docs.planka.cloud/docs/installation/docker/production-version
I :

  • retrieved the docker-compose
  • edited the env variables
  • added my networks (the container is restarting without my networks)
  • created the admin with the command provided by the doc
  • executed the command docker-compose up -d
  • found the issue

Other information

No response

Originally created by @AnthonyLELUYER on GitHub (Jul 30, 2025). ### Where is the problem occurring? None ### What browsers are you seeing the problem on? _No response_ ### Current behavior Hello, When the container planka is starting, I receive this error: ``` /app/node_modules/pg-protocol/dist/parser.js:285 const message = name === 'notice' ? new messages_1.NoticeMessage(length, messageValue) : new messages_1.DatabaseError(messageValue, length, name); ^ error: role "planka" does not exist at Parser.parseErrorMessage (/app/node_modules/pg-protocol/dist/parser.js:285:98) at Parser.handlePacket (/app/node_modules/pg-protocol/dist/parser.js:122:29) at Parser.parse (/app/node_modules/pg-protocol/dist/parser.js:35:38) at Socket.<anonymous> (/app/node_modules/pg-protocol/dist/index.js:11:42) at Socket.emit (node:events:517:28) at addChunk (node:internal/streams/readable:368:12) at readableAddChunk (node:internal/streams/readable:341:9) at Readable.push (node:internal/streams/readable:278:10) at TCP.onStreamRead (node:internal/stream_base_commons:190:23) { length: 98, severity: 'FATAL', code: '28000', detail: undefined, hint: undefined, position: undefined, internalPosition: undefined, internalQuery: undefined, where: undefined, schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: 'miscinit.c', line: '799', routine: 'InitializeSessionUserId' } Node.js v18.20.8 ``` Is it an OIDC role issue or something on the database? Here is my docker-compose: ``` secrets: database_password: file: "./secrets/database_password.secret" oidc_client_secret: file: "./secrets/oidc_client_secret.secret" secret_key: file: "./secrets/secret_key.secret" services: planka: image: ghcr.io/plankanban/planka:2.0.0-rc.3 restart: on-failure volumes: - favicons:/app/public/favicons - user-avatars:/app/public/user-avatars - background-images:/app/public/background-images - attachments:/app/private/attachments user: 1000:1000 tmpfs: - /app/.tmp:mode=770,uid=1000,gid=1000 ports: - 3000:1337 environment: - BASE_URL=https://#######.fr - DATABASE_URL=postgresql://planka:$${DATABASE_PASSWORD}@planka-postgres-1/planka - DATABASE_PASSWORD__FILE=/run/secrets/database_password - SECRET_KEY__FILE=/run/secrets/secret_key - LOG_LEVEL=debug - DEFAULT_LANGUAGE=fr-FR - OIDC_ISSUER=https://######/realms/###### - OIDC_CLIENT_ID=###### - OIDC_CLIENT_SECRET__FILE=/run/secrets/oidc_client_secret secrets: - oidc_client_secret - database_password - secret_key networks: - proxy - planka depends_on: postgres: condition: service_healthy postgres: image: postgres:16-alpine restart: on-failure volumes: - db-data:/var/lib/postgresql/data environment: - POSTGRES_DB=planka - POSTGRES_HOST_AUTH_METHOD=trust healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres -d planka"] interval: 10s timeout: 5s retries: 5 networks: - planka volumes: favicons: user-avatars: background-images: attachments: db-data: networks: planka: internal: true proxy: external: true ``` ### Desired behavior _No response_ ### Steps to reproduce I followed the documentation here: https://docs.planka.cloud/docs/installation/docker/production-version I : - retrieved the docker-compose - edited the env variables - added my networks (the container is restarting without my networks) - created the admin with the command provided by the doc - executed the command `docker-compose up -d` - found the issue ### Other information _No response_
Author
Owner

@meltyshev commented on GitHub (Jul 30, 2025):

It seems like your DATABASE_URL doesn't match the postgres service configuration. It should probably be:

postgresql://postgres:$${DATABASE_PASSWORD}@planka-postgres-1/planka

Also, if you're providing the database password using DATABASE_PASSWORD__FILE, it looks like it should also be configured for the postgres service like this:

POSTGRES_PASSWORD_FILE=/run/secrets/db_password

So, in the end, the setup might look something like this (I haven't tested it):

secrets:
  database_password:
    file: "./secrets/database_password.secret"
  oidc_client_secret:
    file: "./secrets/oidc_client_secret.secret"
  secret_key:
    file: "./secrets/secret_key.secret"

services:
  planka:
    image: ghcr.io/plankanban/planka:2.0.0-rc.3
    restart: on-failure
    volumes:
      - favicons:/app/public/favicons
      - user-avatars:/app/public/user-avatars
      - background-images:/app/public/background-images
      - attachments:/app/private/attachments
    user: 1000:1000
    tmpfs:
      - /app/.tmp:mode=770,uid=1000,gid=1000
    ports:
      - 3000:1337
    environment:
      - BASE_URL=https://#######.fr
      - DATABASE_URL=postgresql://postgres:$${DATABASE_PASSWORD}@planka-postgres-1/planka
      - DATABASE_PASSWORD__FILE=/run/secrets/database_password
      - SECRET_KEY__FILE=/run/secrets/secret_key
      - LOG_LEVEL=debug
      - DEFAULT_LANGUAGE=fr-FR
      - OIDC_ISSUER=https://######/realms/######
      - OIDC_CLIENT_ID=######
      - OIDC_CLIENT_SECRET__FILE=/run/secrets/oidc_client_secret
    secrets:
      - oidc_client_secret
      - database_password
      - secret_key
    networks:
      - proxy
      - planka
    depends_on:
      postgres:
        condition: service_healthy

  postgres:
    image: postgres:16-alpine
    restart: on-failure
    volumes:
      - db-data:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=planka
      - POSTGRES_PASSWORD_FILE=/run/secrets/database_password
    secrets:
      - database_password
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres -d planka"]
      interval: 10s
      timeout: 5s
      retries: 5
    networks:
      - planka

volumes:
  favicons:
  user-avatars:
  background-images:
  attachments:
  db-data:

networks:
  planka:
    internal: true
  proxy:
    external: true
@meltyshev commented on GitHub (Jul 30, 2025): It seems like your `DATABASE_URL` doesn't match the `postgres` service configuration. It should probably be: ``` postgresql://postgres:$${DATABASE_PASSWORD}@planka-postgres-1/planka ``` Also, if you're providing the database password using `DATABASE_PASSWORD__FILE`, it looks like it should also be configured for the `postgres` service like this: ``` POSTGRES_PASSWORD_FILE=/run/secrets/db_password ``` So, in the end, the setup might look something like this (I haven't tested it): ``` secrets: database_password: file: "./secrets/database_password.secret" oidc_client_secret: file: "./secrets/oidc_client_secret.secret" secret_key: file: "./secrets/secret_key.secret" services: planka: image: ghcr.io/plankanban/planka:2.0.0-rc.3 restart: on-failure volumes: - favicons:/app/public/favicons - user-avatars:/app/public/user-avatars - background-images:/app/public/background-images - attachments:/app/private/attachments user: 1000:1000 tmpfs: - /app/.tmp:mode=770,uid=1000,gid=1000 ports: - 3000:1337 environment: - BASE_URL=https://#######.fr - DATABASE_URL=postgresql://postgres:$${DATABASE_PASSWORD}@planka-postgres-1/planka - DATABASE_PASSWORD__FILE=/run/secrets/database_password - SECRET_KEY__FILE=/run/secrets/secret_key - LOG_LEVEL=debug - DEFAULT_LANGUAGE=fr-FR - OIDC_ISSUER=https://######/realms/###### - OIDC_CLIENT_ID=###### - OIDC_CLIENT_SECRET__FILE=/run/secrets/oidc_client_secret secrets: - oidc_client_secret - database_password - secret_key networks: - proxy - planka depends_on: postgres: condition: service_healthy postgres: image: postgres:16-alpine restart: on-failure volumes: - db-data:/var/lib/postgresql/data environment: - POSTGRES_DB=planka - POSTGRES_PASSWORD_FILE=/run/secrets/database_password secrets: - database_password healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres -d planka"] interval: 10s timeout: 5s retries: 5 networks: - planka volumes: favicons: user-avatars: background-images: attachments: db-data: networks: planka: internal: true proxy: external: true ```
Author
Owner

@AnthonyLELUYER commented on GitHub (Aug 21, 2025):

That was it, thanks!

@AnthonyLELUYER commented on GitHub (Aug 21, 2025): That was it, thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/planka#770