OH3: after migration old rules are full of errors (authorization failed, array element type mismatch...)

After migration 2.5.11 --> 3.0 I have a lot of error on my rules and I don’t understand how debug the problems, for example I have error

Script execution of rule with UID ‘system_status-1’ failed: An error occurred during the script execution: array element type mismatch in system_status

in a very old rule copied from a post about RPI3…

rule “CPU Temp Update”
when
Time cron “0 */1 * * * ?”
then
var resp = executeCommandLine(“cat /sys/class/thermal/thermal_zone0/temp”, 1000)
var cpu_temp = transform(“JS”, “milli.js”, resp)
postUpdate(CPU_Temp, cpu_temp)
end

Where is the mismatch?

and another type of error:

Script execution of rule with UID ‘casa-3’ failed: authorization failed in casa

in another rule copied from a post some year ago

rule “Update max and min temperatures”
when
Item Weather_OWM_TemperatureB changed or
Time cron “0 */30 * * * ?” or
System started
then
postUpdate(Weather_Temp_Max, Weather_OWM_TemperatureB.maximumSince(now.withHour(0).withMinute(0).withSecond(0)))
postUpdate(Weather_Temp_Min, Weather_OWM_TemperatureB.minimumSince(now.withHour(0).withMinute(0).withSecond(0)))
logInfo(“Weather”, “Temperature evolved of " + Weather_OWM_TemperatureB.deltaSince(now.minusMinutes(30)) + " degrees.”)
end

I’m going crazy
Can someone give me some indication?
How can I understand my errors?

thanks
Ale

  • Platform information:
    • Hardware: PI4/4G/32G

    • OS: openhabian

    • Java Runtime Environment: _openjdk version “11.0.9” 2020-10-20 LTS
      OpenJDK Runtime Environment Zulu11.43+88-CA (build 11.0.9+11-LTS)
      OpenJDK Client VM Zulu11.43+88-CA (build 11.0.9+11-LTS, mixed mode)

    • openHAB version: 3.0

  • Issue of the topic: please be detailed explaining your issue
  • Please post configurations (if applicable):
    • Items configuration related to the issue
    • Sitemap configuration related to the issue
    • Rules code related to the issue
    • Services configuration related to the issue
  • If logs where generated please post these here using code fences:

The first one is most likely caused by the executeCommandLine which has changed a bit. See the docs for an example:

The second one uses now from the Jodatime library. OH3 no longer uses this library so you’ll need to change that. See the following topic for more information: