Migrating, bindings are removed on openhab2 start

hello everybody, sorry if this is a repeated question but the posts i read didn’t help me out…

i’m migrating from 1.8.3
my java:

java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) Client VM (build 25.121-b13, mixed mode)

briefly, the problem is: When i start openhab2 the logs shows that 3 bindings are being uninstalled, and i really don’t understand why.

This 3 bindings are always uninstalled when i execute service openhab start:

2017-02-01 20:09:41.439 [ExtensionEvent            ] - Extension 'binding-mqttitude1' has been uninstalled.
2017-02-01 20:09:57.243 [ExtensionEvent            ] - Extension 'binding-mqtt1' has been uninstalled.
2017-02-01 20:10:06.102 [ExtensionEvent            ] - Extension 'binding-http1' has been uninstalled.

Besides that items are removed (events.log shows that)

i really don’t understand what is going on :disappointed_relieved:

My installation was like this:

sudo apt-get install openhab2
sudo apt-get install openhab2-addons
sudo apt-get install openhab2-addons-legacy

i edited the files addons.cfg and runtime.cfg
didn’t install the Compatibility layer because i don’t think is necessary (?)
i populated the services/.cfg files that the addons created

my addons.cfg:

# The installation package of this openHAB instance
# Note: This is only regarded at the VERY FIRST START of openHAB
# Note: If you want to specify your add-ons yourself through entries below, set the package to "minimal"
# as otherwise your definition might be in conflict with what the installation package defines.
# Optional. If not set, the dashboard (https://<yourserver>:8080/) will ask you to choose a package.
# Valid options:
#   - minimal  : Installation only with dashboard, but no UIs or other add-ons. Use this for custom setups.
#   - simple   : Setup for using openHAB purely through UIs - you need to expect MANY constraints in functionality!
#   - standard : Default setup for normal users, best for textual setup
#   - expert   : Setup for expert users, especially for people migrating from openHAB 1.x
#   - demo     : A demo setup which includes UIs, a few bindings, config files etc.
# See http://docs.openhab.org/configuration/packages.html for a detailed explanation of these packages.
package = standard

# Access Remote Add-on Repository
# Defines whether the remote openHAB add-on repository should be used for browsing and installing add-ons.
# This not only makes latest snapshots of add-ons available, it is also required for the installation of
# any legacy 1.x add-on. (default is true)
remote = true

# Include legacy 1.x bindings. If set to true, it also allows the installation of 1.x bindings for which there is
# already a 2.x version available (requires remote repo access, see above). (default is false)
legacy = true

# A comma-separated list of bindings to install (e.g. "sonos,knx,zwave")
binding = mqtt,http,ntp,mqttitude

# A comma-separated list of UIs to install (e.g. "basic,paper")
ui = basic,paper,classic,habpanel

# A comma-separated list of persistence services to install (e.g. "rrd4j,jpa")
persistence = mysql

# A comma-separated list of actions to install (e.g. "mail,pushover")
action = mail

# A comma-separated list of transformation services to install (e.g. "map,jsonpath")
transformation = map

# A comma-separated list of voice services to install (e.g. "marytts,freetts")
voice =

# A comma-separated list of miscellaneous services to install (e.g. "myopenhab")
misc =

firstly i used ‘expert’ then change to ‘standard’…
i don’t know if it has nothing to do, i suppose not…

for example

  1. now the service is running…
  2. i have the cfg files populated, in place
  3. no bindings
  4. $ ssh openhab@localhost -p 8101
  5. i install the 3 bindings.
feature:install openhab-binding-mqttitude1
feature:install openhab-binding-mqtt1
feature:install openhab-binding-http1

then when i start openhab2 the bindings are automatically uninstalled…:tired_face:

2017-02-01 20:09:24.297 [INFO ] [basic.internal.servlet.WebAppServlet] - Started Basic UI at /basicui/app
2017-02-01 20:09:24.439 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2017-02-01 20:09:24.837 [INFO ] [assic.internal.servlet.WebAppServlet] - Started Classic UI at /classicui/app
2017-02-01 20:09:25.279 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel
2017-02-01 20:09:32.868 [ERROR] [mqttitude.internal.MqttitudeConsumer] - Unable to calculate relative location for LG_EnCasa as there is no lat/lon configured for 'home'
2017-02-01 20:09:41.432 [INFO ] [core.karaf.internal.FeatureInstaller] - Uninstalled 'openhab-binding-mqttitude1'
2017-02-01 20:09:50.393 [INFO ] [penhab.io.transport.mqtt.MqttService] - Stopping broker connection 'mosquitto'
2017-02-01 20:09:57.233 [INFO ] [core.karaf.internal.FeatureInstaller] - Uninstalled 'openhab-binding-mqtt1'
2017-02-01 20:10:06.099 [INFO ] [core.karaf.internal.FeatureInstaller] - Uninstalled 'openhab-binding-http1'
2017-02-01 20:10:07.017 [INFO ] [b.core.service.AbstractActiveService] - HTTP Refresh Service has been shut down

Also, maybe has nothing to do with what i’m saying…when i execute

sudo service openhab2 restart

it just stops the service and doesn’t start again
i have to run the same command with ‘start’ to start openhab2

Any help/tip is appreciated!

I’m having a similar problem on build 772.

openhab2, on restart, removes bindings/addons (not all), for example, habpanel and habmin, xmbc1. xbmc was in my addons.cfg (which is set to minimal) yet it was uninstalled.

