MyElectricalData / myelectricaldata_import

132 stars 35 forks source link

[BUG] - database is locked #476

Closed cosygarcia closed 7 months ago

cosygarcia commented 8 months ago

Bonjour,

voici le problème rencontré :

Description du bug J'ai mis à jour l'addon de la version 0.9.1 à la 0.9.3.

Configuration (config.yaml) ``` cycle: 3600 debug: false home_assistant: discovery_prefix: homeassistant enable: true discovery: true card_myenedis: true influxdb: #bucket: "DATABASE/RETENTION" bucket: "homeassistant/autogen" enable: true hostname: addon_a0d7b954_influxdb method: synchronous org: "-" port: 8086 #token: USERNAME:PASSWORD token: homeassistant:******** log2file: false mqtt: client_id: myelectricaldata enable: true hostname: core-mosquitto password: '**********' port: 1883 prefix: myelectricaldata qos: 0 retain: true username: 'mqttuser' myelectricaldata: "XXXXXXXXXXXXXXX": activation_date_daily: '' activation_date_detail: '' cache: false consumption: true consumption_detail: true consumption_detail_max_date: '2023-09-01' consumption_max_date: '2023-09-01' consumption_price_base: '0.2276' consumption_price_hc: '0.1828' consumption_price_hp: '0.2460' enable: true name: 'Maison' #offpeak_hours: '22H56-6H56' offpeak_hours_0: '22H56-6H56' offpeak_hours_1: '22H56-6H56' offpeak_hours_2: '22H56-6H56' offpeak_hours_3: '22H56-6H56' offpeak_hours_4: '22H56-6H56' offpeak_hours_5: '22H56-6H56' offpeak_hours_6: '22H56-6H56' plan: HC/HP #production: false #production_detail: false #production_detail_max_date: '' #production_max_date: '' #production_price: 0 refresh_addresse: false refresh_contract: false #token: "xxxxxxxxxx" token: "xxxxxxxxxxxx" tempo: enable: false price_blue_hc: 0.097 price_blue_hp: 0.1249 price_red_hc: 0.1216 price_red_hp: 0.6712 price_white_hc: 0.114 price_white_hp: 0.1508 ```

Type d'installation

System Information

version core-2024.1.5
installation_type Home Assistant Supervised
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.11.6
os_name Linux
os_version 5.10.0-27-arm64
arch aarch64
timezone Europe/Paris
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 1009 Installed Version | 1.34.0 Stage | running Available Repositories | 1384 Downloaded Repositories | 10
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Debian GNU/Linux 11 (bullseye) -- | -- update_channel | stable supervisor_version | supervisor-2023.12.1 agent_version | 1.6.0 docker_version | 24.0.7 disk_total | 59.9 GB disk_used | 45.0 GB healthy | true supported | true supervisor_api | ok version_api | ok installed_addons | SQLite Web (4.1.0), Terminal & SSH (9.8.1), InfluxDB (5.0.0), Mosquitto broker (6.4.0), File editor (5.6.0), MyElectricalData (0.9.3)
Dashboards dashboards | 1 -- | -- resources | 5 views | 5 mode | storage
Recorder oldest_recorder_run | 21 janvier 2024 à 18:22 -- | -- current_recorder_run | 31 janvier 2024 à 16:15 estimated_db_size | 2365.34 MiB database_engine | sqlite database_version | 3.41.2

Logs :

Starting...
/etc/cont-init.d/00-banner.sh: executing

-----------------------------------------------------------
 Add-on: MyElectricalData
 Use Enedis Gateway API to send data in your MQTT Broker (latest channel)
-----------------------------------------------------------
 Add-on version: 0.9.3
 You are running the latest version of this add-on.
 System: Debian GNU/Linux 11 (bullseye)  (aarch64 / qemuarm-64)
 Home Assistant Core: 2024.1.5
 Home Assistant Supervisor: 2023.12.1
-----------------------------------------------------------
 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
CONFIG_LOCATION='/config/myelectricaldata/config.yaml'
TZ='Europe/Paris'
mqtt_autodiscover='true'
verbose='true'
/etc/cont-init.d/01-config_yaml.sh: executing
Setting permissions for the config.yaml directory

