I
Immich•3y ago
Jonathan

Using the official helm chart

I can't seem to deploy Immich with the official chart. When
postgresql:
enabled: true
postgresql:
enabled: true
and I add
common_env:
DB_PASSWORD:
valueFrom:
secretKeyRef:
name: immich-postgresql
key: password
common_env:
DB_PASSWORD:
valueFrom:
secretKeyRef:
name: immich-postgresql
key: password
as alluded to in the documentation, immich-server can't connect to the db. I've checked that the db is running and that the password is the same as the one in the server container env. I get the following error in the server container log:
[Nest] 1 - 04/03/2023, 4:39:20 AM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (2)...
98
error: password authentication failed for user "immich"
97
at Parser.parseErrorMessage (/usr/src/app/node_modules/pg-protocol/dist/parser.js:287:98)
96
at Parser.handlePacket (/usr/src/app/node_modules/pg-protocol/dist/parser.js:126:29)
95
at Parser.parse (/usr/src/app/node_modules/pg-protocol/dist/parser.js:39:38)
94
at Socket.<anonymous> (/usr/src/app/node_modules/pg-protocol/dist/index.js:11:42)
93
at Socket.emit (node:events:527:28)
92
at addChunk (node:internal/streams/readable:315:12)
91
at readableAddChunk (node:internal/streams/readable:289:9)
90
at Socket.Readable.push (node:internal/streams/readable:228:10)
89
at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
[Nest] 1 - 04/03/2023, 4:39:20 AM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (2)...
98
error: password authentication failed for user "immich"
97
at Parser.parseErrorMessage (/usr/src/app/node_modules/pg-protocol/dist/parser.js:287:98)
96
at Parser.handlePacket (/usr/src/app/node_modules/pg-protocol/dist/parser.js:126:29)
95
at Parser.parse (/usr/src/app/node_modules/pg-protocol/dist/parser.js:39:38)
94
at Socket.<anonymous> (/usr/src/app/node_modules/pg-protocol/dist/index.js:11:42)
93
at Socket.emit (node:events:527:28)
92
at addChunk (node:internal/streams/readable:315:12)
91
at readableAddChunk (node:internal/streams/readable:289:9)
90
at Socket.Readable.push (node:internal/streams/readable:228:10)
89
at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
and the following in the postgres container log:
2023-04-03 04:34:27.940 GMT [463] DETAIL: Connection matched pg_hba.conf line 1: "host all all 0.0.0.0/0 md5"
2023-04-03 04:34:28.102 GMT [478] FATAL: password authentication failed for user "immich"
2023-04-03 04:34:27.940 GMT [463] DETAIL: Connection matched pg_hba.conf line 1: "host all all 0.0.0.0/0 md5"
2023-04-03 04:34:28.102 GMT [478] FATAL: password authentication failed for user "immich"
Any idea what the issue is? My values.yaml file is here: https://github.com/Jsakkos/k3s-homelab/blob/master/apps/immich/values.yaml
GitHub
k3s-homelab/values.yaml at master · Jsakkos/k3s-homelab
Modern self-hosting framework, fully automated from empty disk to operating services with a single command. - k3s-homelab/values.yaml at master · Jsakkos/k3s-homelab
10 Replies
bo0tzz
bo0tzz•3y ago
You need to pass the password to postgres under the postgresql key as well
Jonathan
JonathanOP•3y ago
Like this?
postgresql:
enabled: true
global:
postgresql:
auth:
existingSecret: immich-secrets
postgresql:
enabled: true
global:
postgresql:
auth:
existingSecret: immich-secrets
Where immich-secrets contains
- secretKey: postgres-password
remoteRef:
key: /immich/
property: POSTGRES_SUPER_PASS
- secretKey: password
remoteRef:
key: /immich/
property: DB_PASSWORD
- secretKey: postgres-password
remoteRef:
key: /immich/
property: POSTGRES_SUPER_PASS
- secretKey: password
remoteRef:
key: /immich/
property: DB_PASSWORD
bo0tzz
bo0tzz•3y ago
Looks about right yes
Jonathan
JonathanOP•3y ago
Still same issue, unfortunately. Auth failed. I checked and both have the same password for the immich user
bo0tzz
bo0tzz•3y ago
The postgres db has probably been initialised with the default password at this point, so you'll need to delete and recreate its volume
Jonathan
JonathanOP•3y ago
I've been deleting the entire deployment from the ArgoCD UI each time I've made changes like this. Is there something additional I should do to make sure the old db gets deleted?
bo0tzz
bo0tzz•3y ago
If the volume is certainly being deleted, then probably not Check the env vars on the deployed pods to make sure they all match
Jonathan
JonathanOP•3y ago
Postgres:
BITNAMI_DEBUG : false
PGDATA : /bitnami/postgresql/data
POSTGRESQL_CLIENT_MIN_MESSAGES : error
POSTGRESQL_ENABLE_LDAP : no
POSTGRESQL_ENABLE_TLS : no
POSTGRESQL_LOG_CONNECTIONS : false
POSTGRESQL_LOG_DISCONNECTIONS : false
POSTGRESQL_LOG_HOSTNAME : false
POSTGRESQL_PGAUDIT_LOG_CATALOG : off
POSTGRESQL_PORT_NUMBER : 5432
POSTGRESQL_SHARED_PRELOAD_LIBRARIES : pgaudit
POSTGRESQL_VOLUME_DIR : /bitnami/postgresql
POSTGRES_DB : immich
POSTGRES_PASSWORD : secretKeyRef(immich-secrets.password)
POSTGRES_POSTGRES_PASSWORD : secretKeyRef(immich-secrets.postgres-password)
POSTGRES_USER : immich
BITNAMI_DEBUG : false
PGDATA : /bitnami/postgresql/data
POSTGRESQL_CLIENT_MIN_MESSAGES : error
POSTGRESQL_ENABLE_LDAP : no
POSTGRESQL_ENABLE_TLS : no
POSTGRESQL_LOG_CONNECTIONS : false
POSTGRESQL_LOG_DISCONNECTIONS : false
POSTGRESQL_LOG_HOSTNAME : false
POSTGRESQL_PGAUDIT_LOG_CATALOG : off
POSTGRESQL_PORT_NUMBER : 5432
POSTGRESQL_SHARED_PRELOAD_LIBRARIES : pgaudit
POSTGRESQL_VOLUME_DIR : /bitnami/postgresql
POSTGRES_DB : immich
POSTGRES_PASSWORD : secretKeyRef(immich-secrets.password)
POSTGRES_POSTGRES_PASSWORD : secretKeyRef(immich-secrets.postgres-password)
POSTGRES_USER : immich
Server:
DB_DATABASE_NAME : immich
DB_HOSTNAME : immich-postgresql
DB_PASSWORD : secretKeyRef(immich-secrets.password)
DB_USERNAME : immich
ENABLE_MAPBOX : false
JWT_SECRET : secretKeyRef(immich-secrets.JWT_SECRET)
MAPBOX_KEY :
NODE_ENV : production
REDIS_HOSTNAME : immich-redis-master
DB_DATABASE_NAME : immich
DB_HOSTNAME : immich-postgresql
DB_PASSWORD : secretKeyRef(immich-secrets.password)
DB_USERNAME : immich
ENABLE_MAPBOX : false
JWT_SECRET : secretKeyRef(immich-secrets.JWT_SECRET)
MAPBOX_KEY :
NODE_ENV : production
REDIS_HOSTNAME : immich-redis-master
POSTGRES_PASSWORD matched DB_PASSWORD Actually, it looks like the PVC had not been deleted, even though I was deleting the whole deployment. That fixed the issue, thanks!
jrasm91
jrasm91•3y ago
Yeah, it's pretty common for volumes to be persisted between container deletes are restarts 🙂 Otherwise pgdata would also probably be deleted and that's where all your immich (meta)data is stored
bo0tzz
bo0tzz•3y ago
This is on kubernetes where the behaviour is a bit more varied ;)

Did you find this page helpful?