expaso / hassos-addons

Home Assistant Add-ons
Apache License 2.0
51 stars 14 forks source link

User "postgres" has no password assigned. #18

Closed dschien closed 2 years ago

dschien commented 2 years ago

Hi

after upgrading to the latest version I can no longer connect to the DB. The error is User "postgres" has no password assigned. See the log below.

I have no idea how to go forward as there seems no psql client installed in Hassio.

Many thanks

-----------------------------------------------------------
 Add-on: TimescaleDB
 An open-source database built on PostgreSQL for analyzing time-series data with the power and convenience of SQL
-----------------------------------------------------------
 Add-on version: 2.0.1
 You are running the latest version of this add-on.
 System: Home Assistant OS 7.6  (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2022.4.5
 Home Assistant Supervisor: 2022.04.0
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] init.sh: executing... 
[22:52:26] INFO: done
[22:52:26] INFO: Tuning resources..
Using postgresql.conf at this path:
/data/postgres/postgresql.conf
Writing backup to:
/tmp/timescaledb_tune.backup202204182252
Recommendations based on 512.00 MB of available memory and 4 CPUs for PostgreSQL 14
max_connections = 25
timescaledb.last_tuned = '2022-04-18T22:52:26+01:00'
timescaledb.last_tuned_version = '0.12.0'
Saving changes to: /data/postgres/postgresql.conf
[22:52:26] INFO: done
[22:52:26] INFO: Applying max connections..
[22:52:27] INFO: done
[cont-init.d] init.sh: exited 0.
[cont-init.d] user.sh: executing... 
[cont-init.d] user.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[22:52:27] INFO: Starting PostgreSQL..
[22:52:27] INFO: done
2022-04-18 21:52:27.653 UTC [436] LOG:  starting PostgreSQL 14.2 on aarch64-alpine-linux-musl, compiled by gcc (Alpine 10.3.1_git20211027) 10.3.1 20211027, 64-bit
2022-04-18 21:52:27.654 UTC [436] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2022-04-18 21:52:27.655 UTC [436] LOG:  listening on IPv6 address "::", port 5432
2022-04-18 21:52:27.660 UTC [436] LOG:  listening on Unix socket "/run/postgresql/.s.PGSQL.5432"
2022-04-18 21:52:27.670 UTC [443] LOG:  database system was shut down at 2022-04-18 21:52:18 UTC
2022-04-18 21:52:27.686 UTC [436] LOG:  database system is ready to accept connections
2022-04-18 21:52:27.692 UTC [449] LOG:  TimescaleDB background worker launcher connected to shared catalogs
[22:52:28] INFO: Enabling PgAgent Extension..
NOTICE:  extension "pgagent" already exists, skipping
CREATE EXTENSION
[22:52:28] INFO: Starting PgAgent..
[22:52:28] INFO: Create database if not exist: 'homeassistant'
[22:52:28] INFO: done
[22:52:28] INFO: Enabling Timescale Extension for database: 'homeassistant'
NOTICE:  extension "timescaledb" already exists, skipping
CREATE EXTENSION
[22:52:29] INFO: Upgrading PostGIS for database: 'homeassistant'
2022-04-18 21:52:29.222 UTC [488] ERROR:  function postgis_extensions_upgrade() does not exist at character 8
2022-04-18 21:52:29.222 UTC [488] HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
2022-04-18 21:52:29.222 UTC [488] STATEMENT:  SELECT PostGIS_Extensions_Upgrade();
ERROR:  function postgis_extensions_upgrade() does not exist
LINE 1: SELECT PostGIS_Extensions_Upgrade();
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
[22:52:29] INFO: done
[22:52:29] NOTICE: TimescaleDb is running!
2022-04-18 21:52:58.116 UTC [498] FATAL:  password authentication failed for user "postgres"
2022-04-18 21:52:58.116 UTC [498] DETAIL:  User "postgres" has no password assigned.
    Connection matched pg_hba.conf line 99: "host    all             all             0.0.0.0/0               md5"
expaso commented 2 years ago

Hi @dschien ,

It looks like your upgrade stopped somewhere in the middle, and the addon was restarted during upgrade. Did you have seen any anomalies while upgrading?