Error from Astral started occurring every 2 seconds on Appdaemon 4

I updated to Appdaemon 4.0 a few weeks ago, and after making some code adjustments, everything worked fine. Until last evening (2/23/2020). Every two seconds, the following started popping up in the appdaemon log (not the error log):

2020-02-23 20:40:44.096869 INFO AppDaemon: AppDaemon Version 4.0.1 starting
2020-02-23 20:40:44.097370 INFO AppDaemon: Python version is 3.8.1
2020-02-23 20:40:44.097856 INFO AppDaemon: Configuration read from: /config/appdaemon/appdaemon.yaml
2020-02-23 20:40:44.098330 INFO AppDaemon: Added log: AppDaemon
2020-02-23 20:40:44.098797 INFO AppDaemon: Added log: Error
2020-02-23 20:40:44.099235 INFO AppDaemon: Added log: Access
2020-02-23 20:40:44.099668 INFO AppDaemon: Added log: Diag
2020-02-23 20:40:44.137060 WARNING AppDaemon: ------------------------------------------------------------
2020-02-23 20:40:44.137695 WARNING AppDaemon: Unexpected error during run()
2020-02-23 20:40:44.141118 WARNING AppDaemon: ------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/__main__.py", line 117, in run
    self.AD = ad.AppDaemon(self.logging, loop, **appdaemon)
  File "/usr/lib/python3.8/site-packages/appdaemon/appdaemon.py", line 188, in __init__
    self.sched = scheduler.Scheduler(self)
  File "/usr/lib/python3.8/site-packages/appdaemon/scheduler.py", line 54, in __init__
    self.init_sun()
  File "/usr/lib/python3.8/site-packages/appdaemon/scheduler.py", line 187, in init_sun
    self.location = astral.Location((
AttributeError: module 'astral' has no attribute 'Location'
2020-02-23 20:40:44.143222 INFO AppDaemon: Previous message repeated 1 times
2020-02-23 20:40:44.143631 INFO AppDaemon: AppDaemon Exited

I rolled everything back to AD 3, which I know wasn’t ideal, but it was time to go to bed and nothing worked.

I just noticed that @frenck posted an update to pin Astral package to 1.10.1

Will that solve the issue? I don’t want to go back to AD 4.0 unless this is fixed.

Just read through this and looks like it’s fixed. I’ll update AD 4 and try this in a bit. Looks like this is a solid fix. Thanks, @frenck, for jumping on this so quickly!

Yeah it was fixed pretty quick not before I missed up a snapshot restore and bricked my system

Ughhhh!! That’s kind of scary. I haven’t tried the snapshot restore yet. I back up the entire config folder after every change, and then use that to rebuild the system if needed (which is how I went back to AD 3).

Caps lock was on when I set the password, I restored it with an incorrect password and it fried everything.
Had to start from scratch.

if only you waited that 5 minutes instead of panicking eh? Or you could have just added the astral package as someone suggested… anyway, I would never roll back a snapshot like that 5 minutes after getting an error… or maybe you need appdaemon much more than I do…

Yep really wish I’d waited 5 minutes, when you have guests and no lights coming on you start to panic.
Although it have me something to do until 3am

1 Like

I am very dependent on AD. This happened about the time we were going to bed, and we couldn’t turn on lights or the TV (without going to the actual switches, which of course just isn’t right :slight_smile:).