OpenHab Fails at Start up with Eclipse Error

Running OpenHab on Ubuntu 18.04.2 in a virtual machine on a Windows machine x64. This was working well until yesterday. Yesterday I installed Pi-Hole into the same VM, which I’m not sure is a factor but for the sake of completeness I will detail that. Pi-Hole now provides my network with both DNS and DHCP. I moved that function from my router and blocks adverts across the network by intercepting DNS requests for know advert providers. It also installs a web server which accepts connection on port 80 for info and admin. I’ve seen other mention of folk that run both on one machine so this may have nothing to do with my issue.

All is well. However, I needed to restart some machines, services, etc. to have them all know that the DNS had moved since my router was no longer providing DNS services. I realized that OpenHab was misbehaving so I dug into this some more. I see, in the log, the following:

2019-02-28 16:11:33.847 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-binding-mqtt1': Error restarting bundles:
        Unable to acquire the state change lock for the module: osgi.identity; type="osgi.bundle"; version:Version="1.13.0"; osgi.identity="org.openhab.binding.insteonplm" [id=233] STARTED [STOPPED]
2019-02-28 16:12:33.879 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-binding-mqtt1': Error restarting bundles:
        Unable to acquire the state change lock for the module: osgi.identity; type="osgi.bundle"; version:Version="1.13.0"; osgi.identity="org.openhab.binding.insteonplm" [id=233] STARTED [STOPPED]

A web search suggested that there were some filetable something or other files that I could delete but this did not resolve the problem. I’ve tried rebooting. I’ve tried restarting the service. Nothing seems to make any difference. To make matters worse, OpenHab is now not writing to its logs even though I have restarted OpenHab and yet systemctl status openhab2.service shows:

● openhab2.service - openHAB 2 - empowering the smart home
   Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2019-02-28 16:46:47 UTC; 34min ago
     Docs: https://www.openhab.org/docs/
           https://community.openhab.org
  Process: 4744 ExecStop=/usr/share/openhab2/runtime/bin/karaf stop (code=exited, status=0/SUCCESS)
 Main PID: 4879 (java)
    Tasks: 32 (limit: 2215)
   CGroup: /system.slice/openhab2.service
           └─4879 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopenhab.userdata=/var/lib/openhab2 -Dopenhab.logdir=/var/log/o

Feb 28 16:46:47 rr-gensrv systemd[1]: Started openHAB 2 - empowering the smart home.

Any help appreciated.

Thanks.

There are some lock files stored in the tmp folder in userdata. You might try Clear the Cache.

For the logs, check the permissions on /var/log/openhab2. Have they changed somehow?

Hi @rlkoshak,

Thanks Rich, partial success. Clearing the cache got it to start running again but my MQTT binding vanished as if it was never installed. I reinstalled the binding but it appears that it may have changed. I have a couple of files in the services directory called mqtt.cfg and mqtt-eventbug.cfg. The documentation suggests that now I have to use it as a “thing”. Apparently some RTFM is required. This must have changed since I originally installed it. Perhaps I was using an OpenHab 1.x version.

Any hints you have to do this. I was dumping all commands and state changes into the MQTT broker and have a couple of sensors that are updated by MQTT input. Personally I preferred the text files but then I still use consoles in preference to GUIs because I’m just that kind of dinosaur :slight_smile:

Those two config files are for the 1.x version. The 2.x version doesn’t use those config files.

If you want to continue to use the 1.x version binding, you may need to check “Show Legacy 1.x version bindings” in the Configuration → System section in PaperUI. Otherwise the 1/x version won’t appear in the list under Add-ons.

If you want to migrate to the 2.x version binding, see the 2.x binding’s readme and the dozen or so tutorials that have been posted to the forum since January. Search for MQTT 2.4 and MQTT 2.5 and you will find them. Many address different aspects of using the new binding. There really isn’t just a generic one to follow right now.

Thanks Rich.

I looked at the documentation but I really don’t need things and channels and triggers and whatever else. Learning curve was too great when everything I needed was provided by the 1.x binding. I went back to that.