getActions for pushover returns empty object / error

I am running Openhabian 3.4.2 release build on Raspberry P4. After a reboot I needed to setup my complete system. Now pushover doest not work anymore.
I was once succesful by removing the binding, the thing, the app key from pushover and set it up again. Now after another restart, the same again with the difference that I cannot fix it. I am kind of desperate since I am leaving for some weeks and pushover notifications are kind of crucial.

Test rule to trigger a sent:

rule "test" 
when 
    Item test received command 
then 
    val pushoverActions = getActions("pushover", "pushover:pushover-account:84bda6ce6d")
    pushoverActions.sendPriorityMessage("Test", 2)
end

Log Entry
2023-04-01 14:51:26.779 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'automation-1' failed: An error occurred during the script execution: index=3, size=3 in automation

Thing:

I have no glue what is going on… any help is highly appreciated.

Set the DEBUG level to DEBUG for openhab.core which returned:

2023-04-01 18:54:39.604 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'test' received command ON
==> /var/log/openhab/openhab.log <==
2023-04-01 18:54:39.607 [DEBUG] [or.internal.metrics.EventCountMetric] - Received event on topic openhab/items/test/command.
2023-04-01 18:54:39.608 [DEBUG] [ab.core.internal.items.ExpireManager] - Item test will expire (with 'OFF' state) in PT30S ms
2023-04-01 18:54:39.609 [DEBUG] [or.internal.metrics.EventCountMetric] - Received event on topic openhab/items/test/state.
2023-04-01 18:54:39.610 [DEBUG] [d4j.internal.RRD4jPersistenceService] - Stored 'test' as value '0.0' in rrd4j database (again)
2023-04-01 18:54:39.610 [DEBUG] [.monitor.internal.metrics.RuleMetric] - Rule automation-1 RUNNING - updating metric.
2023-04-01 18:54:39.611 [DEBUG] [d4j.internal.RRD4jPersistenceService] - Stored 'test' as value '1.0' in rrd4j database
2023-04-01 18:54:39.615 [DEBUG] [ab.core.internal.items.ExpireManager] - Item test will expire (with 'OFF' state) in PT30S ms
2023-04-01 18:54:39.613 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'automation-1' failed: An error occurred during the script execution: index=2, size=2 in automation
javax.script.ScriptException: An error occurred during the script execution: index=2, size=2 in automation
	at org.openhab.core.model.script.runtime.internal.engine.DSLScriptEngine.eval(DSLScriptEngine.java:139) ~[?:?]
	at org.openhab.core.automation.module.script.internal.handler.ScriptActionHandler.lambda$0(ScriptActionHandler.java:71) ~[?:?]
	at java.util.Optional.ifPresent(Optional.java:183) [?:?]
	at org.openhab.core.automation.module.script.internal.handler.ScriptActionHandler.execute(ScriptActionHandler.java:68) [bundleFile:?]
	at org.openhab.core.automation.internal.RuleEngineImpl.executeActions(RuleEngineImpl.java:1180) [bundleFile:?]
	at org.openhab.core.automation.internal.RuleEngineImpl.runRule(RuleEngineImpl.java:989) [bundleFile:?]
	at org.openhab.core.automation.internal.TriggerHandlerCallbackImpl$TriggerData.run(TriggerHandlerCallbackImpl.java:89) [bundleFile:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:829) [?:?]
2023-04-01 18:54:39.617 [DEBUG] [e.automation.internal.RuleEngineImpl] - The rule 'automation-1' is executed.

Nothing I can get out of that…
Restarted Openhab as well and also tried to change val to var … no effects

What I get out of it is that you have an array, list, or set with two elements. Since these are all 0 index based (the first element is at index 0) obviously there is no element 2 in a 2 element array.

I see that it’s the first rule in the file automation.rules and it’s Rules DSL.

Given the code that points to the call to the action. Looking at the docs, sendPriorityMessage appears to take three arguments, not just two. The message, a title, and finally the priority.

Thanks a lot Rich, you made my day. After fixing my original issue which was caused by storing the pushaction in a global final variable (leading to occasional nulls), I tried to test it with the rule I posted and just introduced this new issue.