Load environment variables from /config/myelectricaldata/config.yaml if existing
If accessing the file with filebrowser it should be mapped to /homeassistant/addons_config/enedisgateway2mqtt/config.yaml
---------------------------------------------------------
Wiki here on how to use : github.com/alexbelgium/hassio-addons/wiki/Add‐ons-feature-:-add-env-variables
cycle='3600'
debug='false'
home_assistant_discovery_prefix='homeassistant'
home_assistant_enable='true'
home_assistant_discovery='true'
home_assistant_card_myenedis='true'
influxdb_bucket='homeassistant/autogen'
influxdb_enable='true'
influxdb_hostname='addon_a0d7b954_influxdb'
influxdb_method='synchronous'
influxdb_org='-'
influxdb_port='8086'
influxdb_token='homeassistant:*******'
log2file='false'
mqtt_client_id='myelectricaldata'
mqtt_enable='true'
mqtt_hostname='core-mosquitto'
mqtt_password='**********'
mqtt_port='1883'
mqtt_prefix='myelectricaldata'
mqtt_qos='0'
mqtt_retain='true'
mqtt_username='mqttuser'
myelectricaldata__cache='false'
myelectricaldata__consumption='true'
myelectricaldata__consumption_detail='true'
myelectricaldata__consumption_detail_max_date='2023-09-01'
myelectricaldata__consumption_max_date='2023-09-01'
myelectricaldata__consumption_price_base='0.2276'
myelectricaldata__consumption_price_hc='0.1828'
myelectricaldata__consumption_price_hp='0.2460'
myelectricaldata__enable='true'
myelectricaldata__name='Maison'
myelectricaldata__offpeak_hours_0='22H56-6H56'
myelectricaldata__offpeak_hours_1='22H56-6H56'
myelectricaldata__offpeak_hours_2='22H56-6H56'
myelectricaldata__offpeak_hours_3='22H56-6H56'
myelectricaldata__offpeak_hours_4='22H56-6H56'
myelectricaldata__offpeak_hours_5='22H56-6H56'
myelectricaldata__offpeak_hours_6='22H56-6H56'
myelectricaldata__plan='HC/HP'
myelectricaldata__refresh_addresse='false'
myelectricaldata__refresh_contract='false'
myelectricaldata__token='xxxxxxxxx'
tempo_enable='false'
tempo_price_blue_hc='0.097'
tempo_price_blue_hp='0.1249'
tempo_price_red_hc='0.1216'
tempo_price_red_hp='0.6712'
tempo_price_white_hc='0.114'
tempo_price_white_hp='0.1508'
/etc/cont-init.d/01-custom_script.sh: executing
Execute /config/addons_autoscripts/enedisgateway2mqtt.sh if existing
---------------------------------------------------------
If accessing the file with filebrowser it should be mapped to /config/addons_autoscripts/enedisgateway2mqtt.sh
Wiki here : github.com/alexbelgium/hassio-addons/wiki/Add-ons-feature-:-customisation
... no script found, exiting
/etc/cont-init.d/32-nginx_ingress.sh: executing
/etc/cont-init.d/91-mqtt_autodiscover.sh: executing
[16:25:57] INFO: mqtt_autodiscover is defined in options, attempting autodiscovery...
[16:25:58] INFO: ... MQTT service found, fetching server detail (you can enter those manually in your config file) ...
MQTT_HOST=core-mosquitto
MQTT_PORT=1883
MQTT_SSL=false
MQTT_USERNAME=addons
MQTT_PASSWORD=xxxxxxxxxxx
/etc/cont-init.d/99-run.sh: executing
creating symlink
[16:25:58] INFO: Using database file found in /config/myelectricaldata
[16:25:58] INFO: Using config file found in /config/myelectricaldata/config.yaml
Config file is a valid yaml

[16:25:59] INFO: Starting nginx

[16:25:59] INFO: Starting the app

