hassio-addons / addon-appdaemon

AppDaemon4 - Home Assistant Community Add-ons
https://addons.community
MIT License
149 stars 46 forks source link

AppDaemon stops after updating to 0.15.0 #287

Closed PeterAndreS closed 8 months ago

PeterAndreS commented 9 months ago

Problem/Motivation

(Why the issue was filed) Stoped working!

Expected behavior

(What you expected to happen)

Actual behavior

(What actually happened)

Steps to reproduce

(How can someone else make/see it happen) Latest update of AppDaemon:

Proposed changes

(If you have a proposed change, workaround or fix, describe the rationale behind it)

Log:

Looking in indexes: https://pypi.org/simple, https://wheels.home-assistant.io/musllinux-index/
Collecting influxdb
  Obtaining dependency information for influxdb from https://wheels.home-assistant.io/musllinux-index/influxdb-5.3.1-py2.py3-none-any.whl.metadata
  Downloading https://wheels.home-assistant.io/musllinux-index/influxdb-5.3.1-py2.py3-none-any.whl.metadata (6.0 kB)
Requirement already satisfied: python-dateutil>=2.6.0 in /usr/lib/python3.11/site-packages (from influxdb) (2.8.2)
Requirement already satisfied: pytz in /usr/lib/python3.11/site-packages (from influxdb) (2023.3.post1)
Requirement already satisfied: requests>=2.17.0 in /usr/lib/python3.11/site-packages (from influxdb) (2.28.2)
Requirement already satisfied: six>=1.10.0 in /usr/lib/python3.11/site-packages (from influxdb) (1.16.0)
Collecting msgpack (from influxdb)
  Downloading https://wheels.home-assistant.io/musllinux-index/msgpack-1.0.7-cp311-cp311-musllinux_1_2_x86_64.whl (240 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 240.6/240.6 kB 7.2 MB/s eta 0:00:00
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/lib/python3.11/site-packages (from requests>=2.17.0->influxdb) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3.11/site-packages (from requests>=2.17.0->influxdb) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/lib/python3.11/site-packages (from requests>=2.17.0->influxdb) (1.26.18)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3.11/site-packages (from requests>=2.17.0->influxdb) (2023.7.22)
Downloading https://wheels.home-assistant.io/musllinux-index/influxdb-5.3.1-py2.py3-none-any.whl (77 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.9/77.9 kB 10.5 MB/s eta 0:00:00
Downloading https://wheels.home-assistant.io/musllinux-index/influxdb-5.3.1-py2.py3-none-any.whl (77 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.9/77.9 kB 48.4 MB/s eta 0:00:00
Installing collected packages: msgpack, influxdb
Successfully installed influxdb-5.3.1 msgpack-1.0.7
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Looking in indexes: https://pypi.org/simple, https://wheels.home-assistant.io/musllinux-index/
Collecting influxdb-client
  Downloading influxdb_client-1.38.0-py3-none-any.whl (743 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 743.5/743.5 kB 16.1 MB/s eta 0:00:00
Collecting reactivex>=4.0.4 (from influxdb-client)
  Downloading reactivex-4.0.4-py3-none-any.whl (217 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 217.8/217.8 kB 30.1 MB/s eta 0:00:00
Requirement already satisfied: certifi>=14.05.14 in /usr/lib/python3.11/site-packages (from influxdb-client) (2023.7.22)
Requirement already satisfied: python-dateutil>=2.5.3 in /usr/lib/python3.11/site-packages (from influxdb-client) (2.8.2)
Requirement already satisfied: setuptools>=21.0.0 in /usr/lib/python3.11/site-packages (from influxdb-client) (67.7.2)
Requirement already satisfied: urllib3>=1.26.0 in /usr/lib/python3.11/site-packages (from influxdb-client) (1.26.18)
Requirement already satisfied: six>=1.5 in /usr/lib/python3.11/site-packages (from python-dateutil>=2.5.3->influxdb-client) (1.16.0)
Collecting typing-extensions<5.0.0,>=4.1.1 (from reactivex>=4.0.4->influxdb-client)
  Downloading https://wheels.home-assistant.io/musllinux-index/typing_extensions-4.8.0-py3-none-any.whl (31 kB)
Installing collected packages: typing-extensions, reactivex, influxdb-client
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Successfully installed influxdb-client-1.38.0 reactivex-4.0.4 typing-extensions-4.8.0
Looking in indexes: https://pypi.org/simple, https://wheels.home-assistant.io/musllinux-index/
Collecting pyeloverblik
  Downloading pyeloverblik-0.4.1-py3-none-any.whl (10 kB)
Requirement already satisfied: requests in /usr/lib/python3.11/site-packages (from pyeloverblik) (2.28.2)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/lib/python3.11/site-packages (from requests->pyeloverblik) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3.11/site-packages (from requests->pyeloverblik) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/lib/python3.11/site-packages (from requests->pyeloverblik) (1.26.18)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3.11/site-packages (from requests->pyeloverblik) (2023.7.22)
Installing collected packages: pyeloverblik
Successfully installed pyeloverblik-0.4.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Looking in indexes: https://pypi.org/simple, https://wheels.home-assistant.io/musllinux-index/
Collecting pythermiagenesis
  Downloading pythermiagenesis-0.1.7-py3-none-any.whl (17 kB)
Collecting pymodbustcp==0.1.10 (from pythermiagenesis)
  Downloading pyModbusTCP-0.1.10.tar.gz (17 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Building wheels for collected packages: pymodbustcp
  Building wheel for pymodbustcp (setup.py): started
  Building wheel for pymodbustcp (setup.py): finished with status 'done'
  Created wheel for pymodbustcp: filename=pyModbusTCP-0.1.10-py3-none-any.whl size=16967 sha256=80bb452965f419b076c01d10bfe8cd09ccaf2ad63af106604764e73602b5e9e0
  Stored in directory: /tmp/pip-ephem-wheel-cache-z5irjpra/wheels/76/37/f4/816d7f608bcbac7b6dc96c59d366bf10af2ca12cc99bb207a3
Successfully built pymodbustcp
Installing collected packages: pymodbustcp, pythermiagenesis
Successfully installed pymodbustcp-0.1.10 pythermiagenesis-0.1.7
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
s6-rc: info: service init-appdaemon successfully started
s6-rc: info: service appdaemon: starting
s6-rc: info: service appdaemon successfully started
s6-rc: info: service legacy-services: starting
[11:40:58] INFO: Starting AppDaemon...
s6-rc: info: service legacy-services successfully started
Traceback (most recent call last):
  File "/usr/bin/appdaemon", line 8, in <module>
    sys.exit(main())
ERROR Error loading secrets file: /config/secrets.yaml
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/appdaemon/__main__.py", line 417, in main
    admain.main()
  File "/usr/lib/python3.11/site-packages/appdaemon/__main__.py", line 276, in main
    if "appdaemon" not in config:
       ^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable
[11:41:01] INFO: Service AppDaemon 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 appdaemon: stopping
s6-rc: info: service appdaemon successfully stopped
s6-rc: info: service init-appdaemon: stopping
s6-rc: info: service init-appdaemon 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
frenck commented 9 months ago

Thanks for the report, the config folder moved. Checking where this one is originating from...

../Frenck

dersch81 commented 9 months ago

Same for me, also using the backup back to 14.0 does not work anymore

-----------------------------------------------------------
 Add-on: AppDaemon
 Python Apps and Dashboard using AppDaemon 4.x for Home Assistant
-----------------------------------------------------------
 Add-on version: 0.15.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 11.1  (amd64 / qemux86-64)
 Home Assistant Core: 2023.11.2
 Home Assistant Supervisor: 2023.11.3
-----------------------------------------------------------
 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-appdaemon: starting
s6-rc: info: service init-appdaemon successfully started
s6-rc: info: service appdaemon: starting
s6-rc: info: service appdaemon successfully started
s6-rc: info: service legacy-services: starting
[11:48:51] INFO: Starting AppDaemon...
s6-rc: info: service legacy-services successfully started
ERROR Error loading secrets file: /config/secrets.yaml
Traceback (most recent call last):
  File "/usr/bin/appdaemon", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/appdaemon/__main__.py", line 417, in main
    admain.main()
  File "/usr/lib/python3.11/site-packages/appdaemon/__main__.py", line 276, in main
    if "appdaemon" not in config:
       ^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable
[11:48:54] INFO: Service AppDaemon 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 appdaemon: stopping
s6-rc: info: service appdaemon successfully stopped
s6-rc: info: service init-appdaemon: stopping
s6-rc: info: service init-appdaemon 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
PeterAndreS commented 9 months ago

Expected behavior folder name?

All files moved to new location as expected but is foldername okay? addon_configs\a0d7b954_appdaemon

frenck commented 9 months ago

I've updated the breaking change section:

If you have this in your appdaemon.yaml file:

secrets: /config/secrets.yaml

You will need to adjust this to:

secrets: /homeassistant/secrets.yaml
dersch81 commented 9 months ago

where can i find the appdaemon.yaml?

/homeassistant/appdaemon is empty

Jabe commented 9 months ago

@frenck It reverts to secrets: /config/secrets.yaml on each start unfortunately.

kefrens commented 9 months ago

Facing same issue and as @Jabe mentionned its reverts to secrets: /config/secrets.yaml after each start :(

@dersch81 you can find it on \homeassistant\addon_configs\axxxxxxxx_appdaemon

frenck commented 9 months ago

The add-on configuration folders can be found in the add-on configuration shares. If you access it using samba, this share is called addon_configs.

If you are using SSH, VSCode or any other similar terminal, you can find them in /addon_configs.

../Frenck

dersch81 commented 9 months ago

same as @kefrens changed to /homeassistant/secrets.yaml but after restart it is reverted back to /config/secrets.yaml

mupsje commented 9 months ago

@frenck It reverts to secrets: /config/secrets.yaml on each start unfortunately.

yup, every time it restarts it changed back to

secrets: /config/secrets.yaml
pmansvelder commented 9 months ago

same problem here

PeterAndreS commented 9 months ago

When secrets: /homeassistant/secrets.yaml is set in a0d7b954_appdaemon\appdaemon.yaml It reverts to secrets: /config/secrets.yaml an restarts.

When secrets is removed from yaml it starts but still looks in /config folder...

023-11-15 12:15:13.072835 WARNING AppDaemon: ------------------------------------------------------------
2023-11-15 12:15:13.073366 WARNING AppDaemon: File '/config/apps/testmodule.yaml' invalid structure - ignoring
2023-11-15 12:15:13.074813 INFO AppDaemon: /config/apps/testmodule.yaml added or modified
2023-11-15 12:15:13.075552 INFO AppDaemon: Found 1 active apps
2023-11-15 12:15:13.075724 INFO AppDaemon: Found 0 inactive apps
2023-11-15 12:15:13.075869 INFO AppDaemon: Found 0 global libraries
2023-11-15 12:15:13.076776 INFO AppDaemon: Adding /config/apps to module import path
2023-11-15 12:15:13.080232 WARNING AppDaemon: No app description found for: /config/apps/ems_genesis.py - ignoring
2023-11-15 12:15:13.080885 WARNING AppDaemon: No app description found for: /config/apps/ha_helper_updater.py - ignoring
2023-11-15 12:15:13.081500 WARNING AppDaemon: No app description found for: /config/apps/ems_genesis - org.py - ignoring
2023-11-15 12:15:13.081993 INFO AppDaemon: Loading App Module: /config/apps/hello.py
2023-11-15 12:15:13.109411 WARNING AppDaemon: No app description found for: /config/apps/testmodule.py - ignoring
2023-11-15 12:15:13.110084 WARNING AppDaemon: No app description found for: /config/apps/ems_electricity.py - ignoring
2023-11-15 12:15:13.110544 INFO AppDaemon: Loading app hello_world using class HelloWorld from module hello
2023-11-15 12:15:13.111792 INFO AppDaemon: Calling initialize() for hello_world
2023-11-15 12:15:13.148255 INFO hello_world: Hello from AppDaemon
2023-11-15 12:15:13.148979 INFO hello_world: You are now ready to run Apps!
2023-11-15 12:15:13.149956 INFO AppDaemon: App initialization complete
2023-11-15 12:16:33.158487 INFO AppDaemon: New client Admin Client connected
frenck commented 9 months ago

@pmansvelder Hidden your comment. An issue cannot be triaged by "I have the same problem". Please don't make such postings in any issue report. Thanks 👍

frenck commented 9 months ago

Looking into it, not fully understanding what makes it reverting it.

pmansvelder commented 9 months ago

Sorry, I will try to do better: I installed 0.15, after this I noticed appdaemon stopped running; when looking in the log I saw the exact same message as above:

ERROR Error loading secrets file: /config/secrets.yaml
Traceback (most recent call last):
  File "/usr/bin/appdaemon", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/appdaemon/__main__.py", line 417, in main
    admain.main()
  File "/usr/lib/python3.11/site-packages/appdaemon/__main__.py", line 276, in main
    if "appdaemon" not in config:
       ^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable

So I tried copying back my old config which has the line with /config/secrets.yaml commented out:

---
#secrets: /config/secrets.yaml
appdaemon:
  latitude: 52.379189
  longitude: 4.899431
  elevation: 2
  time_zone: Europe/Amsterdam
  plugins:
    HASS:
      type: hass
    MQTT:
      type: mqtt
      namespace: mqtt
      client_id: appdaemon
      client_host: core-mosquitto.local.hass.io
      client_port: 1883
      client_user: "mqtt-user"
      client_password: "mqtt"
      client_topics: NONE
http:
  url: http://127.0.0.1:5050
admin:
api:
hadashboard:

But when I started appdaemon it reverted back to the original config. I have tried restarting homeassistant, but the problem persists.

I am using HomeAssistant Yellow with the Appdaemon add-on

dersch81 commented 9 months ago

Looking into it, not fully understanding what makes it reverting it.

Thanks for you effort. Seems both Add-On updates are now making you more busy than expected

frenck commented 9 months ago

Found the appdaemon issue. Will create a fix right away 🙏

frenck commented 9 months ago

Looking into it, not fully understanding what makes it reverting it.

Thanks for you effort. Seems both Add-On updates are now making you more busy than expected

LOL yeah, not the best combination of add-ons to have issues with atm 😓

../Frenck

pmansvelder commented 9 months ago

Found the appdaemon issue. Will create a fix right away 🙏

Thanks for the quick reply, didn't mean to troll like that, I appreciate your work very much, it has made configuring and using HA a breeze in comparison with the manual installation I used before…

frenck commented 9 months ago

@shamal69 That seems completely wrong! Please nobody use that ⚠️

Hid that comment to prevent other destroying stuff.

frenck commented 9 months ago

Found the appdaemon issue. Will create a fix right away 🙏

Thanks for the quick reply, didn't mean to troll like that, I appreciate your work very much, it has made configuring and using HA a breeze in comparison with the manual installation I used before…

Oh I'm more mad at myself for having shipped these bugs in the first place. I do test a lot and care a lot about these things. Anyways, at least it shows I'm still human.

dersch81 commented 9 months ago

You can not be human you are doing to much awesome stuff normally. Only having a bad day. Now go back to be inhuman software guy as usual to feed us with amazing HA stuff every day!!11!!11!!111!!1

frenck commented 9 months ago

Shipped v15.0.2: https://github.com/hassio-addons/addon-appdaemon/releases/tag/v0.15.2

PeterAndreS commented 9 months ago

0.15.1 Now appdaemon starts without revers secrets setting. Note: I had to manually add my modules in apps.yaml again. And logging is removed from a0d7b954_appdaemon\appdaemon.yaml. (No log files.)

Old settings in appdaemon.yaml, how to refere to new location? logs: main_log: filename: /config/appdaemon/logs/appdaemon.log

I tried this: logs: main_log: filename: /addon_configs/a0d7b954_appdaemon/logs/appdaemon.log Result: FileNotFoundError: [Errno 2] No such file or directory: '/addon_configs/a0d7b954_appdaemon/logs/appdaemon.log'

springfall2008 commented 9 months ago

What do I need to change here for HACS installed applications? Currently my application (https://github.com/springfall2008/batpred) installs as apps/batpred - will this still work?

frenck commented 9 months ago

ℹ️ The solution

Important, v0.15.0 & v0.15.1 have an issue with failing to detect the migration that already happened.

That is unfortunate, but it did happen and didn't show up in testing, unfortunately 😭

If you have upgraded from v0.14 or older to v0.15.0 or v0.15.1 you will encounter a migration problem.

To solve this:

  1. Restore a backup (AppDaemon + home assistant config as that is where the appdaemon config is stored)
  2. Clear out the AppDaemon folder in /addon_configs/, which contains the invalid migration. You can access this folder using the terminal add-on or using the addon_configs share provided by the Samba add-on.

Once you are back up and running on the previous version, upgrade to v0.15.2.

I've addressed the issue as quickly as possible, but I cannot revert what has been done.

I'm mostly mad at myself right now, and I'm deeply sorry this happened.

Sorry for the issue this might have caused for you 🙏

../Frenck

Jabe commented 9 months ago

Still needed to set secrets: /homeassistant/secrets.yaml in appdaemon.yaml, but it works again. 😃

mplogas commented 9 months ago

// edit: @Jabe added the important bit. changing the path did the trick. please add this step to your workaround. Thanks for the swift help <3

Hi @frenck, I'm, afraid your proposed solution isn't quite working for me. Please confirm the steps are in the right order: Steps to repro:

  1. remove /addon_configs/xxx_app_daemon folder
  2. Go back to 14.x via backup
  3. bring back /config/appdaemon folder content from backup
  4. start appdaemon 14.x
  5. upgrade appdaemon to 15.2.

expected result: starts up observed result: /config/appdaemon folder is wiped, /addon_configs/xxx_app_daemon is created. appdaemon isn't starting with the following error:

[14:03:54] INFO: Starting AppDaemon...
s6-rc: info: service legacy-services successfully started
ERROR Error loading secrets file: /config/secrets.yaml
Traceback (most recent call last):
  File "/usr/bin/appdaemon", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/appdaemon/__main__.py", line 417, in main
    admain.main()
  File "/usr/lib/python3.11/site-packages/appdaemon/__main__.py", line 276, in main
    if "appdaemon" not in config:
       ^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable
[14:03:55] INFO: Service AppDaemon exited with code 1 (by signal 0)
frenck commented 9 months ago

@mplogas Did you restore the Home Assistant configuration backup as well? As stated in the above steps?

mplogas commented 9 months ago

@frenck Do you mean my configuration.yaml? Nope, I did not because a diff didn't show any changes. But I restored the entire /config/appdaemon folder. Please let me know if there is any other config that I may have missed.

default_config: 

homeassistant:
  packages: !include_dir_named integrations
  customize: !include_dir_merge_named customizations

Fortunately, I was able to fix my appdaemon with the help of @Jabe's comment. Thanks to both of you 🔥

smorvan commented 9 months ago

Also got caught in the middle of this.

AppDaemon runs, but I can not find the folder for the script. The '/config/apps/hello.py' does not exist, yet it seems to be running.

2023-11-15 14:41:35.742887 INFO AppDaemon: AppDaemon Version 4.4.2 starting 2023-11-15 14:41:35.743361 INFO AppDaemon: Python version is 3.11.6 2023-11-15 14:41:35.743799 INFO AppDaemon: Configuration read from: /config/appdaemon.yaml 2023-11-15 14:41:35.744232 INFO AppDaemon: Added log: AppDaemon 2023-11-15 14:41:35.744689 INFO AppDaemon: Added log: Error 2023-11-15 14:41:35.745079 INFO AppDaemon: Added log: Access 2023-11-15 14:41:35.745737 INFO AppDaemon: Added log: Diag 2023-11-15 14:41:36.135971 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin 2023-11-15 14:41:36.493927 INFO HASS: HASS Plugin Initializing 2023-11-15 14:41:36.494494 WARNING HASS: ha_url not found in HASS configuration - module not initialized 2023-11-15 14:41:36.494884 INFO HASS: HASS Plugin initialization complete 2023-11-15 14:41:36.495675 INFO AppDaemon: Initializing HTTP 2023-11-15 14:41:36.496320 INFO AppDaemon: Using 'ws' for event stream 2023-11-15 14:41:36.501553 INFO AppDaemon: Starting API 2023-11-15 14:41:36.505036 INFO AppDaemon: Starting Admin Interface 2023-11-15 14:41:36.505715 INFO AppDaemon: Starting Dashboards 2023-11-15 14:41:36.532836 INFO HASS: Connected to Home Assistant 2023.11.2 2023-11-15 14:41:36.553017 INFO AppDaemon: App 'hello_world' added 2023-11-15 14:41:36.555274 INFO AppDaemon: Found 1 active apps 2023-11-15 14:41:36.556605 INFO AppDaemon: Found 0 inactive apps 2023-11-15 14:41:36.557521 INFO AppDaemon: Found 0 global libraries 2023-11-15 14:41:36.558823 INFO AppDaemon: Starting Apps with 1 workers and 1 pins 2023-11-15 14:41:36.560691 INFO AppDaemon: Running on port 5050 2023-11-15 14:41:36.658924 INFO HASS: Evaluating startup conditions 2023-11-15 14:41:36.675833 INFO HASS: Startup condition met: hass state=RUNNING 2023-11-15 14:41:36.676301 INFO HASS: All startup conditions met 2023-11-15 14:41:36.708398 INFO AppDaemon: Got initial state from namespace default 2023-11-15 14:41:38.570616 INFO AppDaemon: Scheduler running in realtime 2023-11-15 14:41:38.576572 INFO AppDaemon: Adding /config/apps to module import path 2023-11-15 14:41:38.579903 INFO AppDaemon: Loading App Module: /config/apps/hello.py 2023-11-15 14:41:38.647188 INFO AppDaemon: Loading app hello_world using class HelloWorld from module hello 2023-11-15 14:41:38.649988 INFO AppDaemon: Calling initialize() for hello_world 2023-11-15 14:41:38.745538 INFO hello_world: Hello from AppDaemon 2023-11-15 14:41:38.747203 INFO hello_world: You are now ready to run Apps! 2023-11-15 14:41:38.749053 INFO AppDaemon: App initialization complete

Edit: I had to restart HA and it is now fine.

DEVIDTR commented 9 months ago

Works after restore and update, but HACS integration is still installing app daemon automations into config folder. How would they discover the new path to id_appdeamon. I just quickly looked into the HACS code and folder names are hard coded.

PeterAndreS commented 9 months ago

Anyone logs config in appdaemon.yaml.

logs:
  main_log:
    filename: /config/appdaemon/logs/appdaemon.log

What is the new log path? Still not working after the backup restore procedure. Filepath not updated in upgrade.

frenck commented 9 months ago

Change it to:

logs:
  main_log:
    filename: /config/logs/appdaemon.log
PeterAndreS commented 9 months ago

Change it to:

logs:
  main_log:
    filename: /config/logs/appdaemon.log

Finally all is running again as before with the new path: 🙂👍, Thanks for the support!

AlexZuiderwijk commented 9 months ago

Change it to:

logs:
  main_log:
    filename: /config/logs/appdaemon.log

Finally all is running again as before with the new path: 🙂👍, Thanks for the support!

This did not work for me, so changed it to:

logs:
  main_log:
    filename: /homeassistant/appdaemon.log

now I can see the main_log in the appdeamon UI..... but in the "HA add-on Appdeamon" interface (from where I can start/stop appdeamon) the only first lines of logging are visible..... probably until the logs: configuration is read from the config file?

Bit confusing for me how/where the log-files are (shold be) configured.

OliveFinch commented 9 months ago

I've had to uninstall this until there is a fix. I'm using Home Assistant Operating System on a VM on my Synology NAS so I'm not able to see all of the files on my installation using File editor. Only files in the "homeassistant/" folder and onwards. I'm still getting this error after totally uninstalling AppDaemon and reinstalling after reboots of HAOS:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service base-addon-banner: starting

-----------------------------------------------------------
 Add-on: AppDaemon
 Python Apps and Dashboard using AppDaemon 4.x for Home Assistant
-----------------------------------------------------------
 Add-on version: 0.15.2
 You are running the latest version of this add-on.
 System: Home Assistant OS 11.1  (amd64 / qemux86-64)
 Home Assistant Core: 2023.11.2
 Home Assistant Supervisor: 2023.11.3
-----------------------------------------------------------
 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-appdaemon: starting
s6-rc: info: service init-appdaemon successfully started
s6-rc: info: service appdaemon: starting
s6-rc: info: service appdaemon successfully started
s6-rc: info: service legacy-services: starting
[15:09:51] INFO: Starting AppDaemon...
s6-rc: info: service legacy-services successfully started
**ERROR Error loading secrets file: /config/secrets.yaml
Traceback (most recent call last):
  File "/usr/bin/appdaemon", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/appdaemon/__main__.py", line 417, in main
    admain.main()
  File "/usr/lib/python3.11/site-packages/appdaemon/__main__.py", line 276, in main
    if "appdaemon" not in config:
       ^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable**
[15:10:55] INFO: Service AppDaemon 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 appdaemon: stopping
s6-rc: info: service appdaemon successfully stopped
s6-rc: info: service init-appdaemon: stopping
s6-rc: info: service init-appdaemon 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
frenck commented 9 months ago

Bit confusing for me how/where the log-files are (shold be) configured.

You should not have to config logging at all, but default it will go into add-on logs.

PeterAndreS commented 9 months ago

Change it to:

logs:
  main_log:
    filename: /config/logs/appdaemon.log

Finally all is running again as before with the new path: 🙂👍, Thanks for the support!

This did not work for me, so changed it to:

logs:
  main_log:
    filename: /homeassistant/appdaemon.log

now I can see the main_log in the appdeamon UI..... but in the "HA add-on Appdeamon" interface (from where I can start/stop appdeamon) the only first lines of logging are visible..... probably until the logs: configuration is read from the config file?

Bit confusing for me how/where the log-files are (shold be) configured.

I updated all references i.e:

logs:
  main_log:
    filename: /config/logs/appdaemon.log
  error_log:
    filename: /config/logs/error.log
  access_log:
    filename: /config/logs/access.log
  diag_log:
    filename: /config/logs/diag.log
  testapp_log:
    name: TestApp
    filename: /config/logs/testmodule.log
  etc..
dersch81 commented 9 months ago

Hmm, after HA Backup restore and going from 0.14.x to 0.15.2 there is still the error.

After changing manually the secrets.yaml path it is starting. But i thought it will be fixed without manually fixing the path?

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service base-addon-banner: starting

-----------------------------------------------------------
 Add-on: AppDaemon
 Python Apps and Dashboard using AppDaemon 4.x for Home Assistant
-----------------------------------------------------------
 Add-on version: 0.15.2
 You are running the latest version of this add-on.
 System: Home Assistant OS 11.1  (amd64 / qemux86-64)
 Home Assistant Core: 2023.11.2
 Home Assistant Supervisor: 2023.11.3
-----------------------------------------------------------
 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-appdaemon: starting
s6-rc: info: service init-appdaemon successfully started
s6-rc: info: service appdaemon: starting
s6-rc: info: service appdaemon successfully started
s6-rc: info: service legacy-services: starting
[16:11:41] INFO: Starting AppDaemon...
s6-rc: info: service legacy-services successfully started
Traceback (most recent call last):
  File "/usr/bin/appdaemon", line 8, in <module>
ERROR Error loading secrets file: /config/secrets.yaml
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/appdaemon/__main__.py", line 417, in main
    admain.main()
  File "/usr/lib/python3.11/site-packages/appdaemon/__main__.py", line 276, in main
    if "appdaemon" not in config:
       ^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable
[16:11:44] INFO: Service AppDaemon 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 appdaemon: stopping
s6-rc: info: service appdaemon successfully stopped
s6-rc: info: service init-appdaemon: stopping
s6-rc: info: service init-appdaemon 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 base-addon-log-level successfully stopped
s6-rc: info: service fix-attrs 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`
bratanon commented 9 months ago

Why move the appdaemon folder at all?

To me that is a super bad decision as it makes my VCS not working, now I will have to either move the root up to include a bunch of other stuff that is not related to my config, and manually exclude them.

It also makes it hard to find the files, as I only have the config folder mounted on my regular machine.

frenck commented 9 months ago

Why move the appdaemon folder at all?

Because it is:

The latter is super important, as people now backup the add-on expecting the configuration to be in there (which it was not).

../Frenck

weltmeyer commented 9 months ago

I get another error after correcting the secrets.yaml path:

s6-rc: info: service legacy-services successfully started
2023-11-15 16:33:46.419637 WARNING HASS: ha_url not found in HASS configuration - module not initialized
2023-11-15 16:33:46.492393 WARNING AppDaemon: ------------------------------------------------------------
2023-11-15 16:33:46.493668 WARNING AppDaemon: Unexpected error loading config file: /config/apps/apps.yaml
2023-11-15 16:33:46.494009 WARNING AppDaemon: ------------------------------------------------------------
2023-11-15 16:33:46.498046 WARNING AppDaemon: Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/appdaemon/app_management.py", line 578, in read_config_file
    return utils.read_config_file(file)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/appdaemon/utils.py", line 586, in read_config_file
    return read_yaml_config(path)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/appdaemon/utils.py", line 722, in read_yaml_config
    config = yaml.load(config_file_contents, Loader=yaml.SafeLoader)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/yaml/__init__.py", line 81, in load
    return loader.get_single_data()
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/yaml/constructor.py", line 51, in get_single_data
    return self.construct_document(node)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/yaml/constructor.py", line 55, in construct_document
    data = self.construct_object(node)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/yaml/constructor.py", line 100, in construct_object
    data = constructor(self, node)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/yaml/constructor.py", line 427, in construct_undefined
    raise ConstructorError(None, None,
yaml.constructor.ConstructorError: could not determine a constructor for the tag '!include_dir_merge_list'
  in "<unicode string>", line 5, column 1:
    !include_dir_merge_list configur ... 
    ^

2023-11-15 16:33:46.498318 WARNING AppDaemon: ------------------------------------------------------------
2023-11-15 16:33:46.499036 WARNING AppDaemon: File '/config/apps/apps.yaml' invalid structure - ignoring

my apps.yaml consists of only this line: !include_dir_merge_list configurations

i have all configurations in the subfolder \addon_configs\a0d7b954_appdaemon\apps\configurations which worked before..

lakusz1github commented 9 months ago

After broken update to 15.1, bring it back to work with 14.0, but after update to 15.2 again it stops working:

Traceback (most recent call last): File "/usr/bin/appdaemon", line 8, in sys.exit(main()) ^^^^^^ File "/usr/lib/python3.11/site-packages/appdaemon/main.py", line 417, in main admain.main() File "/usr/lib/python3.11/site-packages/appdaemon/main.py", line 276, in main if "appdaemon" not in config: ^^^^^^^^^^^^^^^^^^^^^^^^^

frenck commented 9 months ago

@lakusz1github Please make sure you make the adjustments as listed in the release notes and here: https://github.com/hassio-addons/addon-appdaemon/issues/287#issuecomment-1812296334

bratanon commented 9 months ago
  • Not Home Assistant configuration

Well, while that statement is correct, I would guess that that are more users that uses appdaemon together with home assistant configs (data) then users that don't with this add-on. Either way, I'm not going to argue about this.

  • They will now be backed up as part of the add-on backup

That I didn't know, and it seems like a good feature.

essel-dev commented 9 months ago
  • Not Home Assistant configuration

Well, while that statement is correct, I would guess that that are more users that uses appdaemon together with home assistant configs (data) then users that don't with this add-on. Either way, I'm not going to argue about this.

  • They will now be backed up as part of the add-on backup

That I didn't know, and it seems like a good feature.

Why move the appdaemon folder at all?

To me that is a super bad decision as it makes my VCS not working, now I will have to either move the root up to include a bunch of other stuff that is not related to my config, and manually exclude them.

It also makes it hard to find the files, as I only have the config folder mounted on my regular machine.

How are you going to solve it? Having the same problem now and looking for the best/safest solution.

OliveFinch commented 9 months ago

I've just read the release notes about moving folders and need to roll back to 0.14 as I run HAOS that only allows File editor to see everything in /homeassistant/ onwards. Does anyone know how to roll back to 0.14?

bratanon commented 9 months ago

@essel-dev

How are you going to solve it? Having the same problem now and looking for the best/safest solution.

I don't know yet. One solution would be to create a new repo for the addons_config or for each sub folder in that. Another to move the VCS root (like I mentioned before) to include the whole hassio folder and then exclude 90% of everything.

But I have no idea right now. Just feeling sad that it seems like the HA community does not think of users that uses VCS and yaml anymore. Everything is GUI based and click-click-click now-a-days. I guess that is the best for the majority tho, but still makes me sad.

lakusz1github commented 9 months ago

@lakusz1github Please make sure you make the adjustments as listed in the release notes and here: #287 (comment)

first time not work, but i do the same second and now it works