expaso / hassos-addon-timescaledb

A HomeAssistant add-on containing PostgreSQL, psql client and TimeScaleDb
Apache License 2.0
51 stars 14 forks source link

Timescale DB not starting #42

Closed Tangado-Haid closed 9 months ago

Tangado-Haid commented 10 months ago

Timescale not starting after update HassIO to 11.3

` An open-source database built on PostgreSQL for analyzing time-series data with the power and convenience of SQL

Add-on version: 3.0.2 You are running the latest version of this add-on. System: Home Assistant OS 11.3 (amd64 / qemux86-64) Home Assistant Core: 2024.1.2 Home Assistant Supervisor: 2023.12.0

Please, share the above information when looking for help or support in, e.g., GitHub, forums or the Discord chat.

s6-rc: info: service base-addon-banner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service base-addon-log-level: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service base-addon-log-level successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service init-user: starting [03:59:30] INFO: Running user-init.. [03:59:30] INFO: done s6-rc: info: service init-user successfully started s6-rc: info: service init-addon: starting [03:59:30] INFO: done [03:59:30] INFO: Tuning resources.. Using postgresql.conf at this path: /data/postgres/postgresql.conf

Writing backup to: /tmp/timescaledb_tune.backup202401070359

Recommendations based on 3.82 GB of available memory and 4 CPUs for PostgreSQL 15 success: all settings tuned, no changes needed Saving changes to: /data/postgres/postgresql.conf [03:59:30] INFO: done [03:59:30] INFO: Applying max connections.. [03:59:30] INFO: done s6-rc: info: service init-addon successfully started s6-rc: info: service postgres: starting s6-rc: info: service postgres successfully started s6-rc: info: service pgagent: starting s6-rc: info: service pgagent successfully started s6-rc: info: service legacy-services: starting [03:59:30] INFO: Starting PostgreSQL.. [03:59:30] INFO: done s6-rc: info: service legacy-services successfully started 2024-01-07 02:59:30.477 UTC [235] LOG: starting PostgreSQL 15.3 on x86_64-alpine-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924, 64-bit 2024-01-07 02:59:30.477 UTC [235] LOG: listening on IPv4 address "0.0.0.0", port 5432 2024-01-07 02:59:30.477 UTC [235] LOG: listening on IPv6 address "::", port 5432 2024-01-07 02:59:30.494 UTC [235] LOG: listening on Unix socket "/run/postgresql/.s.PGSQL.5432" 2024-01-07 02:59:30.514 UTC [246] LOG: database system was shut down at 2024-01-07 02:58:50 UTC 2024-01-07 02:59:30.543 UTC [235] LOG: database system is ready to accept connections 2024-01-07 02:59:30.544 UTC [249] LOG: TimescaleDB background worker launcher connected to shared catalogs [03:59:31] INFO: Starting PgAgent.. 2024-01-07 02:59:31.465 UTC [269] ERROR: duplicate key value violates unique constraint "pga_jobagent_pkey" 2024-01-07 02:59:31.465 UTC [269] DETAIL: Key (jagpid)=(269) already exists. 2024-01-07 02:59:31.465 UTC [269] STATEMENT: INSERT INTO pgagent.pga_jobagent (jagpid, jagstation) SELECT pg_backend_pid(), '77b2833f-timescaledb' Sun Jan 7 03:59:31 2024 WARNING: pgAgent Query error: ERROR: duplicate key value violates unique constraint "pga_jobagent_pkey" DETAIL: Key (jagpid)=(269) already exists. with status: PGRES_FATAL_ERROR Connection Error: ERROR: duplicate key value violates unique constraint "pga_jobagent_pkey" DETAIL: Key (jagpid)=(269) already exists.

Sun Jan 7 03:59:31 2024 WARNING: Couldn't create the primary connection [Attempt #1] [03:59:31] INFO: Create database if not exist: 'homeassistant' [03:59:31] INFO: Create database if not exist: 'Printer' 2024-01-07 02:59:31.480 UTC [279] ERROR: database "printer" already exists 2024-01-07 02:59:31.480 UTC [279] STATEMENT: CREATE DATABASE Printer ERROR: database "printer" already exists [03:59:31] INFO: Service code-server exited with code 1 (by signal 0) s6-rc: info: service legacy-services: stopping s6-rc: info: service legacy-services successfully stopped s6-rc: info: service pgagent: stopping [03:59:31] INFO: Service code-server exited with code 256 (by signal 15) s6-rc: info: service pgagent successfully stopped s6-rc: info: service postgres: stopping s6-rc: info: service postgres successfully stopped s6-rc: info: service init-addon: stopping s6-rc: info: service init-addon successfully stopped s6-rc: info: service init-user: stopping s6-rc: info: service init-user successfully stopped s6-rc: info: service legacy-cont-init: stopping s6-rc: info: service legacy-cont-init successfully stopped s6-rc: info: service fix-attrs: stopping s6-rc: info: service base-addon-log-level: stopping s6-rc: info: service fix-attrs successfully stopped s6-rc: info: service base-addon-log-level successfully stopped s6-rc: info: service base-addon-banner: stopping s6-rc: info: service base-addon-banner successfully stopped s6-rc: info: service s6rc-oneshot-runner: stopping s6-rc: info: service s6rc-oneshot-runner successfully stopped 2024-01-07 02:59:31.524 UTC [235] LOG: received smart shutdown request 2024-01-07 02:59:31.524 UTC [249] FATAL: terminating background worker "TimescaleDB Background Worker Launcher" due to administrator command 2024-01-07 02:59:31.524 UTC [252] FATAL: terminating background worker "TimescaleDB Background Worker Scheduler" due to administrator command 2024-01-07 02:59:31.537 UTC [235] LOG: background worker "TimescaleDB Background Worker Launcher" (PID 249) exited with exit code 1 2024-01-07 02:59:31.537 UTC [235] LOG: background worker "logical replication launcher" (PID 250) exited with exit code 1 2024-01-07 02:59:31.537 UTC [235] LOG: background worker "TimescaleDB Background Worker Scheduler" (PID 252) exited with exit code 1 2024-01-07 02:59:31.537 UTC [244] LOG: shutting down 2024-01-07 02:59:31.550 UTC [244] LOG: checkpoint starting: shutdown immediate 2024-01-07 02:59:31.633 UTC [244] LOG: checkpoint complete: wrote 19 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.020 s, sync=0.026 s, total=0.097 s; sync files=17, longest=0.013 s, average=0.002 s; distance=104 kB, estimate=104 kB 2024-01-07 02:59:31.638 UTC [235] LOG: database system is shut down`

expaso commented 9 months ago

Hi! It seems like there is more: It is trying to create database 'Printer' , with capital P, while database printer (without capitals) already exists. Could you please remove the capital P from the list of databases in your addon configuration and see if it starts?

[03:59:31] INFO: Create database if not exist: 'Printer' 2024-01-07 02:59:31.480 UTC [279] ERROR: database "printer" already exists 2024-01-07 02:59:31.480 UTC [279] STATEMENT: CREATE DATABASE Printer ERROR: database "printer" already exists

Tangado-Haid commented 9 months ago

Thank you! Solved the issue..