Astrobinding throws an NullPointer error

Hi

I’m getting some strange error message in astrobinding on OH2 my guess is that I’m doing some stupoid misstake as usually when things won’t work. Hope anyone has som input for me.

2017-05-04 07:49:03.052 [ERROR] [org.quartz.core.JobRunShell ] - Job astro:sun:local.job-daily-startup-sun threw an unhandled Exception:
java.lang.NullPointerException
at org.eclipse.smarthome.binding.astro.internal.util.DateTimeUtils.applyConfig(DateTimeUtils.java:180)[218:org.eclipse.smarthome.binding.astro:0.9.0.201704261358]
at org.eclipse.smarthome.binding.astro.internal.job.AbstractDailyJob.scheduleEvent(AbstractDailyJob.java:71)[218:org.eclipse.smarthome.binding.astro:0.9.0.201704261358]
at org.eclipse.smarthome.binding.astro.internal.job.AbstractDailyJob.scheduleRange(AbstractDailyJob.java:58)[218:org.eclipse.smarthome.binding.astro:0.9.0.201704261358]
at org.eclipse.smarthome.binding.astro.internal.job.DailyJobSun.schedulePlanetEvents(DailyJobSun.java:35)[218:org.eclipse.smarthome.binding.astro:0.9.0.201704261358]
at org.eclipse.smarthome.binding.astro.internal.job.AbstractDailyJob.executeJob(AbstractDailyJob.java:47)[218:org.eclipse.smarthome.binding.astro:0.9.0.201704261358]
at org.eclipse.smarthome.binding.astro.internal.job.AbstractBaseJob.execute(AbstractBaseJob.java:40)[218:org.eclipse.smarthome.binding.astro:0.9.0.201704261358]
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)[105:org.eclipse.smarthome.core.scheduler:0.9.0.201704261358]
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)[105:org.eclipse.smarthome.core.scheduler:0.9.0.201704261358]

Perhaps you could show us your astro Things? Getting lat and long swapped to make an impossible location is easy to do.

did you read this: NPEs in Astro binding ?

.things

astro:sun:home [ geolocation=“58.32292,15.03335”, altitude=100, interval=60 ]

.items
DateTime Sunrise_Time “Sunrise [%1$tH:%1$tM]” { channel=“astro:sun:home:rise#start” }
DateTime Sunset_Time “Sunset [%1$tH:%1$tM]” { channel=“astro:sun:home:set#start” }

It seems like it collects the right position about where I am since I got sinrise times and so on but somethings seems to be missing. My problem occurs all the time when I start OH.

Obviously same problem here. But I found out that using my latitude (53.141020) while changing longitude from 7.6 to 7.5 (and all other values below) causes the error. Error occurs just after saving my things file.
7.6 is ok, 7.5 fails

I have the same problem with Astro.

My longitude is above 7.6

/Mike

From what I could understand there’s no reason to beleive that I would need to recreate my things since this is my first install off Astrobinding anda I’m on 2.1 snapshot and installed binding from paper UI. Also my longitude is high above 7 I’ve no idea really wath’s cuasding this but I’m alwasy interested in having a system running without errors.

Have same issue. Seem creating a identical astro entry with a new name doesn’t have the issue. I’m suspecting something cached from a previous version of openhab.

Scratch that. astro:moon didn’t log an error but astro:sun did.

Same for me. Receiving this error since two days. Maybe it is related to this PR #2208. The binding has moved to ESH repo.

2017-05-11 00:00:00.135 [ERROR] [org.quartz.core.JobRunShell         ] - Job astro:sun:local.job-daily-sun threw an unhandled Exception: 
java.lang.NullPointerException
        at org.openhab.binding.astro.internal.util.DateTimeUtils.applyConfig(DateTimeUtils.java:180)[276:org.openhab.binding.astro:2.1.0.201704251938]
        at org.openhab.binding.astro.internal.job.AbstractDailyJob.scheduleEvent(AbstractDailyJob.java:71)[276:org.openhab.binding.astro:2.1.0.2017042
51938]
        at org.openhab.binding.astro.internal.job.AbstractDailyJob.scheduleRange(AbstractDailyJob.java:58)[276:org.openhab.binding.astro:2.1.0.2017042
51938]
        at org.openhab.binding.astro.internal.job.DailyJobSun.schedulePlanetEvents(DailyJobSun.java:43)[276:org.openhab.binding.astro:2.1.0.2017042519
38]
        at org.openhab.binding.astro.internal.job.AbstractDailyJob.executeJob(AbstractDailyJob.java:47)[276:org.openhab.binding.astro:2.1.0.2017042519
38]
        at org.openhab.binding.astro.internal.job.AbstractBaseJob.execute(AbstractBaseJob.java:40)[276:org.openhab.binding.astro:2.1.0.201704251938]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:202)[105:org.eclipse.smarthome.core.scheduler:0.9.0.b4]
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)[105:org.eclipse.smarthome.core.scheduler:0.9.0.b4]
2017-05-11 00:00:00.139 [ERROR] [org.quartz.core.ErrorLogger         ] - Job (astro:sun:local.job-daily-sun threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.NullPointerException]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:213)[105:org.eclipse.smarthome.core.scheduler:0.9.0.b4]
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)[105:org.eclipse.smarthome.core.scheduler:0.9.0.b4]
Caused by: java.lang.NullPointerException
        at org.openhab.binding.astro.internal.util.DateTimeUtils.applyConfig(DateTimeUtils.java:180)[276:org.openhab.binding.astro:2.1.0.201704251938]
        at org.openhab.binding.astro.internal.job.AbstractDailyJob.scheduleEvent(AbstractDailyJob.java:71)[276:org.openhab.binding.astro:2.1.0.201704251938]
        at org.openhab.binding.astro.internal.job.AbstractDailyJob.scheduleRange(AbstractDailyJob.java:58)[276:org.openhab.binding.astro:2.1.0.201704251938]
        at org.openhab.binding.astro.internal.job.DailyJobSun.schedulePlanetEvents(DailyJobSun.java:43)[276:org.openhab.binding.astro:2.1.0.201704251938]
        at org.openhab.binding.astro.internal.job.AbstractDailyJob.executeJob(AbstractDailyJob.java:47)[276:org.openhab.binding.astro:2.1.0.201704251938]
        at org.openhab.binding.astro.internal.job.AbstractBaseJob.execute(AbstractBaseJob.java:40)[276:org.openhab.binding.astro:2.1.0.201704251938]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:202)[105:org.eclipse.smarthome.core.scheduler:0.9.0.b4]
        ... 1 more

Same here since a couple of days even after updating to the latest snapshot from yesterday, time for opening an issue?

2017-05-16 00:00:00.209 [ERROR] [org.quartz.core.JobRunShell         ] - Job astro:sun:shutterkitchen.job-daily-sun threw an unhandled Exception: 
java.lang.NullPointerException
	at org.eclipse.smarthome.binding.astro.internal.util.DateTimeUtils.applyConfig(DateTimeUtils.java:180)[187:org.eclipse.smarthome.binding.astro:0.9.0.201705120951]
	at org.eclipse.smarthome.binding.astro.internal.job.AbstractDailyJob.scheduleEvent(AbstractDailyJob.java:71)[187:org.eclipse.smarthome.binding.astro:0.9.0.201705120951]
	at org.eclipse.smarthome.binding.astro.internal.job.AbstractDailyJob.scheduleRange(AbstractDailyJob.java:58)[187:org.eclipse.smarthome.binding.astro:0.9.0.201705120951]
	at org.eclipse.smarthome.binding.astro.internal.job.DailyJobSun.schedulePlanetEvents(DailyJobSun.java:35)[187:org.eclipse.smarthome.binding.astro:0.9.0.201705120951]
	at org.eclipse.smarthome.binding.astro.internal.job.AbstractDailyJob.executeJob(AbstractDailyJob.java:47)[187:org.eclipse.smarthome.binding.astro:0.9.0.201705120951]
	at org.eclipse.smarthome.binding.astro.internal.job.AbstractBaseJob.execute(AbstractBaseJob.java:40)[187:org.eclipse.smarthome.binding.astro:0.9.0.201705120951]
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)[105:org.eclipse.smarthome.core.scheduler:0.9.0.201705120951]
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)[105:org.eclipse.smarthome.core.scheduler:0.9.0.201705120951]
2017-05-16 00:00:00.218 [ERROR] [org.quartz.core.ErrorLogger         ] - Job (astro:sun:shutterkitchen.job-daily-sun threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.NullPointerException]
	at org.quartz.core.JobRunShell.run(JobRunShell.java:213)[105:org.eclipse.smarthome.core.scheduler:0.9.0.201705120951]
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)[105:org.eclipse.smarthome.core.scheduler:0.9.0.201705120951]
Caused by: java.lang.NullPointerException
	at org.eclipse.smarthome.binding.astro.internal.util.DateTimeUtils.applyConfig(DateTimeUtils.java:180)[187:org.eclipse.smarthome.binding.astro:0.9.0.201705120951]
	at org.eclipse.smarthome.binding.astro.internal.job.AbstractDailyJob.scheduleEvent(AbstractDailyJob.java:71)[187:org.eclipse.smarthome.binding.astro:0.9.0.201705120951]
	at org.eclipse.smarthome.binding.astro.internal.job.AbstractDailyJob.scheduleRange(AbstractDailyJob.java:58)[187:org.eclipse.smarthome.binding.astro:0.9.0.201705120951]
	at org.eclipse.smarthome.binding.astro.internal.job.DailyJobSun.schedulePlanetEvents(DailyJobSun.java:35)[187:org.eclipse.smarthome.binding.astro:0.9.0.201705120951]
	at org.eclipse.smarthome.binding.astro.internal.job.AbstractDailyJob.executeJob(AbstractDailyJob.java:47)[187:org.eclipse.smarthome.binding.astro:0.9.0.201705120951]
	at org.eclipse.smarthome.binding.astro.internal.job.AbstractBaseJob.execute(AbstractBaseJob.java:40)[187:org.eclipse.smarthome.binding.astro:0.9.0.201705120951]
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)[105:org.eclipse.smarthome.core.scheduler:0.9.0.201705120951]
	... 1 more

Same here:

2017-05-16 00:00:00.219 [ERROR] [org.quartz.core.JobRunShell ] - Job astro:sun:5d939aab.job-daily-sun threw an unhandled Exception:
java.lang.NullPointerException
at org.openhab.binding.astro.internal.util.DateTimeUtils.applyConfig(DateTimeUtils.java:180)[201:org.openhab.binding.astro:2.1.0.201704170008]
at org.openhab.binding.astro.internal.job.AbstractDailyJob.scheduleEvent(AbstractDailyJob.java:71)[201:org.openhab.binding.astro:2.1.0.201704170008]
at org.openhab.binding.astro.internal.job.AbstractDailyJob.scheduleRange(AbstractDailyJob.java:58)[201:org.openhab.binding.astro:2.1.0.201704170008]
at org.openhab.binding.astro.internal.job.DailyJobSun.schedulePlanetEvents(DailyJobSun.java:43)[201:org.openhab.binding.astro:2.1.0.201704170008]
at org.openhab.binding.astro.internal.job.AbstractDailyJob.executeJob(AbstractDailyJob.java:47)[201:org.openhab.binding.astro:2.1.0.201704170008]
at org.openhab.binding.astro.internal.job.AbstractBaseJob.execute(AbstractBaseJob.java:40)[201:org.openhab.binding.astro:2.1.0.201704170008]
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)[105:org.eclipse.smarthome.core.scheduler:0.9.0.201704011656]
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)[105:org.eclipse.smarthome.core.scheduler:0.9.0.201704011656]
2017-05-16 00:00:00.224 [ERROR] [org.quartz.core.ErrorLogger ] - Job (astro:sun:5d939aab.job-daily-sun threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.NullPointerException]
at org.quartz.core.JobRunShell.run(JobRunShell.java:213)[105:org.eclipse.smarthome.core.scheduler:0.9.0.201704011656]
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)[105:org.eclipse.smarthome.core.scheduler:0.9.0.201704011656]
Caused by: java.lang.NullPointerException
at org.openhab.binding.astro.internal.util.DateTimeUtils.applyConfig(DateTimeUtils.java:180)[201:org.openhab.binding.astro:2.1.0.201704170008]
at org.openhab.binding.astro.internal.job.AbstractDailyJob.scheduleEvent(AbstractDailyJob.java:71)[201:org.openhab.binding.astro:2.1.0.201704170008]
at org.openhab.binding.astro.internal.job.AbstractDailyJob.scheduleRange(AbstractDailyJob.java:58)[201:org.openhab.binding.astro:2.1.0.201704170008]
at org.openhab.binding.astro.internal.job.DailyJobSun.schedulePlanetEvents(DailyJobSun.java:43)[201:org.openhab.binding.astro:2.1.0.201704170008]
at org.openhab.binding.astro.internal.job.AbstractDailyJob.executeJob(AbstractDailyJob.java:47)[201:org.openhab.binding.astro:2.1.0.201704170008]
at org.openhab.binding.astro.internal.job.AbstractBaseJob.execute(AbstractBaseJob.java:40)[201:org.openhab.binding.astro:2.1.0.201704170008]
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)[105:org.eclipse.smarthome.core.scheduler:0.9.0.201704011656]
… 1 more

I am still running a version of the binding from before the move to the eclipse smarthome repository. The error seems to have been there all the time already.
Further to this, I also notice some of the channel triggers are missing. I only noticed the Nullpointer Exception when investigated one of my rules where the 'astro:sun:5d939aab:daylight#event' was not triggered while the 'astro:sun:5d939aab:rise#event' was.

Further analysis of the event logs shows the following over a 24h period with one defined sun thing:

2017-05-15 00:21:00.006 [ChannelTriggeredEvent ] - astro:sun:5d939aab:morningNight#event triggered START
2017-05-15 02:57:00.011 [ChannelTriggeredEvent ] - astro:sun:5d939aab:morningNight#event triggered END
2017-05-15 02:57:00.011 [ChannelTriggeredEvent ] - astro:sun:5d939aab:astroDawn#event triggered START
2017-05-15 04:17:00.006 [ChannelTriggeredEvent ] - astro:sun:5d939aab:astroDawn#event triggered END
2017-05-15 04:17:00.009 [ChannelTriggeredEvent ] - astro:sun:5d939aab:nauticDawn#event triggered START
2017-05-15 05:13:00.006 [ChannelTriggeredEvent ] - astro:sun:5d939aab:nauticDawn#event triggered END
2017-05-15 05:13:00.012 [ChannelTriggeredEvent ] - astro:sun:5d939aab:civilDawn#event triggered START
2017-05-15 05:54:00.007 [ChannelTriggeredEvent ] - astro:sun:5d939aab:rise#event triggered START
2017-05-15 05:54:00.011 [ChannelTriggeredEvent ] - astro:sun:5d939aab:civilDawn#event triggered END
2017-05-15 05:58:00.005 [ChannelTriggeredEvent ] - astro:sun:5d939aab:rise#event triggered END
2017-05-15 13:41:00.005 [ChannelTriggeredEvent ] - astro:sun:5d939aab:noon#event triggered START
2017-05-15 13:42:00.005 [ChannelTriggeredEvent ] - astro:sun:5d939aab:noon#event triggered END
2017-05-15 21:24:00.003 [ChannelTriggeredEvent ] - astro:sun:5d939aab:set#event triggered START
2017-05-15 21:28:00.006 [ChannelTriggeredEvent ] - astro:sun:5d939aab:set#event triggered END
2017-05-15 21:28:00.010 [ChannelTriggeredEvent ] - astro:sun:5d939aab:civilDusk#event triggered START
2017-05-15 22:09:00.008 [ChannelTriggeredEvent ] - astro:sun:5d939aab:civilDusk#event triggered END
2017-05-15 22:09:00.010 [ChannelTriggeredEvent ] - astro:sun:5d939aab:nauticDusk#event triggered START
2017-05-15 23:04:00.006 [ChannelTriggeredEvent ] - astro:sun:5d939aab:astroDusk#event triggered START
2017-05-15 23:04:00.006 [ChannelTriggeredEvent ] - astro:sun:5d939aab:nauticDusk#event triggered END

I believe this should also contain events for: astroDusk END, night, eveningNight and daylight. Or am I missing something?

I created an issue ticket:

Fix was merged and should be available in the next snapshot build:

Thx to the maintainers and developers for the outstanding support!

