Ephemeris DSL rules no longer work / how to troubleshoot?

runtimeInfo:
version: 3.1.0.M3
buildString: Milestone Build
locale: en-US
systemInfo:
configFolder: /etc/openhab
userdataFolder: /var/lib/openhab
logFolder: /var/log/openhab
javaVersion: 11.0.10
javaVendor: Azul Systems, Inc.
javaVendorVersion: Zulu11.45+27-CA
osName: Linux
osVersion: 5.10.17-v7l+
osArchitecture: arm
availableProcessors: 4
freeMemory: 11529208
totalMemory: 324403200

trying to run this simple rule:

rule "test ephemeris rule"
when
   Item T_TestSwitchX received command ON
then
    V_NextHoliday.postUpdate(Ephemeris.isBankHoliday())
end

and get these results:

2021-04-23 20:32:27.310 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'test-1' failed: null in test
2021-04-23 20:32:27.745 [INFO ] [openhab.event.ChannelTriggeredEvent ] - logreader:reader:openhablog:newErrorEvent triggered 2021-04-23 20:32:27.310 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'test-1' failed: null in test
2021-04-23 20:32:27.751 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'logreaderLastError' changed from 2021-04-23 20:31:54.357 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'test-1' failed: null in test to 2021-04-23 20:32:27.310 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'test-1' failed: null in test

It must have stopped working at some point before the last holiday, but I’ve had it in the back of my mind that Ephemeris stopped working at some point but it hasn’t been critical to my workflow, but will be come summer. I can go check logs to confirm, but can’t seem to figure out how to test/reset/confirm how it should work. I don’t think the developer toolbar can parse Ephemeris functions (they all error out).

Any tips on how to test basic Ephemeris functionality?

Sure that the Ephemeris call is the problem ? What if V_NextHoliday is null ?
I suggest you put the current line into a comment and just add a loginfo row to print out the result of the ephemeris function call. If that one fails, too the problem indeed is with that function call.

Doesn’t Ephemeris.isBankHoliday() return a true/false boolean?
Is that ever acceptable as postUpdate content, whatever the mystery Item type?

V_NextHoliday has data from the last time it successfully changed.
I left both postUpdate and sendCommand fail

isBankHoliday is a remnant of testing… it was originally:

Ephemeris.getNextBankHoliday()

I tried changing the logging but didn’t see any new info at TRACE, and thus removed the bundle from the console. However, I am unable to reinstall it. Maybe a bad, pre-caffeine, action:

openhab> bundle:install org.openhab.core.ephemeris
Bundle IDs:
Error executing command: Error installing bundles:
	Unable to install bundle org.openhab.core.ephemeris: org.osgi.framework.BundleException: Error reading bundle content.
openhab>

Rebooting now…

Experimenting is fine,but trying random stuff less productive.
Conduct experiments one step at a time;
someItem.postUpdate(someStuff)
“doesn’t work”. What exactly is this someStuff? Find out before trying to do things with it. Use temporary logging to find out.

Got Ephemeris reinstalled.

That snippet of code was part of a much larger code block that slowly got trimmed down as far as I thought was necessary for debugging.

Code without a boolean still yields the same errors above:

rule "test ephemeris rule"
when
   Item T_TestSwitchX received command ON
then
    V_NextHoliday.postUpdate(Ephemeris.getNextBankHoliday())
end

with both sendCommand and postUpdate.

under closer inspection, there is an ephemeris issue early in startup:

2021-04-24 07:47:54.694 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Time zone set to 'America/New_York'.
2021-04-24 07:47:54.700 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Location set to '42.5000,-70.8578'.
2021-04-24 07:47:54.704 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Locale set to 'en_US'.
2021-04-24 07:47:54.860 [ERROR] [org.openhab.core.ephemeris          ] - bundle org.openhab.core.ephemeris:3.0.2 (143)[org.openhab.ephemeris(61)] : The activate method has thrown an exception
2021-04-24 07:47:54.936 [ERROR] [org.openhab.core.ephemeris          ] - bundle org.openhab.core.ephemeris:3.0.2 (143)[org.openhab.ephemeris(61)] : The activate method has thrown an exception
2021-04-24 07:47:54.954 [ERROR] [org.openhab.core.ephemeris          ] - bundle org.openhab.core.ephemeris:3.0.2 (143)[org.openhab.ephemeris(61)] : The activate method has thrown an exception
2021-04-24 07:47:56.407 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'basement.sitemap'

I do not get any additional details from having log set to TRACE for ephemeris when running my DSL rule so maybe it is failing at startup?

The trouble with posting snippets that could never have worked is that it distracts potential helpers from your real problems.

At the moment, you don’t know if getNextBankHoliday returns anything at all, or just something unsuitable to update that type of Item. Why not find out?

logInfo(“test”, "returns " + Ephemeris.getNextBankHoliday().toString)

It might well be that it’s broke, but you won’t find out from updating an Item.

Thanks @rossko57 - I thought I had mentioned above that logging the result of the ephemeris command yields the same errors in the logs - no new information…

rule "test ephemeris rule"
when
   Item T_TestSwitchX received command ON
then
    logInfo("Results:", Ephemeris.getNextBankHoliday().toString)
end

The bundle stays in Waiting status. I get this error when I restart it.

2021-04-24 10:26:19.497 [ERROR] [org.openhab.core.ephemeris          ] - bundle org.openhab.core.ephemeris:3.1.0.M3 (143)[org.openhab.ephemeris(365)] : The activate method has thrown an exception
java.lang.IllegalArgumentException: No enum constant java.time.DayOfWeek.""""( "MONDAY"

I don’t have a MONDAY anywhere in my MainUI ephemeris config, that I can see. And I’ve deleted the textual config.

Working from this thread now to troubleshoot:

Welp, not sure how it resolved, but I restored the backup of the textual config file I disabled last night, and restarted the bundle and all is working. Not 100% sure when it stopped working (sometime between presidents day and patriots day, a Massachusetts holiday) but it is back and working now.

Thanks for everyone’s help, and hopefully if anyone runs into this something in the thread helps them troubleshoot.