Astro Moon Stopped Working. Error: Handler for Moon events

I recently had to rebuild a server because of a hardware failure (OH 4.0.3), and am running into several issues after restoring. That said…

My Astro Moon items are not working, with the following error:
Cannot invoke “java.util.Calendar.before(Object)” because “cCal” is null

All date-related items are NULL, and while other items are populated (likely due to restore on startup), they all have an Error:Handler error.

Astro Sun items are fine. I’m not sure where to being tracing this issue down.

I cleared the cache and restarted - same issue. I’m hoping a Java expert will have a feel for the handler error…

Error:Handler errors usually come from the Thing. And it’s not clear if you are mixing up nomenclature. Are you looking at Items or Things? They are different.

If all your Things are in an error state the first thing I would do is stop OH, clear the cache and restart. Give OH time to download and reinstall all the add-ons. Sometimes a restart after that is prudent too.

If the Things are still in error, come back with errors you see in the logs.

1 Like

Thanks for the response. I actually figured out the problem - which may be a rare issue, so I didn’t document the fix.

Just in case it helps someone… My OH implementation is in a VM in Proxmox. I had two SDDs fail at the same time in a RAID 1 (nice, huh…) without warning, and the entire box went down. So I had to rebuild everything, but I had VM snapshots available.

It was a few days before everything went back up. When I restored the OH VM image, it was of course, a few days behind actual time.

That’s when the Astro Moon Thing started having problems. Nothing was working, and there’s a Time of Day item based on Moonrise - that cause lots of rules to break due to that item showing NULL. That was the root period of my question. After working with the system for a while, I realized the OH VM clock was almost 2 minutes behind everything other system - all systems sync to a local NTP server. So, in the end, I had to work out issues with timesyncd (ultimately replacing it with chronyd), and then everything started working again when the system clock caught up (while clocks were syncing, I unlinked all items that were NULL, and then when the binding came back online, I relinked them).

So I figure this is a complexity in the Astro binding where it needs a high degree of time accuracy with NTP. However, it’s such an odd case that I figured it may not be helpful to anyone. In the process, of debugging, I found an old thread I had put up regarding a similar issue with the Astro binding when the clock was off (I had forgotten entirely about it). Nonetheless, the moral of the story is that if Astro is throwing problems, check your clock and make sure everything is in sync…

Thanks for checking in on it, though. I appreciate it that someone is willing to chime in to try to help! Great community…