openhab-core: [Automation] Paper UI (JSON) rules fail to load after ESH reintegration

Before the ESH reintegration, Paper UI saved rule files with…

"class": "org.eclipse.smarthome.automation.dto.RuleDTO"

After the ESH reintegration (observed on S1557), the rules are saved with…

"class": "org.openhab.core.automation.dto.RuleDTO"

This causes the following error after OH is upgraded and the rule files are loaded…

2019-03-21 15:22:55.362 [ERROR] [org.eclipse.smarthome.storage.json.internal.JsonStorage] - Couldn't deserialize value 'org.eclipse.smarthome.storage.json.internal.StorageEntry@4aee9d1c'. Root cause is: org.eclipse.smarthome.automation.dto.RuleDTO cannot be found by org.openhab.core.automation_2.5.0.201903152356

After upgrading OH, users that have created rules in Paper UI will need to:

  1. Stop OH
  2. Using the openhab account, edit /userdata/jsondb/automation_rules.json
  3. Search/replace the class name
  4. Save the file
  5. Repeat with /userdata/jsondb/automation_rules_disabled.json
  6. Delete the files in /userdata/jsondb/backup directory
  7. Restart OH

It wouldn’t help people with manual installs, but could this be added to an update script?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 27 (23 by maintainers)

Most upvoted comments

With https://github.com/openhab/openhab-docker/pull/239 the openHAB Docker images will also use the common update files. That way the rules will also be patched by the new REPLACE command (https://github.com/openhab/openhab-distro/pull/946).

Why not hooking into the Karaf startup and apply the migration using Java code?

  • you can use a much more comfortable solution that working with sed expressions
  • it works on every OS openHAB is running
  • it does not matter if an manual installation or a package manager based one is used