[SOLVED] Very strange error during startup of openhab2

  • Platform information:
    • Hardware: CPUArchitecture/RAM/storage
    • OS: what OS is used and which version
    • Java Runtime Environment: which java platform is used and what version
    • openHAB version: 2
  • Issue of the topic:

In the log I see

2018-12-08 00:54:34.178 [INFO ] [el.core.internal.ModelRepositoryImpl] - Validation issues found in configuration model 'default.rules', using it anyway:
There is no context to infer the closure's argument types from. Consider typing the arguments or put the closures into a typed context.
There is no context to infer the closure's argument types from. Consider typing the arguments or put the closures into a typed context.
There is no context to infer the closure's argument types from. Consider typing the arguments or put the closures into a typed context.

and this is coming from this function:

rule "count members" when
    Member of group_house_switch_light changed
then
    var Integer ctOff = group_house_switch_light.members.filter[m|m.state == OFF].size
    var Integer ctOn = group_house_switch_light.members.filter[m|m.state == ON].size // maybe var Int instead of var Integer?
    var Integer ctSum = group_house_switch_light.members.filter[m|true].size
    var lOn = ctOn.toString + " Licht(er) von " + ctSum.toString + " eingeschaltet"
    var lOff = ctOff.toString + " Licht(er) von " + ctSum.toString + " ausgeschaltet"
    string_house_switch_light.postUpdate(lOn)
    NumberOfLightsOFF.postUpdate(lOff)
    logInfo("lOn", lOn)
    logInfo("lOff", lOff)
end
2018-12-09 11:46:10.166 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type JSONPATH
2018-12-09 11:46:10.173 [WARN ] [ab.binding.http.internal.HttpBinding] - Couldn't transform response because transformationService of type 'JSONPATH' is unavailable
http_luftdaten_2730.url="http://api.luftdaten.info/v1/sensor/1519/"
http_luftdaten_2730.updateInterval=60000

Number HTTP_number_pm10 "PM10: [%s µg/m³]" { http="<[http_luftdaten_2730:60000:JSONPATH($[0].sensordatavalues[0].value)]"}
Number HTTP_number_pm2_5 "PM2,5: [%s µg/m³]" { http="<[http_luftdaten_2730:60000:JSONPATH($[0].sensordatavalues[1].value)]"}

Both happens during startup only is this okay?? How can I avoid this??

This connected to the fact that OH2 has a somewhat unstructured start up process and can load and execute rules before other prerequisites are ready (items, persistence, etc).
There are several threats discussing the startup behavior, here are a few options mentioned that you may want to consider, all require some work:

Alternatively, if it does not cause you any follow up problems, just ignore

I am using raspbian stretch so I need to simply

sudo systemctl edit openhab2.service

and write

[Service]
ExecStartPre=-/bin/bash -c '/usr/bin/find ${OPENHAB_CONF} -name "*.rules" -exec /usr/bin/rename.ul .rules .rules_away {} \\;'
ExecStartPre=-/bin/bash -c '/usr/bin/find ${OPENHAB_CONF} -name "*.script" -exec /usr/bin/rename.ul .script .script_away {} \\;'
ExecStartPost=/bin/sleep 240
ExecStartPost=-/bin/bash -c '/usr/bin/find ${OPENHAB_CONF} -name "*.script_away" -exec /usr/bin/rename.ul .script_away .script {} \\;'
ExecStartPost=-/bin/bash -c '/usr/bin/find ${OPENHAB_CONF} -name "*.rules_away" -exec /usr/bin/rename.ul .rules_away .rules {} \\;'
TimeoutStartSec=360

correct??

Well, it has been a while since I did that, but from recollection I would say: yes. Just be aware that once you have done this, it will take several minutes for your rules to get loaded after each (re)start of OH2. Extra patience is required. But you can follow the process in the logfile where it will be logged when the rule files get loaded.

Thanks… @lipp_markus

But only this is still there




2018-12-09 11:46:10.166 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type JSONPATH
2018-12-09 11:46:10.173 [WARN ] [ab.binding.http.internal.HttpBinding] - Couldn't transform response because transformationService of type 'JSONPATH' is unavailable
http_luftdaten_2730.url="http://api.luftdaten.info/v1/sensor/1519/"
http_luftdaten_2730.updateInterval=60000

Number HTTP_number_pm10 "PM10: [%s µg/m³]" { http="<[http_luftdaten_2730:60000:JSONPATH($[0].sensordatavalues[0].value)]"}
Number HTTP_number_pm2_5 "PM2,5: [%s µg/m³]" { http="<[http_luftdaten_2730:60000:JSONPATH($[0].sensordatavalues[1].value)]"}

How can I avoid this??

this looks like you did not install the JSONPATH transform.

How do I install this???

It is installed…via paper ui

This is assuming that you installed all bindings through the PaperUI: go to PaperUI, click on “add-ons” and choose the tap “transformations”; from the list there just click install next to JSONPATH

Edit: maybe try to uninstall and re-install it.

It is installed…

If uninstalling and re-installing does not help, I am out of ideas…sorry

Same issue here. I have multiple errors with all transformation extensions (jsonpath, map, regex, scale, …) when I reboot after upgrade (openhabian here). Then I restart the service OH and all messages disappear …