mirror of
https://github.com/plankanban/planka.git
synced 2026-02-25 03:14:50 +03:00
Error('SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string') #286
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Arturo-Penas-Rial on GitHub (Feb 3, 2023).
Hi all, I need your help! Thanks in advance ...
During the Planka installation I execute:
But an error occurs:
➜ planka npm run server:db:init > err
/var/www/planka/server/node_modules/pg/lib/sasl.js:24
throw new Error('SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string')
^
Error: SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string
at Object.continueSession (/var/www/planka/server/node_modules/pg/lib/sasl.js:24:11)
at Client._handleAuthSASLContinue (/var/www/planka/server/node_modules/pg/lib/client.js:257:10)
at Connection.emit (node:events:512:28)
at /var/www/planka/server/node_modules/pg/lib/connection.js:114:12
at Parser.parse (/var/www/planka/server/node_modules/pg-protocol/dist/parser.js:40:17)
at Socket. (/var/www/planka/server/node_modules/pg-protocol/dist/index.js:11:42)
at Socket.emit (node:events:512:28)
at addChunk (node:internal/streams/readable:324:12)
at readableAddChunk (node:internal/streams/readable:297:9)
at Readable.push (node:interthe dabanal/streams/readable:234:10)
Node.js v19.6.0
The procedure to install PostgreSQL was:
$ sudo apt install postgresql postgresql-contrib postgresql-client
$ sudo systemctl start postgresql.service
$ systemctl status postgresql
$ su - postgres -c "createuser -P planka"
$ su - postgres -c "createdb -O planka planka"
$ sudo adduser planka
$ sudo vi /etc/postgresql/14/main/pg_hba.conf
# Add the following lines ...
host all all all
local planka planka password
local all postgres peer
$ sudo vi /etc/postgresql/14/main/postgresql.conf
# Add the following line ...
listen_addresses = '*'
$ systemctl reload postgresql
@meltyshev Can you help me to solve this issue?
@meltyshev commented on GitHub (Feb 6, 2023):
Good evening! I can assume that maybe you forgot to create an
server/.envfile. Or you have something missing in theDATABASE_URLthere.I recently corrected the installation instructions: https://github.com/plankanban/planka#2-without-docker.
@threedotsonedash commented on GitHub (Feb 21, 2023):
@Arturo-Penas-Rial
You need to edit .env file in /var/www/planka/server/ to include the db password, by default it was blank for me.
i.e
DATABASE_URL=postgresql://user:password@localhost/planka@eternity1984 commented on GitHub (Mar 31, 2023):
Same for me.
I have tried including the password in the DATABASE_URL, but as reported in https://github.com/balderdashy/sails/issues/7173, it does not work properly with complex passwords.
Also, I tried edit ./server/config/datastores.js as follows, but does not work properly either.
https://github.com/alxndrsn/sails-postgresql#usage-with-unix-sockets
It would be great if unix domain sockets could be used.
Thanks in advance.
@tricoos commented on GitHub (Jan 8, 2024):
This essentially looks like a bug in Planka (or in the docker-compose files, respectively), because of this:
The Postgres Docker file at https://github.com/plankanban/planka/blob/master/docker-compose-db.yml contains this:
POSTGRES_HOST_AUTH_METHOD=trustThis means according to https://hub.docker.com/_/postgres :
"This optional variable can be used to control the auth-method for host connections for all databases, all users, and all addresses. If unspecified then scram-sha-256 password authentication is used"
So we might assume that with this file Planka should be fine if the database server only requires a username and not a password, as can be seen in https://github.com/plankanban/planka/blob/master/docker-compose.yml :
DATABASE_URL=postgresql://postgres@postgres/plankaBased on these two files Planka should work out-of-the-box with the configuration and it did for some time. Only when I updated the container lately it failed with the message above.
It looks to me like an "if" might be missing somwehere because it should not require a password here, but the SASL code fails because that one requires one.
This means that I would assume that out of the box the current Planka installation using the Docker Compose files linked above will not work anymore, but it worked previously, so for me this is definitely a bug.
Also, when I enter the Postgres Docker container it shows the setting applied:
So it is definitely not Postgres refusing the access, but Planka not working anymore with the default "trust all" configuration in the docker-compose files in this repository. This should be fixed.
@tricoos commented on GitHub (Jan 9, 2024):
As an addition to my previous comment: I simply added pgadmin to my docker-compose and I was able to login to Postgres with the user name "postgres" and no password, so this is clearly not a Postgres issue like where Postgres does not honor the
POSTGRES_HOST_AUTH_METHOD=trustsetting.Please fix this.
@MichalisDBA commented on GitHub (Oct 1, 2024):
Same problem here. How to fix it?
@cachho commented on GitHub (Jan 20, 2025):
Same problem here, the docs don't mention a required
.envfile, I'm starting from the example docker-compose, all I did is change the password for the admin user and the secret key (and add it to my network).@cachho commented on GitHub (Jan 21, 2025):
Sharing how I ended up fixing it, but my setup is a little more complicated because it includes a network with other services.
Fixed it by creating
stack.env, (because I use portainer, you may just call it.env), in which I stored:POSTGRES_PASSWORD=secret,then adding it to both containers with
env_file: stack.envindocker-compose.yml, remove- POSTGRES_HOST_AUTH_METHOD=trustfrom postgres and changing theDATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/plankain planka@aixtools commented on GitHub (Mar 11, 2025):
So, i thought I followed the instructions - exactly (as I tried, as much as possible to copy from instructions and paste to command-line (manual installation).
What I saw in the instructions was something such as 'cd server' but the zip file fetched for the installation just put everything in /var/www/planka (not /var/www/planka/server) - hence the slight difference in my output.
Note: this is running as user
plankaI did edit the .env file, only adding a secretkey - the reset of the file is commented out - except for the TZ at the end of the file.
fyi: in .env I have something like:
SECRET_KEY='b5583e260579e221cfaed55b90dbc67349d...5ce8eb500736edaf82aad42496973482b5c18c4b86f', i.e., between single-quotes to ensure it is read as a string. (first time no single-quotes).The
bugmight be the installation instructions - I did most of it as root - so I continually used chown -R planka:planka /var/www/planka to ensure all files were owned by planka, and not by root or an unknown userid.And - I am assuming, with a different hostname, it can run on a server with other services on port 443. If not, I'll continue to look - BUT - a page describing port customization would also be appreciated.
@aixtools commented on GitHub (Mar 12, 2025):
I'm guessing this happens after line 184 gets called, and I don't want to understand it - I'm just trying to get it installed for the actual user.
from
./node_modules/pg/lib/client.js:So, guessing here - there doesn't seem to be a password configured - and 'this.password` is likely a function (so not a string)
@kennyrosser commented on GitHub (Apr 18, 2025):
I ran into this same issue and following @cachho advice above I made some changes to my docker-compose.yml and .env files and got it to work. I ended needing to:
DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres-planka:5432/plankaIn the end, my yml file looks like this now. I hope this helps anyone else running into this bug.