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

🐛 [Postgres 15] Password is not specified #1654

Open
Foshkey opened this issue Dec 4, 2024 · 6 comments
Open

🐛 [Postgres 15] Password is not specified #1654

Foshkey opened this issue Dec 4, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@Foshkey
Copy link

Foshkey commented Dec 4, 2024

Description

I'm trying to get the Postgres 15 database up and running. I've got it working in the past so I'm not sure what I'm doing wrong now. I've followed the instructions but it's resulting in "Database is uninitialized and superuser password is not specified." in the logs.

It MIGHT be related that I previously installed this add-on with a set password and then later uninstalled it (at first not wiping the config, but tried again wiping the config)

Reproduction steps

This is what I did as far as I can remember...

1. Install Postgress 15
2. Set password in Configuration, click save
3. Start the add-on
4. I had a working database at this point
5. Uninstall the add-on, DO NOT enable "Also permanently delete this addon's data"
6. Try steps 1-3 again, setting a different password
7. Password authentication with second password was not working
8. Uninstall the add-on, enabling "Also permanently delete this addon's data"
9. Repeat steps 1-3, setting a different password
10. Got the logs below

Addon Logs

Starting...
/etc/cont-init.d/00-banner.sh: executing
-----------------------------------------------------------
 Add-on: Postgres 15
 Postgres 15 with pgvecto.rs support
-----------------------------------------------------------
 Add-on version: 15.7-3
 You are running the latest version of this add-on.
 System: Home Assistant OS 14.0  (amd64 / generic-x86-64)
 Home Assistant Core: 2024.11.3
 Home Assistant Supervisor: 2024.11.4
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums
-----------------------------------------------------------
 Provided by: https://github.com/alexbelgium/hassio-addons 
-----------------------------------------------------------
/etc/cont-init.d/00-global_var.sh: executing
POSTGRES_PASSWORD=******
Timezone set from Etc/UTC to America/New_York
/etc/cont-init.d/01-config_yaml.sh: executing
Setting permissions for the config.yaml directory
Load environment variables from /config/config.yaml if existing
If accessing the file with filebrowser it should be mapped to /addon_configs/db21ed7f_postgres/config.yaml
---------------------------------------------------------
Wiki here on how to use : github.com/alexbelgium/hassio-addons/wiki/Add‐ons-feature-:-add-env-variables
... no config file, creating one from template. Please customize the file in /config/config.yaml before restarting.
... no env variables found, exiting
/etc/cont-init.d/01-custom_script.sh: executing
Execute /addon_configs/db21ed7f_postgres/postgres.sh if existing
Wiki here : github.com/alexbelgium/hassio-addons/wiki/Add-ons-feature-:-customisation
/etc/cont-init.d/20-folders.sh: executing
Starting the upstream container
[09:43:21] WARNING: A default config.env file was copied in /config. Please customize according to https://hub.docker.com/_/postgres and restart the add-on
[09:43:21] INFO: Starting the app
[09:43:21] INFO: Waiting for port 5432 to open...
Error: Database is uninitialized and superuser password is not specified.
       You must specify POSTGRES_PASSWORD to a non-empty value for the
       superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
       You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
       connections without a password. This is *not* recommended.
       See PostgreSQL documentation about "trust":
       https://www.postgresql.org/docs/current/auth-trust.html

Architecture

amd64

OS

HAos

@Foshkey Foshkey added the bug Something isn't working label Dec 4, 2024
@limmerguy
Copy link

Same issue for me on an existing HAOS install. My postgres add-on is brand new, so there shouldn't be an existing config conflict. It's as if the environmental variables are not being sent during container creation.

@alexbelgium
Copy link
Owner

Hi, perhaps my solution to capture SIGTERM leads to an issue with ENV. I'll check that

@alexbelgium
Copy link
Owner

alexbelgium commented Dec 4, 2024

Hehe now it works in -3_test, but has again the issue with database not correctly shutdown. There is no impact but I'll adapt so version -4 is both working (= solve this issue) but still has a clean database close

@limmerguy
Copy link

Thank you. I updated to the latest “_test” version and can confirm the issue has been fixed.

@alexbelgium
Copy link
Owner

Ok, version -4 is good!

@Foshkey
Copy link
Author

Foshkey commented Dec 7, 2024

Can confirm so far so good on my end!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants