Closed DBestman closed 1 month ago
I also see the follwing in the log for the addon matt-FFFFFF/hassio-addon-postgres
2024-09-12 10:02:27.258 EDT [32153] FATAL: password authentication failed for user "root"
2024-09-12 10:02:27.258 EDT [32153] DETAIL: Role "root" does not exist.
Connection matched pg_hba.conf line 99: "host all all all md5"
2024-09-12 10:02:27.324 EDT [32155] ERROR: database "TeslaMateDB" already exists
2024-09-12 10:02:27.324 EDT [32155] STATEMENT: CREATE DATABASE "TeslaMateDB"
2024-09-12 10:27:03.322 EDT [32228] FATAL: password authentication failed for user "root"
2024-09-12 10:27:03.322 EDT [32228] DETAIL: Role "root" does not exist.
Connection matched pg_hba.conf line 99: "host all all all md5"
2024-09-12 10:27:03.391 EDT [32230] ERROR: database "TeslaMateDB" already exists
2024-09-12 10:27:03.391 EDT [32230] STATEMENT: CREATE DATABASE "TeslaMateDB"
I have defined the same user in my new TeslaMate configuration as in the old:
database_user: TeslaMate
🤔 this looks like https://github.com/lildude/ha-addon-teslamate/issues/15 but I'm sure I fixed this in https://github.com/lildude/ha-addon-teslamate/pull/23.
Are you using the latest version of the addon?
Yes, I installed version 1.1.4
Could it be because in line 56 of run , DATABASE_NAME is not quoted?
if [[ -n $(PGPASSWORD="$DATABASE_PASS" psql -h "$DATABASE_HOST" -p "$DATABASE_PORT" -U "$DATABASE_USER" postgres -Atqc "\list $DATABASE_NAME") ]]; then
"Some commands take an SQL identifier (such as a table name) as argument. These arguments follow the syntax rules of SQL: Unquoted letters are forced to lowercase, while double quotes (") protect letters from case conversion and allow incorporation of whitespace into the identifier"
🤦 you're right. I fixed this in https://github.com/lildude/ha-addon-teslamate/pull/23 in one place but not in the command that checks if the DB exists.
Fixed in https://github.com/lildude/ha-addon-teslamate/pull/43 and the release I'll make once it's been merged.
Should be fixed in v1.1.5
Works now. Thanks!
I followed the steps to migrate from the old addon, but the new addon does not successfully start:
As you can see, the log indicates the database already exists, and fails trying to create it (which it shouldn't).
Did I miss something in the migration steps?
I can provide further information if required. Thanks a lot!