Error: SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string #212

Closed
opened 2026-02-04 17:52:13 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @raikoug on GitHub (Jul 14, 2022).

Hello,

this error is thrown with this composer

version: "3"
services:
  db:
      image: postgres
      restart: always
      environment:
       - "POSTGRES_USER=root"
       - "POSTGRES_PASSWORD=root"
       - "POSTGRES_DB=root"
      volumes:
       - "db-data:/var/lib/postgresql/data"
       - ./docker_postgres_init.sql:/docker-entrypoint-initdb.d/docker_postgres_init.sql
      networks:
       - docs
 
  planka:
    image: ghcr.io/plankanban/planka:latest
    command: >
      bash -c
        "for i in `seq 1 30`; do
          ./start.sh &&
          s=$$? && break || s=$$?;
          echo \"Tried $$i times. Waiting 5 seconds...\";
          sleep 5;
        done; (exit $$s)"
    restart: always
    volumes:
      - user-avatars:/app/public/user-avatars
      - project-background-images:/app/public/project-background-images
      - attachments:/app/private/attachments
    ports:
      - 11082:1337
    networks:
       - docs
    links:
       - db
    environment:
      - BASE_URL=http://planka.whatever:11082
      - TRUST_PROXY=0
      - DATABASE_URL=postgresql://planka@db/planka
      - SECRET_KEY=planka
    depends_on:
      - db

networks:
    docs:
      driver: bridge

volumes:
    db-data:
      driver: local
    user-avatars:
      driver: local
    project-background-images:
      driver: local
    attachments:
      driver: local

And this is the init.sql mentioned inside DB

CREATE USER planka WITH PASSWORD 'planka' CREATEDB;
CREATE DATABASE planka
    WITH 
    OWNER = planka
    ENCODING = 'UTF8'
    LC_COLLATE = 'en_US.utf8'
    LC_CTYPE = 'en_US.utf8'
    TABLESPACE = pg_default
    CONNECTION LIMIT = -1;

(this is a tested and common template I use for wiki js, git servers etc, and works just fine)

the error I get is

