After cache clear: Failed to execute script: TypeError: Cannot read property " publishMQTT" from null

Continuing the discussion from Error on a rule only after I clear the cache of openhab:

I do observe the same; it has been introduced in openHAB 5. I have never seen that with v4.3*

Saving the rule resolves the issue for that specific rule. I do have similar statements in other rules. Those need to be re-saved as well. Interestingly it seems that the first publish statement is successful. The error is on the 2nd - if line numbering in log is correct #3 generates the error.

1  var mqttActions = actions.get(“mqtt”,“mqtt:broker:95cffa8cf1”)
2  mqttActions.publishMQTT(“ebusd/mc/TempDesired/get”,“”)
3  mqttActions.publishMQTT(“ebusd/bai/FanSpeed/get”, “”)

I recall that with first release of 5.0 similar issues has been commented elsewhere: save the rule resolves the issue.