Helm deployment fails due to password authentication failed for user "backend-user"
See original GitHub issueIssue
Helm deployment fails as the backend cannot access the DB Log of the backstage backend pod
(node:1) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /app/node_modules/yam
Update this package.json to use a subpath pattern like "./*".
(Use `node --trace-deprecation ...` to show where the warning was created)
2022-05-16T10:52:03.741Z backstage info Loaded config from app-config.yaml, app-config.development.yaml, env
2022-05-16T10:52:03.754Z backstage info 1 secrets found in the config which will be redacted
2022-05-16T10:52:03.773Z backstage info Created UrlReader predicateMux{readers=azure{host=dev.azure.com,authed=false},bitbucket{host=bitbucket.org,authed=false},github{host=github.com,authed=true},gitlab{host=gitlab.com,authed=false},awsS3{host=amazonaws.com,authed=false},fetch{}
Backend failed to start up, Error: Failed to connect to the database to make sure that 'backstage_plugin_catalog' exists, error: password authentication failed for user "backend-user"
and backstage-lighthouse error: password authentication failed for user "backend-user"
Log of the backstage-lighthouse pod
yarn run v1.22.4
$ node ./cjs/run.js
info: building express app... {"service":"lighthouse-audit-service","timestamp":"2022-05-16T10:53:07.570Z"}
error: password authentication failed for user "backend-user" {"name":"error","length":108,"severity":"FATAL","code":"28P01","file":"auth.c","line":"338","routin
e":"auth_failed","service":"lighthouse-audit-service","timestamp":"2022-05-16T10:53:32.486Z"}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Log of the postgresql DB reports also
2022-05-17 05:44:56.187 GMT [675] DETAIL: Role "backend-user" does not exist.
Connection matched pg_hba.conf line 1: "host all all 0.0.0.0/0 md5"
2022-05-17 05:45:08.962 GMT [690] FATAL: password authentication failed for user "backend-user"
I get the same error if I try to log on using the password of the secret
kubectl -n backstage get secret/backstage-postgresql -o jsonpath='{.data.postgres-password}' | base64 -d
gmPqVycTqv%
kubectl exec -it backstage-postgresql-0 -n backstage -c postgresql -- bash -c "psql -U backend-user --password"
Password: gmPqVycTqv
psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: FATAL: password authentication failed for user "backend-user"
command terminated with exit code 2
Database and tables created
k exec -it backstage-postgresql-0 -n backstage -c postgresql -- bash -c "PGPASSWORD=gmPqVycTqv psql -U postgres -c \"\l+\""
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges | Size | Tablespace | Description
-----------+----------+----------+-------------+-------------+-----------------------+---------+------------+--------------------------------------------
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | | 8529 kB | pg_default | default administrative connection database
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +| 8377 kB | pg_default | unmodifiable empty database
| | | | | postgres=CTc/postgres | | |
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +| 8377 kB | pg_default | default template for new databases
| | | | | postgres=CTc/postgres | | |
(3 rows)
and users
postgres=# \du
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------------------+-----------
postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
Remark: As you can see the user backend-user is not listed and this is why we cannot access the DB, tables, … and been authenticated
Steps to reproduce
kind cluster created using this bash script: https://github.com/snowdrop/k8s-infra/blob/main/kind/kind-reg-ingress.sh
npx @backstage/create-app
Name: backend
DB: postgresql
cd backend
yarn add --cwd packages/app graphql-ws
yarn build
yarn build-image -t backstage:dev
kind load docker-image backstage:dev
git clone https://github.com/backstage/backstage.git
cd contrib/chart/backstage
helm dependency update
DOMAIN_NAME="192.168.1.90.nip.io"
cat <<EOF > cfg.yml
backend:
image:
repository: backstage
tag: dev
postgresql:
service:
port: 5432
appConfig:
app:
baseUrl: https://backstage.$DOMAIN_NAME
title: Backstage
backend:
baseUrl: https://backstage.$DOMAIN_NAME
cors:
origin: https://backstage.$DOMAIN_NAME
lighthouse:
baseUrl: https://backstage.$DOMAIN_NAME/lighthouse-api
techdocs:
storageUrl: https://backstage.$DOMAIN_NAME/api/techdocs/static/docs
requestUrl: https://backstage.$DOMAIN_NAME/api/techdocs
EOF
kubectl create ns backstage
helm install -f cfg.yml -n backstage backstage .
helm uninstall backstage -n backstage
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:11 (3 by maintainers)
Top Results From Across the Web
[postgresql] bug: password authentication failed for user ...
Admin user (postgres) password fails with or without default settings. Steps to reproduce the issue: Setup a values.yaml file like below:.
Read more >password authentication failed for user "postgres" when using ...
I am able to run helm, postgresql chart ...
Read more >Using awx-operator 1.0.0 by helm chart - Google Groups
Using awx-operator 1.0.0 by helm chart - password authentication failed for user "awx". 0 views. Skip to first unread message.
Read more >Troubleshoot VMware Application Catalog Helm Charts
VMware Application Catalog Helm charts provide an easy way to ... -p 5432 psql: FATAL: password authentication failed for user "postgres".
Read more >Can't log in (helm) or reset password (#2005) · Issues - GitLab
Either authentication, inability to connect, or even just getting connections dropped. When you encounter these things, be sure to check the ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I did a new test using as chart version for posgresql
9.8.12and DB is well created, backend pod is able to access the DBIf I also deploy the frontend, that works 😃
Here is what I do to install the front and the backend
Note: I created a ticket to improve the documentation to build the frontend more easily - see #11598