Error: SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string
    at Object.continueSession (/app/node_modules/pg/lib/sasl.js:24:11)
    at Client._handleAuthSASLContinue (/app/node_modules/pg/lib/client.js:257:10)
    at Connection.emit (node:events:527:28)
    at /app/node_modules/pg/lib/connection.js:114:12
    at Parser.parse (/app/node_modules/pg-protocol/dist/parser.js:40:17)
    at Socket.<anonymous> (/app/node_modules/pg-protocol/dist/index.js:11:42)
    at Socket.emit (node:events:527:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at Socket.Readable.push (node:internal/streams/readable:228:10)

I tried password either with or without columns, the error is the same.

Thanks

Originally created by @raikoug on GitHub (Jul 14, 2022). Hello, this error is thrown with this composer ``` version: "3" services: db: image: postgres restart: always environment: - "POSTGRES_USER=root" - "POSTGRES_PASSWORD=root" - "POSTGRES_DB=root" volumes: - "db-data:/var/lib/postgresql/data" - ./docker_postgres_init.sql:/docker-entrypoint-initdb.d/docker_postgres_init.sql networks: - docs planka: image: ghcr.io/plankanban/planka:latest command: > bash -c "for i in `seq 1 30`; do ./start.sh && s=$$? && break || s=$$?; echo \"Tried $$i times. Waiting 5 seconds...\"; sleep 5; done; (exit $$s)" restart: always volumes: - user-avatars:/app/public/user-avatars - project-background-images:/app/public/project-background-images - attachments:/app/private/attachments ports: - 11082:1337 networks: - docs links: - db environment: - BASE_URL=http://planka.whatever:11082 - TRUST_PROXY=0 - DATABASE_URL=postgresql://planka@db/planka - SECRET_KEY=planka depends_on: - db networks: docs: driver: bridge volumes: db-data: driver: local user-avatars: driver: local project-background-images: driver: local attachments: driver: local ``` And this is the init.sql mentioned inside DB ``` CREATE USER planka WITH PASSWORD 'planka' CREATEDB; CREATE DATABASE planka WITH OWNER = planka ENCODING = 'UTF8' LC_COLLATE = 'en_US.utf8' LC_CTYPE = 'en_US.utf8' TABLESPACE = pg_default CONNECTION LIMIT = -1; ``` (this is a tested and common template I use for wiki js, git servers etc, and works just fine) the error I get is ``` Error: SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string at Object.continueSession (/app/node_modules/pg/lib/sasl.js:24:11) at Client._handleAuthSASLContinue (/app/node_modules/pg/lib/client.js:257:10) at Connection.emit (node:events:527:28) at /app/node_modules/pg/lib/connection.js:114:12 at Parser.parse (/app/node_modules/pg-protocol/dist/parser.js:40:17) at Socket.<anonymous> (/app/node_modules/pg-protocol/dist/index.js:11:42) at Socket.emit (node:events:527:28) at addChunk (node:internal/streams/readable:315:12) at readableAddChunk (node:internal/streams/readable:289:9) at Socket.Readable.push (node:internal/streams/readable:228:10) ``` I tried password either with or without columns, the error is the same. Thanks
Author
Owner

@meltyshev commented on GitHub (Jul 14, 2022):

I don't know much about connecting to databases, but could you try to change the value of env variable DATABASE_URL to postgresql://planka:planka@db/planka.

@meltyshev commented on GitHub (Jul 14, 2022): I don't know much about connecting to databases, but could you try to change the value of env variable `DATABASE_URL` to `postgresql://planka:planka@db/planka`.
Author
Owner

@raikoug commented on GitHub (Jul 14, 2022):

duh now I feel dumb!
But I've a new error

error: More details (raw): TypeError [ERR_INVALID_URL]: Invalid URL
    at new NodeError (node:internal/errors:372:5)
    at URL.onParseError (node:internal/url:553:9)
    at new URL (node:internal/url:629:5)
    at Object.<anonymous> (/app/config/env/production.js:219:24)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at /app/node_modules/include-all/lib/help-include-all-sync.js:293:33
    at Array.forEach (<anonymous>)
    at _recursivelyIncludeAll (/app/node_modules/include-all/lib/help-include-all-sync.js:178:11)
    at includeAll (/app/node_modules/include-all/lib/help-include-all-sync.js:317:5)
    at helpBuildDictionary (/app/node_modules/include-all/lib/help-build-dictionary.js:46:13)
    at Function.module.exports.aggregate (/app/node_modules/include-all/index.js:101:10)

Now I think planka container can't translare "db"

Should I open a new issue?

Thanks for you reply @meltyshev

@raikoug commented on GitHub (Jul 14, 2022): duh now I feel dumb! But I've a new error ``` error: More details (raw): TypeError [ERR_INVALID_URL]: Invalid URL at new NodeError (node:internal/errors:372:5) at URL.onParseError (node:internal/url:553:9) at new URL (node:internal/url:629:5) at Object.<anonymous> (/app/config/env/production.js:219:24) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at /app/node_modules/include-all/lib/help-include-all-sync.js:293:33 at Array.forEach (<anonymous>) at _recursivelyIncludeAll (/app/node_modules/include-all/lib/help-include-all-sync.js:178:11) at includeAll (/app/node_modules/include-all/lib/help-include-all-sync.js:317:5) at helpBuildDictionary (/app/node_modules/include-all/lib/help-build-dictionary.js:46:13) at Function.module.exports.aggregate (/app/node_modules/include-all/index.js:101:10) ``` Now I think planka container can't translare "db" Should I open a new issue? Thanks for you reply @meltyshev
Author
Owner

@meltyshev commented on GitHub (Jul 14, 2022):

You are welcome!
The second error is due to the new url.URL(process.env.BASE_URL).origin, is seems that BASE_URL cannot be parsed for some reason, but when I test http://planka.whatever:11082 it works for me 🤔

@meltyshev commented on GitHub (Jul 14, 2022): You are welcome! The second error is due to the `new url.URL(process.env.BASE_URL).origin`, is seems that `BASE_URL` cannot be parsed for some reason, but when I test `http://planka.whatever:11082` it works for me 🤔
Author
Owner

@raikoug commented on GitHub (Jul 14, 2022):

Hmmm
I included an Nginx container to use my domestic dns (ahaha such a gorgeus way to call my hosts file!):
BASE_URL=http://kanban.casa
(just fo re reference, casa is home in italian XD)

Noe there is no error at all and it's working, thanks again @meltyshev for everythin, my fault both cases :/

@raikoug commented on GitHub (Jul 14, 2022): Hmmm I included an Nginx container to use my domestic dns (ahaha such a gorgeus way to call my hosts file!): `BASE_URL=http://kanban.casa` (just fo re reference, casa is home in italian XD) Noe there is no error at all and it's working, thanks again @meltyshev for everythin, my fault both cases :/
Author
Owner

@raikoug commented on GitHub (Jul 14, 2022):

Hence I close this because of my fault.

@raikoug commented on GitHub (Jul 14, 2022): Hence I close this because of my fault.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/planka#212