Java Runtime Environment: openjdk version “17.0.10” 2024-01-16
openHAB version: openhab/openhab:4.1.2
Issue of the topic: Configuration Locations
Hello community,
i am ramping up my openhab and use a development environment which i copy to the production env after successful tests.
This is working on the whole.
I have no Things, Items … files.
I copy all jsondb stuff to the prod evironment (stop prod, stop local, copy), but it seems that config parts are persisted, cached somewhere else too.
Example: when i grep in conf, addons and userdata i find an id only in logs:
ScriptEngine for language ‘application/javascript;version=ECMAScript-5.1’ could not be found for identifier: 539e4cfb-15d6-4b8c-ba65-ae4a4c8808d2 so i assume it is stored or cached somewhere else outside jsondb.
$OH_USERDATA/etc has some “global” configs like logging config and webserver certs and such.
Other configs like regional settings, what bindings are installed and the like are in $OH_USERDATA/config. Individual bindings might have their own folders where they save additional data as well.
If you run openhab+cli backup, you can examine the zip file and get an idea about what is included in the full OH config.
I did the backup, extracted it to temp but still cannot find my object from the log in the extracted backup with grep. I assume it must be cached somewhere
JS Scripting (Nashorn) which provides ECMAScript-5.1, is an add-on. The config file that specifies what add-ons get installed is $OH_USERDATA/config/org/openhab/addons.config.
Rules add-ons are listed under “automation”. Note I don’t use Nashorn JS (it’s ancient and mainly kept around for legacy support, you should not do new development of rules in Nashorn JS) but if I did you’d see jsscriptingnashorn in the list next to “automation”.
This is the file that records what add-ons get installed. Your error is telling you that you don’t have the Nashorn add-on installed.
If you are looking for that, managed rules are stored in $OH_USERDATA/jsondb/automation_rules.json (or something like that).
Note that between OH 3 and OH 4, Blockly changed from Nashorn to JS Scripting. you just need to open and re-save those rules to convert to the new version. As of 4.2 I think Nashorn is no longer supported by Blockly at all.
I am grepping for error items in my log:
org.openhab.persistence.jdbc.internal.exceptions.JdbcSQLException: Error in SQL query!!!; (conn=800) Incorrect table name ‘eg_heizaktor_11010_eg_arbeitszimmer_fbh_temperaturwert_empfangen_0044’ Query: INSERT INTO eg_heizaktor_11010_eg_arbeitszimmer_fbh_temperaturwert_empfangen_0044
I am searching for the item “eg_heizaktor_11010_eg_arbeitszimmer_fbh_temperaturwert_empfangen” but cannot find it in jsondb (i want to rename it to a shorter name)
That would have been an orphaned link. There is a command in karaf console: openhab:links orphan list to show them and openhab:links orphan purge to remove them.
After an upgrade MainUI will pop up a dialog telling you about orphan links and asking if you want to purge them.
There is also an API endpoint you can find under Developer Tools → API Explorer where you can get the list of orphans and purge them.