I installed the latest snapshot (openHAB 2.1.0~20170520012220-1 (Build #922)) but the NPEs thrown by astro binding got even worse:

2017-05-21 12:20:41.937 [ERROR] [.core.internal.folder.FolderObserver] - Error handling update of file '/etc/openhab2/things/astro.things': null.
2017-05-21 12:20:44.801 [ERROR] [org.quartz.core.JobRunShell         ] - Job astro:sun:minus15.job-daily-startup-sun threw an unhandled Exception:
2017-05-21 12:20:44.809 [ERROR] [org.quartz.core.ErrorLogger         ] - Job (astro:sun:minus15.job-daily-startup-sun threw an exception.
2017-05-21 12:20:44.806 [ERROR] [org.quartz.core.JobRunShell         ] - Job astro:sun:home.job-daily-startup-sun threw an unhandled Exception:
2017-05-21 12:20:44.826 [ERROR] [org.quartz.core.ErrorLogger         ] - Job (astro:sun:home.job-daily-startup-sun threw an exception.
2017-05-21 12:20:44.894 [ERROR] [org.quartz.core.JobRunShell         ] - Job astro:sun:minus45.job-daily-startup-sun threw an unhandled Exception:
2017-05-21 12:20:44.913 [ERROR] [org.quartz.core.ErrorLogger         ] - Job (astro:sun:minus45.job-daily-startup-sun threw an exception.
2017-05-21 12:20:45.006 [ERROR] [org.quartz.core.JobRunShell         ] - Job astro:sun:minus60.job-daily-startup-sun threw an unhandled Exception:
2017-05-21 12:20:45.008 [ERROR] [org.quartz.core.JobRunShell         ] - Job astro:sun:minus30.job-daily-startup-sun threw an unhandled Exception:
2017-05-21 12:20:45.013 [ERROR] [org.quartz.core.ErrorLogger         ] - Job (astro:sun:minus60.job-daily-startup-sun threw an exception.
2017-05-21 12:20:45.014 [ERROR] [org.quartz.core.ErrorLogger         ] - Job (astro:sun:minus30.job-daily-startup-sun threw an exception.
2017-05-21 12:20:45.070 [ERROR] [org.quartz.core.JobRunShell         ] - Job astro:sun:plus15.job-daily-startup-sun threw an unhandled Exception:
2017-05-21 12:20:45.072 [ERROR] [org.quartz.core.JobRunShell         ] - Job astro:sun:plus30.job-daily-startup-sun threw an unhandled Exception:
2017-05-21 12:20:45.077 [ERROR] [org.quartz.core.ErrorLogger         ] - Job (astro:sun:plus15.job-daily-startup-sun threw an exception.
2017-05-21 12:20:45.077 [ERROR] [org.quartz.core.ErrorLogger         ] - Job (astro:sun:plus30.job-daily-startup-sun threw an exception.
2017-05-21 12:20:45.109 [ERROR] [org.quartz.core.JobRunShell         ] - Job astro:sun:plus60.job-daily-startup-sun threw an unhandled Exception:
2017-05-21 12:20:45.109 [ERROR] [org.quartz.core.JobRunShell         ] - Job astro:sun:plus45.job-daily-startup-sun threw an unhandled Exception:
2017-05-21 12:20:45.111 [ERROR] [org.quartz.core.ErrorLogger         ] - Job (astro:sun:plus60.job-daily-startup-sun threw an exception.
2017-05-21 12:20:45.114 [ERROR] [org.quartz.core.ErrorLogger         ] - Job (astro:sun:plus45.job-daily-startup-sun threw an exception.

I’m on the latest snapshot and seeing something similar

2017-05-21 11:40:11.721 [ERROR] [org.quartz.core.JobRunShell ] - Job astro:sun:local.job-daily-startup-sun threw an unhandled Exception:
java.lang.NullPointerException

Followed by a traceback.

Unfortunatly, same here :frowning:
Details:
Longitude: 8.831103
Build: #922
Binding: 0.9.0.201705120951 | Astro Binding

Errors:
astro:sun:local:daylight#event not firing any more (last enrty is from 18.05.2017)
Log:

2017-05-21 00:00:00.083 [ERROR] [org.quartz.core.ErrorLogger         ] - Job (astro:sun:local.job-daily-sun threw an exception

The problem is, that the astro-binding has moved to the esh-repo and it look like that the binding is is not rebuilded with the the last snapshots. It is still on version 201700512.

The real problem is that in lower latitudes it is not possible to calculate dark-night and astro-dusk. A workaround is to lower the latitude to values lower then 50 … I set my latitude in the Monent to 45 and than all values can be calculated and the NPE has gone. That is only a workaround since the fix is moved to the snapshot.

You can look at : http://suncalc.net

Here you can see, if you lower the latitude how the values move to n/a if you go right to north

Yepp, now I see:

Moving my house from the northern part of Germany to the northern part of Italy did the trick :sob:
So let’s wait for the fix make it into the binding …
What I don’t understand though: @FrankR and @GallaS are reporting having the latest snapshot (20170520), why did the fix not make it into that version?