Stuff I had installed through paperui seems to get deleted as well on restart.

I added mapdb and influxdb persistance and they were working fine, including through a restart. I then added them to addons.cfg while openhab was running and it deleted them, and xbmc, when I saved addons.cfg!

Something is amiss. I probably need to be a bit more methodical in debugging but thought I’d throw in a “me too” at this point.

This is the absolute list of bindings that should be installed. So if you want http1 to be installed as well, you need to list it here - otherwise it is (correctly) deinstalled again.

Removing the addons.cfg completely seems to have solved me problem. fingers crossed!

Just a note here:

When using version 1.x bindings, remember to add 1 after the name of the binding in the addons.cfg file, binding = section

Example: mqtt1 (not mqtt)

Note: This applies only to Bindings, not to other Add-ons (like persistence, etc). You can verify the correct name of the bindings using Paper UI → Add-ons → Bindings.


Thank you for your comments.
@Dim, apparently that’s the solution.

Maybe the tutorial [Migration from openHAB 1.x to openHAB 2] (http://docs.openhab.org/tutorials/migration.html#text-based) is not 100% clear about that or at least for me:

In the Migration Tutorial:

binding = - a comma separated list of the bindings from openHAB 1.x that
you use. If you are in doubt of the name of a binding, look in openhab.cfg for
that binding’s configurations. The first part of the tag in openhab.cfg will be
that name of the binding. For example, the configuration parameters for the
MQTT Binding start with “mqtt” in openhab.cfg so the name of the binding is
“mqtt”. For those bindings that have a 2.0 version, use the name followed by a
> “1”, for example, to use the 1.9 SNAPSHOT version of the Astro binding instead
> of the 2.0 version, use the name “astro1”. You can find the list of 2.0
bindings here.

My comment about this:

  • there’s no 2.0 binding for mqtt so it’s not clear that i must use the number ‘1’ after the mqtt in addons.cfg

Then, in the same Tutorial:

An example addons.cfg:

binding = zwave,astro1,http,mqtt,nest,networkhealth,ntp

my comment is:

  • the example file is using mqtt as a binding, and not mqtt1
  • the example file is using http as a binding, and not http1

So probably, those bindings were uninstalled as in my system. (?)

now, my binding addons.cfg section looks like:

# A comma-separated list of bindings to install (e.g. "sonos,knx,zwave")
binding = mqtt1,http1,ntp,mqttitude1

two weird things:

When i execute ‘service restart’; in the events.log ile it says all the items are removed:

2017-02-02 13:17:05.026 [ItemRemovedEvent          ] - Item 'CamLogiMotion' has been removed.
2017-02-02 13:17:05.029 [ItemRemovedEvent          ] - Item 'ledAmarillo' has been removed.
2017-02-02 13:17:05.031 [ItemRemovedEvent          ] - Item 'ledVerde' has been removed.
2017-02-02 13:17:05.033 [ItemRemovedEvent          ] - Item 'locationMaxi' has been removed.
2017-02-02 13:17:05.035 [ItemRemovedEvent          ] - Item 'mqttPositionMaxiRaw' has been removed.

Why??? Could you point me out where should i read about it? thanks!

Then, openhab2 won’t start again, i have to execute:

sudo service openhab2 start

The good point is i don’t have to install those bindings again (as before).

There have been some changes to openHAB 2 during the past weeks that it is almost impossible for the authors of the documentation to keep everything up-to-date :slight_smile: I still have some tutorials within the forum that I must update.
I ping @rlkoshak here (the author of the migration tutorial).

Your feedback is great, this will help out with the revision.
(optional) A step further would be to propose a modification to the docs by creating a Pull Request (PR) on GitHub - openhab/openhab-docs: This repository contains the documentation for openHAB. where the content is being constantly enhanced.

For more info, see:

That is ok & normal (because OH2 is shutting down at that moment).

That is not normal… what do the logs say about the restart attempt?

Thanks again @Dim

About the docs, i know is very hard to mantain and i would be proud of helping; i would read the ‘how to’ you linked

now i will fight with my NULL an UNDEF errors that are appearing

About the restart, maybe is related to this post: https://community.openhab.org/t/sysvinit-restart-does-not-work/21039

the logs don’t show anything; is just like a Stop and nothing more than that

$ sudo service openhab2 status
status: Ignoring predefined value for KARAF_HOME
Running ...
$ date
Thu Feb  2 15:18:48 UYT 2017
$ sudo service openhab2 status
status: Ignoring predefined value for KARAF_HOME
Running ...
$ sudo service openhab2 restart
[....] Restarting openHAB2 server: openhab2stop: Ignoring predefined value for KARAF_HOME
start: Ignoring predefined value for KARAF_HOME
. ok
$ date
Thu Feb  2 15:27:23 UYT 2017

$ date
Thu Feb  2 15:36:18 UYT 2017
$ sudo service openhab2 status
status: Ignoring predefined value for KARAF_HOME
Not Running ...
$ date
Thu Feb  2 15:36:28 UYT 2017
1 Like

Added an issue and a proposed fix for the migration tutorial here:

@maxplay, as @dim said, this sort of feedback is very helpful and most welcome.

Indeed, this was written before the appending of a 1 for 1.x version bindings was implemented.

1 Like

thanks @rlkoshak

About the other issue (can’t restart service) it’s already solved, the solution is in the other post i mentioned before.

thank you very much!

removing all the files from the services folder resolved my issue. Even after renaming them nest1, myq1 they were still uninstalling.