Hello everyone,
I am quite new to this world and I know that this thread is a little bit long, my apologize.
I started working with Portainer a few months ago and everything was working fine until yesterday, when I experienced a power outage due to a blackout.
In fact, the SQLite database inside HA has been corrupted and the following message appeared in the HA log file:
“The system failed to verify that the sqlite3 database at //config/home-assistant_v2-db was shut down properly”.
The result was an automatic update to the latest version and HA was restarted completely to the onbarding page.
I tried to repair the corrupted database with sqlitebrowser without success, so I cannot try to use Pragma statements.
After that, I initialized the system again, starting from the KNX entities from the HA page, and I need to configure the KNX thermostat via the climate statement declared in configuration.yaml.
With my disappointment, after the reboot I can’t see the thermostat in my dashboard and I don’t understand why.
So I moved on to another point: inside the same HA stack I added the MariaDB container and the adminer. The scope was not to use SQLite inside the project, but other external supported databases. I tried to ping from the HA container to the MariaDB container via their IP with success, but I didn’t see anything in the log files, apart from the administrator’s intentional login error. I successfully accessed the schema.
This is my configuration.yaml
#########
Loads default set of integrations. Do not remove.
default_config:
Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
knx:
climate:
- name: "Termostato1"
temperature_address: "4/0/7"
target_temperature_state_address: "4/0/5"
setpoint_shift_address: "4/0/4"
setpoint_shift_state_address: "4/0/6"
target_temperature_address: "4/0/59"
humidity_state_address: "4/1/2"
setpoint_shift_max: 2
setpoint_shift_min: -2
recorder:
purge_keep_days: 30
db_url: "mysql://homeassistant:[email protected]/ha_database?charset=utf8mb4"
#############
172.25.0.3 is the IP of Mariadb container
172.25.0.2 is the IP of HA container
In previous HA version I had Termostato1 in a specific badge/card, now it’s declared but not seen in dashboard.
Before write here i tried to rename configuration.yaml adding .old extension, the system had recreate basic configuration.yaml
#### portainer stack editor about HA,mariadb
services:
homeassistant:
container_name: homeassistant
image: "ghcr.io/home-assistant/home-assistant:stable"
volumes:
- /Volume1/DockerAppsData/HomeAssistant/config:/config
- /etc/localtime:/etc/localtime:ro
restart: unless-stopped
privileged: true
network_mode: host
db:
image: mariadb
restart: always
environment:
MYSQL_ROOT_PASSWORD: ***
MYSQL_DATABASE: ha_database
MYSQL_USER: homeassistant
MYSQL_PASSWORD: ***
PUID: 1000
PGID: 1000
volumes:
- /Volume1/DockerAppsData/mariadb:/etc/mysql/conf.d
ports:
- 3306:3306
adminer:
image: adminer
restart: always
ports:
- 8180:8080
#####
Someone could help me to understand how to have newly an HA docker system working fine?