2024-01-31 16:26:02.774 -     INFO : Display configuration :
2024-01-31 16:26:02.774 -     INFO :   cycle: 3600
2024-01-31 16:26:02.774 -     INFO :   debug: False
2024-01-31 16:26:02.774 -     INFO :   home_assistant:
2024-01-31 16:26:02.775 -     INFO :     discovery_prefix: homeassistant
2024-01-31 16:26:02.775 -     INFO :     enable: True
2024-01-31 16:26:02.775 -     INFO :     discovery: True
2024-01-31 16:26:02.775 -     INFO :     card_myenedis: True
2024-01-31 16:26:02.775 -     INFO :   influxdb:
2024-01-31 16:26:02.775 -     INFO :     bucket: homeassistant/autogen
2024-01-31 16:26:02.775 -     INFO :     enable: True
2024-01-31 16:26:02.775 -     INFO :     hostname: addon_a0d7b954_influxdb
2024-01-31 16:26:02.775 -     INFO :     method: synchronous
2024-01-31 16:26:02.775 -     INFO :     org: -
2024-01-31 16:26:02.775 -     INFO :     port: 8086
2024-01-31 16:26:02.775 -     INFO :     token: ** hidden **
2024-01-31 16:26:02.776 -     INFO :   log2file: False
2024-01-31 16:26:02.776 -     INFO :   mqtt:
2024-01-31 16:26:02.776 -     INFO :     client_id: myelectricaldata
2024-01-31 16:26:02.776 -     INFO :     enable: True
2024-01-31 16:26:02.776 -     INFO :     hostname: core-mosquitto
2024-01-31 16:26:02.776 -     INFO :     password: ** hidden **
2024-01-31 16:26:02.776 -     INFO :     port: 1883
2024-01-31 16:26:02.776 -     INFO :     prefix: myelectricaldata
2024-01-31 16:26:02.776 -     INFO :     qos: 0
2024-01-31 16:26:02.776 -     INFO :     retain: True
2024-01-31 16:26:02.777 -     INFO :     username: mqttuser
2024-01-31 16:26:02.777 -     INFO :   myelectricaldata:
2024-01-31 16:26:02.777 -     INFO :     xxxxxxxxxxxxxxxx:
2024-01-31 16:26:02.777 -     INFO :       activation_date_daily:
2024-01-31 16:26:02.777 -     INFO :       activation_date_detail:
2024-01-31 16:26:02.777 -     INFO :       cache: False
2024-01-31 16:26:02.777 -     INFO :       consumption: True
2024-01-31 16:26:02.777 -     INFO :       consumption_detail: True
2024-01-31 16:26:02.777 -     INFO :       consumption_detail_max_date: 2023-09-01
2024-01-31 16:26:02.777 -     INFO :       consumption_max_date: 2023-09-01
2024-01-31 16:26:02.778 -     INFO :       consumption_price_base: 0.2276
2024-01-31 16:26:02.778 -     INFO :       consumption_price_hc: 0.1828
2024-01-31 16:26:02.778 -     INFO :       consumption_price_hp: 0.2460
2024-01-31 16:26:02.778 -     INFO :       enable: True
2024-01-31 16:26:02.778 -     INFO :       name: Maison
2024-01-31 16:26:02.778 -     INFO :       offpeak_hours_0: 22H56-6H56
2024-01-31 16:26:02.778 -     INFO :       offpeak_hours_1: 22H56-6H56
2024-01-31 16:26:02.778 -     INFO :       offpeak_hours_2: 22H56-6H56
2024-01-31 16:26:02.778 -     INFO :       offpeak_hours_3: 22H56-6H56
2024-01-31 16:26:02.778 -     INFO :       offpeak_hours_4: 22H56-6H56
2024-01-31 16:26:02.778 -     INFO :       offpeak_hours_5: 22H56-6H56
2024-01-31 16:26:02.778 -     INFO :       offpeak_hours_6: 22H56-6H56
2024-01-31 16:26:02.780 -     INFO :       plan: HC/HP
2024-01-31 16:26:02.780 -     INFO :       refresh_addresse: False
2024-01-31 16:26:02.780 -     INFO :       refresh_contract: False
2024-01-31 16:26:02.780 -     INFO :       token: ** hidden **
2024-01-31 16:26:02.780 -     INFO :   tempo:
2024-01-31 16:26:02.780 -     INFO :     enable: False
2024-01-31 16:26:02.780 -     INFO :     price_blue_hc: 0.097
2024-01-31 16:26:02.780 -     INFO :     price_blue_hp: 0.1249
2024-01-31 16:26:02.780 -     INFO :     price_red_hc: 0.1216
2024-01-31 16:26:02.781 -     INFO :     price_red_hp: 0.6712
2024-01-31 16:26:02.781 -     INFO :     price_white_hc: 0.114
2024-01-31 16:26:02.781 -     INFO :     price_white_hp: 0.1508
2024-01-31 16:26:02.781 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:26:02.781 -     INFO : Check config.yaml :
2024-01-31 16:26:02.781 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:26:02.781 -     INFO : CONFIG VALID
2024-01-31 16:26:02.781 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade  -> 0c07baa8d7b2, base
INFO  [alembic.runtime.migration] Running upgrade 0c07baa8d7b2 -> 09d887b265a5, add enable, progress & progress_status to usage_points
INFO  [alembic.runtime.migration] Running upgrade 09d887b265a5 -> 955ac9d18022, add consentement expiration date
INFO  [alembic.runtime.migration] Running upgrade 955ac9d18022 -> 4bb5f8f3d841, add all status data
INFO  [alembic.runtime.migration] Running upgrade 4bb5f8f3d841 -> 0b5c52e4efba, add activation_date
INFO  [alembic.runtime.migration] Running upgrade 0b5c52e4efba -> c70a0702d76b, add powered table
INFO  [alembic.runtime.migration] Running upgrade c70a0702d76b -> 0b59c59dad3c, nullable last_distribution_tariff_change_date in contract
INFO  [alembic.runtime.migration] Running upgrade 0b59c59dad3c -> 28b7a00bae70, add tempo
INFO  [alembic.runtime.migration] Running upgrade 28b7a00bae70 -> 158de49caa38, recreate statistique
INFO  [alembic.runtime.migration] Running upgrade 158de49caa38 -> b3505740913d, add ecowatt
INFO  [alembic.runtime.migration] Running upgrade b3505740913d -> f599b59e8a0d, add error log
INFO  [alembic.runtime.migration] Running upgrade f599b59e8a0d -> e990284249e4, add tempo_config
2024-01-31 16:27:24.959 -     INFO : Configure Databases
2024-01-31 16:27:25.016 -     INFO :  => day
2024-01-31 16:27:25.989 -     INFO :  => call_number
2024-01-31 16:27:26.929 -     INFO :  => max_call
2024-01-31 16:27:27.526 -     INFO :  => version
2024-01-31 16:27:28.579 -     INFO :  => lock
2024-01-31 16:27:29.815 -     INFO :  => lastUpdate
2024-01-31 16:27:29.815 -     INFO :  Success
2024-01-31 16:27:29.817 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:29.817 -     INFO : Connect to InfluxDB addon_a0d7b954_influxdb:8086
2024-01-31 16:27:29.829 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:29.829 -     INFO : CONNECTION SUCCESS
2024-01-31 16:27:29.829 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:29.829 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:29.829 -     INFO : MÉTHODE D'IMPORTATION : SYNCHRONOUS
2024-01-31 16:27:29.829 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:29.829 -  WARNING :  => Aucune durée de rétention de données détectée.
2024-01-31 16:27:29.830 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:29.830 -     INFO : Connect to MQTT broker core-mosquitto:1883
2024-01-31 16:27:29.834 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:29.834 -     INFO : CONNECTION SUCCESS
2024-01-31 16:27:29.834 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:30.818 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:30.818 -     INFO : RUN IN PRODUCTION MODE
2024-01-31 16:27:30.818 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:30.818 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:30.819 -     INFO : CHARGEMENT DU CONFIG.YAML...
2024-01-31 16:27:30.820 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:30.820 -     INFO : 25212156197789
2024-01-31 16:27:32.665 -     INFO :   => Success
2024-01-31 16:27:32.665 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:32.666 -     INFO : NETTOYAGE DE LA BASE DE DONNÉES...
2024-01-31 16:27:32.666 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:32.744 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:32.745 -     INFO : ▌│█║▌║▌║  __  __         _____  _              _          _               _  ____          _           ║▌║▌║█│▌
2024-01-31 16:27:32.745 -     INFO : ▌│█║▌║▌║ |  \/  | _   _ | ____|| |  ___   ___ | |_  _ __ (_)  ___   __ _ | ||  _ \   __ _ | |_   __ _  ║▌║▌║█│▌
2024-01-31 16:27:32.746 -     INFO : ▌│█║▌║▌║ | |\/| || | | ||  _|  | | / _ \ / __|| __|| '__|| | / __| / _` || || | | | / _` || __| / _` | ║▌║▌║█│▌
2024-01-31 16:27:32.746 -     INFO : ▌│█║▌║▌║ | |  | || |_| || |___ | ||  __/| (__ | |_ | |   | || (__ | (_| || || |_| || (_| || |_ | (_| | ║▌║▌║█│▌
2024-01-31 16:27:32.746 -     INFO : ▌│█║▌║▌║ |_|  |_| \__, ||_____||_| \___| \___| \__||_|   |_| \___| \__,_||_||____/  \__,_| \__| \__,_| ║▌║▌║█│▌
2024-01-31 16:27:32.746 -     INFO : ▌│█║▌║▌║          |___/                                                                                ║▌║▌║█│▌
2024-01-31 16:27:32.746 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:32.747 -     INFO : ▌│█║▌║▌║                                       VERSION : v0.9.3                                        ║▌║▌║█│▌
2024-01-31 16:27:32.747 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:32.797 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:32.797 -     INFO : RUN IN PRODUCTION MODE
2024-01-31 16:27:32.797 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:32.798 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:32.798 -     INFO : CHARGEMENT DU CONFIG.YAML...
2024-01-31 16:27:32.798 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:32.798 -     INFO : 25212156197789
2024-01-31 16:27:32.812 -     INFO :   => Success
2024-01-31 16:27:32.812 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:32.812 -     INFO : NETTOYAGE DE LA BASE DE DONNÉES...
2024-01-31 16:27:32.813 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:32.884 -     INFO : Started server process [775]
2024-01-31 16:27:32.884 -     INFO : Waiting for application startup.
2024-01-31 16:27:32.894 -     INFO : Application startup complete.
2024-01-31 16:27:32.900 -     INFO : Uvicorn running on http://0.0.0.0:5000 (Press CTRL+C to quit)
2024-01-31 16:27:32.907 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:32.908 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:32.909 -     INFO : RÉCUPÉRATION DU STATUT DE LA PASSERELLE :
2024-01-31 16:27:32.909 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:32.909 -     INFO : DÉMARRAGE DU JOB D'IMPORTATION DANS 10S
2024-01-31 16:27:32.915 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:32.916 -     INFO : 10s
2024-01-31 16:27:33.228 -     INFO : status: True
2024-01-31 16:27:33.228 -     INFO : information: None
2024-01-31 16:27:33.228 -     INFO : nb_client: 2162
2024-01-31 16:27:33.229 -     INFO : waiting_estimation: 0.0s
2024-01-31 16:27:33.918 -     INFO : 9s
2024-01-31 16:27:34.919 -     INFO : 8s
2024-01-31 16:27:34.941 -     INFO : 127.0.0.1:52314 - "GET / HTTP/1.1" 200
2024-01-31 16:27:35.922 -     INFO : 7s
2024-01-31 16:27:36.922 -     INFO : 6s
2024-01-31 16:27:37.922 -     INFO : 5s
2024-01-31 16:27:38.923 -     INFO : 4s
2024-01-31 16:27:39.923 -     INFO : 3s
2024-01-31 16:27:40.923 -     INFO : 2s
2024-01-31 16:27:41.141 -     INFO : 127.0.0.1:52316 - "GET / HTTP/1.1" 200
2024-01-31 16:27:41.141 -     INFO : 127.0.0.1:52316 - "GET / HTTP/1.1" 200
2024-01-31 16:27:41.924 -     INFO : 1s
2024-01-31 16:27:42.924 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:42.924 -     INFO : RÉCUPÉRATION DU STATUT DE LA PASSERELLE :
2024-01-31 16:27:42.926 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:43.209 -     INFO : status: True
2024-01-31 16:27:43.209 -     INFO : information: None
2024-01-31 16:27:43.210 -     INFO : nb_client: 2162
2024-01-31 16:27:43.210 -     INFO : waiting_estimation: 0.0s
2024-01-31 16:27:43.210 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:43.210 -     INFO : IMPORT TEMPO DÉSACTIVÉ
2024-01-31 16:27:43.210 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:43.211 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:43.211 -     INFO : RÉCUPÉRATION DES DONNÉES ECOWATT :
2024-01-31 16:27:43.211 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:43.216 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:27:43.216 -     INFO : NO CACHE
2024-01-31 16:27:43.216 -     INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2024-01-31 16:28:06.096 -     INFO : 127.0.0.1:54344 - "GET / HTTP/1.1" 500
2024-01-31 16:28:06.098 -    ERROR : Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: database is locked

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 428, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 289, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/usr/local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in __call__
    raise e
  File "/usr/local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 273, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 192, in run_endpoint_function
    return await run_in_threadpool(dependant.call, **values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 41, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/routers/html.py", line 22, in main
    return Index(CONFIG, DB).display()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/templates/index.py", line 39, in display
    select_usage_points=self.usage_point_select.html(),
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/templates/models/usage_point_select.py", line 20, in html
    for config in self.db.get_usage_point_all():
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/models/database.py", line 246, in get_usage_point_all
    data = self.session.scalars(query).all()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<string>", line 2, in scalars
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 1771, in scalars
    return self.execute(
           ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 1712, in execute
    result = conn._execute_20(statement, params or {}, execution_options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1705, in _execute_20
    return meth(self, args_10style, kwargs_10style, execution_options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/elements.py", line 333, in _execute_on_connection
    return connection._execute_clauseelement(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1572, in _execute_clauseelement
    ret = self._execute_context(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1943, in _execute_context
    self._handle_dbapi_exception(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2124, in _handle_dbapi_exception
    util.raise_(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/util/compat.py", line 208, in raise_
    raise exception
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked
[SQL: SELECT usage_points.usage_point_id, usage_points.name, usage_points.cache, usage_points.consumption, usage_points.consumption_detail, usage_points.production, usage_points.production_detail, usage_points.con
sumption_price_base, usage_points.consumption_price_hc, usage_points.consumption_price_hp, usage_points.production_price, usage_points.offpeak_hours_0, usage_points.offpeak_hours_1, usage_points.offpeak_hours_2, u
sage_points.offpeak_hours_3, usage_points.offpeak_hours_4, usage_points.offpeak_hours_5, usage_points.offpeak_hours_6, usage_points."plan", usage_points.refresh_addresse, usage_points.refresh_contract, usage_point
s.token, usage_points.progress, usage_points.progress_status, usage_points.enable, usage_points.consentement_expiration, usage_points.call_number, usage_points.quota_reached, usage_points.quota_limit, usage_points
.quota_reset_at, usage_points.last_call, usage_points.ban, usage_points.consumption_max_date, usage_points.consumption_detail_max_date, usage_points.production_max_date, usage_points.production_detail_max_date, us
age_points.consumption_max_power, usage_points.last_error
FROM usage_points]
(Background on this error at: https://sqlalche.me/e/14/e3q8)
2024-01-31 16:28:12.241 -     INFO : 127.0.0.1:47394 - "GET / HTTP/1.1" 500
2024-01-31 16:28:12.244 -    ERROR : Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: database is locked

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 428, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 289, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/usr/local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in __call__
    raise e
  File "/usr/local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 273, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 192, in run_endpoint_function
    return await run_in_threadpool(dependant.call, **values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 41, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/routers/html.py", line 22, in main
    return Index(CONFIG, DB).display()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/templates/index.py", line 39, in display
    select_usage_points=self.usage_point_select.html(),
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/templates/models/usage_point_select.py", line 20, in html
    for config in self.db.get_usage_point_all():
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/models/database.py", line 246, in get_usage_point_all
    data = self.session.scalars(query).all()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<string>", line 2, in scalars
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 1771, in scalars
    return self.execute(
           ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 1712, in execute
    result = conn._execute_20(statement, params or {}, execution_options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1705, in _execute_20
    return meth(self, args_10style, kwargs_10style, execution_options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/elements.py", line 333, in _execute_on_connection
    return connection._execute_clauseelement(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1572, in _execute_clauseelement
    ret = self._execute_context(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1943, in _execute_context
    self._handle_dbapi_exception(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2124, in _handle_dbapi_exception
    util.raise_(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/util/compat.py", line 208, in raise_
    raise exception
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked
[SQL: SELECT usage_points.usage_point_id, usage_points.name, usage_points.cache, usage_points.consumption, usage_points.consumption_detail, usage_points.production, usage_points.production_detail, usage_points.con
sumption_price_base, usage_points.consumption_price_hc, usage_points.consumption_price_hp, usage_points.production_price, usage_points.offpeak_hours_0, usage_points.offpeak_hours_1, usage_points.offpeak_hours_2, u
sage_points.offpeak_hours_3, usage_points.offpeak_hours_4, usage_points.offpeak_hours_5, usage_points.offpeak_hours_6, usage_points."plan", usage_points.refresh_addresse, usage_points.refresh_contract, usage_point
s.token, usage_points.progress, usage_points.progress_status, usage_points.enable, usage_points.consentement_expiration, usage_points.call_number, usage_points.quota_reached, usage_points.quota_limit, usage_points
.quota_reset_at, usage_points.last_call, usage_points.ban, usage_points.consumption_max_date, usage_points.consumption_detail_max_date, usage_points.production_max_date, usage_points.production_detail_max_date, us
age_points.consumption_max_power, usage_points.last_error
FROM usage_points]
(Background on this error at: https://sqlalche.me/e/14/e3q8)
2024-01-31 16:28:19.989 -     INFO : 127.0.0.1:32996 - "GET / HTTP/1.1" 500
2024-01-31 16:28:19.991 -    ERROR : Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: database is locked
m4dm4rtig4n commented 8 months ago

Tu n'aurais pas 2 services qui tourne en même temps sur le même cache ?

cosygarcia commented 8 months ago

j'ai pas l'impression :

root@vm03:~# docker ps
CONTAINER ID   IMAGE                                                       COMMAND                  CREATED             STATUS                       PORTS                                                                                                                          NAMES
79d3dede9bfc   ghcr.io/alexbelgium/myelectricaldata-aarch64:0.9.3          "/usr/bin/env /ha_en…"   59 minutes ago      Up 51 minutes (healthy)      0.0.0.0:5000->5000/tcp, :::5000->5000/tcp                                                                                      addon_db21ed7f_enedisgateway2mqtt
1844a222c6cd   homeassistant/aarch64-addon-configurator:5.6.0              "/init"                  About an hour ago   Up About an hour (healthy)                                                                                                                                  addon_core_configurator
0c6a836b9f41   ghcr.io/hassio-addons/sqlite-web/aarch64:4.1.0              "/init"                  About an hour ago   Up About an hour                                                                                                                                            addon_a0d7b954_sqlite-web
227c27811020   ghcr.io/home-assistant/qemuarm-64-homeassistant:2024.1.5    "/init"                  About an hour ago   Up About an hour                                                                                                                                            homeassistant
d1e3433363b7   ghcr.io/hassio-addons/influxdb/aarch64:5.0.0                "/init"                  About an hour ago   Up About an hour             0.0.0.0:8086->8086/tcp, :::8086->8086/tcp, 0.0.0.0:8088->8088/tcp, :::8088->8088/tcp                                           addon_a0d7b954_influxdb
ce20631b3297   homeassistant/aarch64-addon-ssh:9.8.1                       "/init"                  About an hour ago   Up About an hour             0.0.0.0:1022->22/tcp, :::1022->22/tcp                                                                                          addon_core_ssh
5faef45fdfa6   homeassistant/aarch64-addon-mosquitto:6.4.0                 "/init"                  About an hour ago   Up About an hour             0.0.0.0:1883-1884->1883-1884/tcp, :::1883-1884->1883-1884/tcp, 0.0.0.0:8883-8884->8883-8884/tcp, :::8883-8884->8883-8884/tcp   addon_core_mosquitto
bb8d8cc34551   ghcr.io/home-assistant/aarch64-hassio-multicast:2023.06.2   "/init"                  About an hour ago   Up About an hour                                                                                                                                            hassio_multicast
0a70e0727a65   ghcr.io/home-assistant/aarch64-hassio-audio:2023.12.0       "/init"                  About an hour ago   Up About an hour                                                                                                                                            hassio_audio
debc0c07e09f   ghcr.io/home-assistant/aarch64-hassio-dns:2023.06.2         "/init"                  About an hour ago   Up About an hour                                                                                                                                            hassio_dns
b48267141de9   ghcr.io/home-assistant/aarch64-hassio-cli:2023.11.0         "/init"                  About an hour ago   Up About an hour                                                                                                                                            hassio_cli
92fb8047f479   ghcr.io/home-assistant/aarch64-hassio-supervisor:latest     "/init"                  6 days ago          Up About an hour                                                                                                                                            hassio_supervisor
9b8472354289   ghcr.io/home-assistant/aarch64-hassio-observer:2023.06.0    "/usr/bin/observer"      6 days ago          Up About an hour             0.0.0.0:4357->80/tcp, :::4357->80/tcp                                                                                          hassio_observer

root@vm03:~# docker ps | grep myelec
79d3dede9bfc   ghcr.io/alexbelgium/myelectricaldata-aarch64:0.9.3          "/usr/bin/env /ha_en…"   59 minutes ago      Up 52 minutes (healthy)      0.0.0.0:5000->5000/tcp, :::5000->5000/tcp                                                                                      addon_db21ed7f_enedisgateway2mqtt
Gandulf78 commented 8 months ago

J'ai exactement la même erreur si j'essaie d'afficher le dashboard au démarrage de MED, quand il charge les données je pense.

cosygarcia commented 8 months ago

impossible d'accéder à l'interface web de l'addon :

image

et toujours les mêmes erreurs dans les logs :

2024-02-05 17:42:19.731 -    ERROR : Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: database is locked

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 428, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 289, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/usr/local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in __call__
    raise e
  File "/usr/local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 273, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 192, in run_endpoint_function
    return await run_in_threadpool(dependant.call, **values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 41, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/routers/html.py", line 22, in main
    return Index(CONFIG, DB).display()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/templates/index.py", line 39, in display
    select_usage_points=self.usage_point_select.html(),
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/templates/models/usage_point_select.py", line 20, in html
    for config in self.db.get_usage_point_all():
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/models/database.py", line 246, in get_usage_point_all
    data = self.session.scalars(query).all()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<string>", line 2, in scalars
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 1771, in scalars
    return self.execute(
           ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 1712, in execute
    result = conn._execute_20(statement, params or {}, execution_options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1705, in _execute_20
    return meth(self, args_10style, kwargs_10style, execution_options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/elements.py", line 333, in _execute_on_connection
    return connection._execute_clauseelement(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1572, in _execute_clauseelement
    ret = self._execute_context(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1943, in _execute_context
    self._handle_dbapi_exception(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2124, in _handle_dbapi_exception
    util.raise_(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/util/compat.py", line 208, in raise_
    raise exception
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked
[SQL: SELECT usage_points.usage_point_id, usage_points.name, usage_points.cache, usage_points.consumption, usage_points.consumption_detail, usage_points.production, usage_points.production_detail, usage_points.consumption_price_base, usage_points.consumption_price_hc, usage_points.consumption_price_hp, usage_points.production_price, usage_points.offpeak_hours_0, usage_points.offpeak_hours_1, usage_points.offpeak_hours_2, usage_points.offpeak_hours_3, usage_points.offpeak_hours_4, usage_points.offpeak_hours_5, usage_points.offpeak_hours_6, usage_points."plan", usage_points.refresh_addresse, usage_points.refresh_contract, usage_points.token, usage_points.progress, usage_points.progress_status, usage_points.enable, usage_points.consentement_expiration, usage_points.call_number, usage_points.quota_reached, usage_points.quota_limit, usage_points.quota_reset_at, usage_points.last_call, usage_points.ban, usage_points.consumption_max_date, usage_points.consumption_detail_max_date, usage_points.production_max_date, usage_points.production_detail_max_date, usage_points.consumption_max_power, usage_points.last_error
FROM usage_points]
(Background on this error at: https://sqlalche.me/e/14/e3q8)
2024-02-05 17:42:46.764 -     INFO : 127.0.0.1:32818 - "GET / HTTP/1.1" 500
2024-02-05 17:42:46.766 -    ERROR : Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: database is locked

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 428, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 289, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/usr/local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in __call__
    raise e
  File "/usr/local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 273, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 192, in run_endpoint_function
    return await run_in_threadpool(dependant.call, **values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 41, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/routers/html.py", line 22, in main
    return Index(CONFIG, DB).display()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/templates/index.py", line 39, in display
    select_usage_points=self.usage_point_select.html(),
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/templates/models/usage_point_select.py", line 20, in html
    for config in self.db.get_usage_point_all():
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/models/database.py", line 246, in get_usage_point_all
    data = self.session.scalars(query).all()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<string>", line 2, in scalars
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 1771, in scalars
    return self.execute(
           ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 1712, in execute
    result = conn._execute_20(statement, params or {}, execution_options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1705, in _execute_20
    return meth(self, args_10style, kwargs_10style, execution_options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/elements.py", line 333, in _execute_on_connection
    return connection._execute_clauseelement(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1572, in _execute_clauseelement
    ret = self._execute_context(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1943, in _execute_context
    self._handle_dbapi_exception(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2124, in _handle_dbapi_exception
    util.raise_(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/util/compat.py", line 208, in raise_
    raise exception
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked
[SQL: SELECT usage_points.usage_point_id, usage_points.name, usage_points.cache, usage_points.consumption, usage_points.consumption_detail, usage_points.production, usage_points.production_detail, usage_points.consumption_price_base, usage_points.consumption_price_hc, usage_points.consumption_price_hp, usage_points.production_price, usage_points.offpeak_hours_0, usage_points.offpeak_hours_1, usage_points.offpeak_hours_2, usage_points.offpeak_hours_3, usage_points.offpeak_hours_4, usage_points.offpeak_hours_5, usage_points.offpeak_hours_6, usage_points."plan", usage_points.refresh_addresse, usage_points.refresh_contract, usage_points.token, usage_points.progress, usage_points.progress_status, usage_points.enable, usage_points.consentement_expiration, usage_points.call_number, usage_points.quota_reached, usage_points.quota_limit, usage_points.quota_reset_at, usage_points.last_call, usage_points.ban, usage_points.consumption_max_date, usage_points.consumption_detail_max_date, usage_points.production_max_date, usage_points.production_detail_max_date, usage_points.consumption_max_power, usage_points.last_error
FROM usage_points]
(Background on this error at: https://sqlalche.me/e/14/e3q8)
2024-02-05 17:42:54.551 -     INFO : 127.0.0.1:35432 - "GET / HTTP/1.1" 500
2024-02-05 17:42:54.553 -    ERROR : Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: database is locked

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 428, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 289, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/usr/local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in __call__
    raise e
  File "/usr/local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 273, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 192, in run_endpoint_function
    return await run_in_threadpool(dependant.call, **values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 41, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/routers/html.py", line 22, in main
    return Index(CONFIG, DB).display()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/templates/index.py", line 39, in display
    select_usage_points=self.usage_point_select.html(),
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/templates/models/usage_point_select.py", line 20, in html
    for config in self.db.get_usage_point_all():
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/models/database.py", line 246, in get_usage_point_all
    data = self.session.scalars(query).all()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<string>", line 2, in scalars
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 1771, in scalars
    return self.execute(
           ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 1712, in execute
    result = conn._execute_20(statement, params or {}, execution_options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1705, in _execute_20
    return meth(self, args_10style, kwargs_10style, execution_options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/elements.py", line 333, in _execute_on_connection
    return connection._execute_clauseelement(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1572, in _execute_clauseelement
    ret = self._execute_context(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1943, in _execute_context
    self._handle_dbapi_exception(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2124, in _handle_dbapi_exception
    util.raise_(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/util/compat.py", line 208, in raise_
    raise exception
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked
[SQL: SELECT usage_points.usage_point_id, usage_points.name, usage_points.cache, usage_points.consumption, usage_points.consumption_detail, usage_points.production, usage_points.production_detail, usage_points.consumption_price_base, usage_points.consumption_price_hc, usage_points.consumption_price_hp, usage_points.production_price, usage_points.offpeak_hours_0, usage_points.offpeak_hours_1, usage_points.offpeak_hours_2, usage_points.offpeak_hours_3, usage_points.offpeak_hours_4, usage_points.offpeak_hours_5, usage_points.offpeak_hours_6, usage_points."plan", usage_points.refresh_addresse, usage_points.refresh_contract, usage_points.token, usage_points.progress, usage_points.progress_status, usage_points.enable, usage_points.consentement_expiration, usage_points.call_number, usage_points.quota_reached, usage_points.quota_limit, usage_points.quota_reset_at, usage_points.last_call, usage_points.ban, usage_points.consumption_max_date, usage_points.consumption_detail_max_date, usage_points.production_max_date, usage_points.production_detail_max_date, usage_points.consumption_max_power, usage_points.last_error
FROM usage_points]
(Background on this error at: https://sqlalche.me/e/14/e3q8)
2024-02-05 17:43:02.813 -     INFO : 127.0.0.1:35442 - "GET / HTTP/1.1" 500
2024-02-05 17:43:02.817 -    ERROR : Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: database is locked

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 428, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 289, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/usr/local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in __call__
    raise e
  File "/usr/local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 273, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 192, in run_endpoint_function
    return await run_in_threadpool(dependant.call, **values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 41, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/routers/html.py", line 22, in main
    return Index(CONFIG, DB).display()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/templates/index.py", line 39, in display
    select_usage_points=self.usage_point_select.html(),
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/templates/models/usage_point_select.py", line 20, in html
    for config in self.db.get_usage_point_all():
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/models/database.py", line 246, in get_usage_point_all
    data = self.session.scalars(query).all()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<string>", line 2, in scalars
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 1771, in scalars
    return self.execute(
           ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 1712, in execute
    result = conn._execute_20(statement, params or {}, execution_options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1705, in _execute_20
    return meth(self, args_10style, kwargs_10style, execution_options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/elements.py", line 333, in _execute_on_connection
    return connection._execute_clauseelement(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1572, in _execute_clauseelement
    ret = self._execute_context(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1943, in _execute_context
    self._handle_dbapi_exception(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2124, in _handle_dbapi_exception
    util.raise_(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/util/compat.py", line 208, in raise_
    raise exception
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked
[SQL: SELECT usage_points.usage_point_id, usage_points.name, usage_points.cache, usage_points.consumption, usage_points.consumption_detail, usage_points.production, usage_points.production_detail, usage_points.consumption_price_base, usage_points.consumption_price_hc, usage_points.consumption_price_hp, usage_points.production_price, usage_points.offpeak_hours_0, usage_points.offpeak_hours_1, usage_points.offpeak_hours_2, usage_points.offpeak_hours_3, usage_points.offpeak_hours_4, usage_points.offpeak_hours_5, usage_points.offpeak_hours_6, usage_points."plan", usage_points.refresh_addresse, usage_points.refresh_contract, usage_points.token, usage_points.progress, usage_points.progress_status, usage_points.enable, usage_points.consentement_expiration, usage_points.call_number, usage_points.quota_reached, usage_points.quota_limit, usage_points.quota_reset_at, usage_points.last_call, usage_points.ban, usage_points.consumption_max_date, usage_points.consumption_detail_max_date, usage_points.production_max_date, usage_points.production_detail_max_date, usage_points.consumption_max_power, usage_points.last_error
FROM usage_points]
(Background on this error at: https://sqlalche.me/e/14/e3q8)
m4dm4rtig4n commented 8 months ago

Hello, On dirais que la bdd sqlite est corrompu :/ Le plus simple et de supprimer le fichier cache.db et de repartir avec un fichier clean.

wallb35 commented 8 months ago

Hello, même chose suite à la mise à jour en 0.10.0 ce matin. En revenant à la 0.9.3 le problème disparait. Le fichier .lock n'est pas effacé lors de l'arret du container. En le supprimant, la v0.10.0 démarre.

cosygarcia commented 8 months ago

j'ai fait plusieurs tests : 1) Arrêter le conteneur myelectricaldata ; supprimer le fichier cache.db ; redémarrer le conteneur myelectricaldata : toujours les mêmes erreurs database is locked

2) désinstaller l'addon myelectricaldata v0.9.3 ; installer l'addon myelectricaldata v0.9.3 ; supprimer le fichier cache.db ; démarrer le conteneur myelectricaldata : toujours les mêmes erreurs database is locked

cosygarcia commented 8 months ago

Hello, même chose suite à la mise à jour en 0.10.0 ce matin. En revenant à la 0.9.3 le problème disparait. Le fichier .lock n'est pas effacé lors de l'arret du container. En le supprimant, la v0.10.0 démarre.

de quel fichier .lock s'agit-il ?

cosygarcia commented 8 months ago

la log complète en PJ addon_db21ed7f_enedisgateway2mqtt.log

wallb35 commented 8 months ago

en 0.9.3 la navigation sur la page de resultat myelectricaldata http:///usage_point_id/ plante en Internal server error lors de la recuperation des données et fonctionne en dehors de cette plage. en 0.10.0, j'ai systematiquement internal server error sur la page usage_point_id et souvent sur l'url racine. Il me semble que dans les deux cas je récupère bien les donnée dans home assistant. (je dois attendre demain pour la 0.10.0).

Gandulf78 commented 8 months ago

en 0.9.3 la navigation sur la page de resultat myelectricaldata http:///usage_point_id/ plante en Internal server error lors de la recuperation des données et fonctionne en dehors de cette plage.

en 0.10.0, j'ai systematiquement internal server error sur la page usage_point_id et souvent sur l'url racine.

Il me semble que dans les deux cas je récupère bien les donnée dans home assistant. (je dois attendre demain pour la 0.10.0).

Même constat. MED tourne sur docker.

m4dm4rtig4n commented 8 months ago

Ca me casse les ... car je n'arrive pas à reproduire le bug :/

@gandulf78, si tu tourne sous docker "classic" et pas HaOS, tu pourrais m'envoyer tt ta conf de deployement & co afin que j'arrive à reproduire chez moi le soucis ?

=> m4dm4rtig4n@gmail.com

wallb35 commented 8 months ago

Hello, en 0.10.0, les données sont bien envoyées à home assistant mais impossible de me connecter sur la page /usage_point_id, la page affiche "internal server error" Je tourne en docker sur synology.

m4dm4rtig4n commented 7 months ago

@wallb35 oui c'est normal j'ai un soucis fix dans la 0.11.0-RC.2.

cosygarcia commented 7 months ago

Toujours les mêmes erreurs en v0.10

m4dm4rtig4n commented 7 months ago

Vous avez encore le soucis ?

wallb35 commented 7 months ago

Bonjour, plus de problème depuis la 0.11.0 ! Merci !

m4dm4rtig4n commented 7 months ago

Je clos donc, merci pour ton retour @wallb35 :)

cosygarcia commented 7 months ago

Il semble que quelque soit la version le problème se pose dès que je mets : consumption_detail_max_date: '2023-01-01' consumption_max_date: '2023-01-01' dans le config.yaml