Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

❓ [immich] Does not connect to postgress 'FATAL: password authentication failed for user "postgres"' #1614

Open
JzBrevis opened this issue Oct 20, 2024 · 7 comments
Labels
prevent stale Prevents stale being applied

Comments

@JzBrevis
Copy link

JzBrevis commented Oct 20, 2024

The postgres addon is working. I can connect to it with the set password from a client.

immich can't connect to it, the password I set in the config is the same one that works in the client but it seems to not be used.

Already tried setting the password in config/addon_config/immich/config.yaml, but it makes no difference.

Log when starting immich:
(<redacted> is the actual password and jwt token I set)

-----------------------------------------------------------
 Add-on: Immich
 Self-hosted photo and video backup solution directly from your mobile phone
-----------------------------------------------------------
 Add-on version: 1.118.2
 You are running the latest version of this add-on.
 System: Home Assistant OS 13.1  (amd64 / generic-x86-64)
 Home Assistant Core: 2024.10.3
 Home Assistant Supervisor: 2024.10.2
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums
-----------------------------------------------------------
 Provided by: https://github.com/alexbelgium/hassio-addons 
-----------------------------------------------------------
 Defining permissions for main user : 
User UID: 1000
User GID : 1000
-----------------------------------------------------------
/etc/cont-init.d/00-global_var.sh: executing
DB_DATABASE_NAME='immich'
DB_HOSTNAME='db21ed7f-postgres'
DB_PASSWORD=******
DB_PORT='5432'
DB_USERNAME='postgres'
DISABLE_MACHINE_LEARNING='false'
JWT_SECRET='<redacted>'
PGID='1000'
PUID='1000'
TZ='Europe/Paris'
data_location='/share/immich'
/etc/cont-init.d/00-local_mounts.sh: executing
/etc/cont-init.d/00-smb_mounts.sh: executing
/etc/cont-init.d/01-config_yaml.sh: executing
Setting permissions for the config.yaml directory

Load environment variables from /config/addons_config/immich/config.yaml if existing
If accessing the file with filebrowser it should be mapped to /homeassistant/addons_config/immich/config.yaml
---------------------------------------------------------
Wiki here on how to use : github.com/alexbelgium/hassio-addons/wiki/Add‐ons-feature-:-add-env-variables

DB_PASSWORD='<redacted>'
/etc/cont-init.d/01-custom_script.sh: executing
Execute /homeassistant/addons_autoscripts/immich.sh if existing
Wiki here : github.com/alexbelgium/hassio-addons/wiki/Add-ons-feature-:-customisation
/etc/cont-init.d/20-folders.sh: executing
[00:19:38] INFO: Setting data location
... check /share/immich folder exists
... setting permissions
... correcting official script
/etc/cont-init.d/99-run.sh: executing
[00:19:38] INFO: Setting variables
DB_DATABASE_NAME='immich'
DB_HOSTNAME='db21ed7f-postgres'
DB_PASSWORD=******
DB_PORT='5432'
DB_USERNAME='postgres'
DISABLE_MACHINE_LEARNING='false'
JWT_SECRET='<redacted>'
PGID='1000'
PUID='1000'
TZ='Europe/Paris'
data_location='/share/immich'
[00:19:38] INFO: Defining database
[00:19:38] INFO: -----------------
[00:19:38] INFO: Connecting to external postgresql
[00:19:38] INFO: 
psql: error: connection to server at "db21ed7f-postgres" (172.30.33.5), port 5432 failed: FATAL:  password authentication failed for user "postgres"
 
Starting the upstream container
 
[mod-init] Running Docker Modification Logic
[mod-init] Adding imagegenius/mods:universal-redis to container
[mod-init] Downloading imagegenius/mods:universal-redis from registry-1.docker.io
[mod-init] Installing imagegenius/mods:universal-redis
[mod-init] imagegenius/mods:universal-redis applied to container
[migrations] started
[migrations] no migrations found

╔═══════════════════════════════╗
       __  _____ _____       __
      / / |_   _/ ____|     / /
     / /    | || |  __     / /
    / /     | || | |_ |   / /
   / /     _| || |__| |  / /
  /_/     |_____\_____| /_/

  Baseimage from linuxserver.io
╠═══════════════════════════════╣
  User/Group ID:
  User UID: 1000
  User GID: 1000
╚═══════════════════════════════╝
@JzBrevis JzBrevis added the prevent stale Prevents stale being applied label Oct 20, 2024
@yvos
Copy link

yvos commented Oct 26, 2024

Hi,

I have the same issue trying to get TeslaMate running. I have set the POSTGRES_PASSWORD in the configuration. Also tried setting the username but it didn't matter.

2024-10-26 13:25:30.119 CEST [299] FATAL: password authentication failed for user "postgres"
2024-10-26 13:25:30.119 CEST [299] DETAIL: Connection matched pg_hba.conf line 100: "host all all all scram-sha-256"

@alexbelgium
Copy link
Owner

Hi, I think that postgres's password can't be changed after running it once. You could try with the default password, homeassistant

@JzBrevis
Copy link
Author

Hi, I think that postgres's password can't be changed after running it once. You could try with the default password, homeassistant

At least for me, postgres is using the correct password. I confirmed this by connecting with my own client, which only works with the expected password

@JzBrevis
Copy link
Author

JzBrevis commented Oct 26, 2024

I got it to work now by resetting the postgres addon and setting it up with the default password. If I do that, the immich addon is able to connect to postgres.

@JzBrevis
Copy link
Author

I repeated the same process, now using a different password without special characters, this is working. The previous, unusable password contained the '!' and '%' characters.

@yvos
Copy link

yvos commented Oct 27, 2024

Yes! Resetting the add-on and using the default pw worked for me too.

@alexbelgium
Copy link
Owner

alexbelgium commented Oct 27, 2024

Thanks very much ! Perhaps it's an issue with characters escape. I'll look if I can do something. I think it's also due to how HA manages strings (with " and not ')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prevent stale Prevents stale being applied
Projects
None yet
Development

No branches or pull requests

3 participants