OH 2.5.8 java exception Astro Binding

Just noticed this in OH Log
Not sure if relevant with upcomming OH3, but it’s some sort of issue in Astro Binding I think.

2020-12-21 14:08:55.679 [ERROR] [o.internal.handler.AstroThingHandler] - Can't update state for channel astro:sun:home:season#timeLeft : null
java.lang.reflect.InvocationTargetException: null
        at sun.reflect.GeneratedMethodAccessor173.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_252]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_252]
        at org.openhab.binding.astro.internal.util.PropertyUtils.getPropertyValue(PropertyUtils.java:92) ~[bundleFile:?]
        at org.openhab.binding.astro.internal.util.PropertyUtils.getPropertyValue(PropertyUtils.java:94) ~[bundleFile:?]
        at org.openhab.binding.astro.internal.util.PropertyUtils.getPropertyValue(PropertyUtils.java:81) ~[bundleFile:?]
        at org.openhab.binding.astro.internal.util.PropertyUtils.getState(PropertyUtils.java:54) ~[bundleFile:?]
        at org.openhab.binding.astro.internal.handler.AstroThingHandler.publishChannelIfLinked(AstroThingHandler.java:180) [bundleFile:?]
        at org.openhab.binding.astro.internal.handler.AstroThingHandler.publishPlanet(AstroThingHandler.java:161) [bundleFile:?]
        at org.openhab.binding.astro.internal.handler.SunHandler.publishPositionalInfo(SunHandler.java:73) [bundleFile:?]
        at org.openhab.binding.astro.internal.job.PositionalJob.run(PositionalJob.java:43) [bundleFile:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_252]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:1.8.0_252]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_252]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:1.8.0_252]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_252]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_252]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_252]
Caused by: java.lang.NullPointerException
        at org.openhab.binding.astro.internal.model.Season.getTimeLeft(Season.java:132) ~[?:?]
        ... 18 more

It seems it can’t handle day when season is changing (today) rest of the days are without any errors

it is doing this item

Number          SeasonLeft      "Days till next season [%.0f days]" <none>          { channel = "astro:sun:home:season#timeLeft" }
``

2.5.3 is so old it may have already been resolved before the current 2.5.11.

Looks like a bug that still exists. Also NextSeason will fail. Both will fail till the end of the year due to bad implementation in DateTimeUtils.getNext in astro binding. Can you fill a GitHub bug for this?

1 Like

done, thanks!

1 Like

one detail:
is there a reason why

Number          SeasonLeft      "Days till next season [%.0f days]" <none>          { channel = "astro:sun:home:season#timeLeft" }

is not limited to whole days (or maybe 2-3decimals by binding?

SeasonLeft changed from 66.77602957175925925925925925925926 to 66.77255731481481481481481481481481

I mean … it’s changing almost every minute or so, which is granularity not really necessary for anything (as far as I can tell)

btw in OH3.2
the bug with next season across new year is still present.