Skip to content

openHAB HABpanel configuration gets destroyed, HABpanel stays blank

openHAB is a stream of pure joy when it comes to debugging. Especially when all I want is a small display in the kitchen, working autonomous and without the need to restart it all the time or login to fix issues.

The latest installment of that endeavor was a black screen in the browser, with no way to even get to the usual HABpanel controls. After some debugging, it turns out that the file "habpanel.config" (/var/lib/openhab2/config/org/openhab/habpanel.config) on the openHAB server was destroyed, or more accurate: shortened to 4829 bytes. Lucky me I have this file in my Ansible playbooks, and whenever there is a change, a copy of this file is fetched to my Ansible host. From there it goes into my backups, and I can restore a couple dozen versions back, if needed. So not all is bad, but still something is not working as expected. First I installed a copy of this file from my backups - but turns out shortly later the file is shortened again. Later I figured that the file is always shortened when the openHAB service restarts. This particular instance was still running openHAB 2.4, and I used this opportunity to upgrade to 2.5, test my Playbooks (and exclude the one config file from everything) and see if the problem persists. It does. Except that after upgrading to 2.5 the file is no longer shortened to 4829 bytes, but to 4875 bytes.

Every time that happens, the file ends somewhere in the middle of the HABpanel panel configuration - and naturally the HABpanel service can no longer read that file and shows a blank screen. I would wish that it rather shows an error message, or does something useful here, but oh well.

For a while (and mostly because I was busy with other tasks) I helped myself by changing the owner of "habpanel.config" and the directory this files lives in to "root:root". This threw a couple other errors into the logfile, but helped somewhat because the config file got no longer destroyed when the service restarted.

 

After more debugging and testing I posted on the openHAB Community forum, and one user pointed me into the right direction. The Apache Felix stuff seems to be at fault, and I had to remove this from the file. I also had to wipe another config file (/var/lib/openhab2/etc/org.openhab.habpanel.cfg), which turned out to be more complicated: the file is recreated at some point. I poured everything into my Ansible Playbook, and this specific part is now:

- block:
  # remove Felix from add-ons
  - name: Remove add-ons
    lineinfile:
      dest: /var/lib/openhab2/config/org/openhab/addons.config
      regexp: "{{ item.regexp }}"
      line: "{{ item.line }}"
      state: "{{ item.state }}"
      create: no
    loop:
      - { regexp: '^misc=', line: 'misc=""', state: present }
    notify:
      - restart openhab2

  # remove buggy "felix" code
  - name: Remove buggy "felix" code
    lineinfile:
      dest: /var/lib/openhab2/config/org/openhab/habpanel.config
      regexp: "{{ item.regexp }}"
      line: "{{ item.line }}"
      state: "{{ item.state }}"
      insertafter: "{{ item.insertafter }}"
      create: no
    loop:
      - { regexp: '^felix.fileinstall.filename=', line: '', state: absent, insertafter: EOF }
    notify:
      - restart openhab2

  - name: Remove habpanel.cfg
    file:
      path: /var/lib/openhab2/etc/org.openhab.habpanel.cfg
      state: absent

First "Felix" is removed from packages, then the "felix" line is removed from habpanel.config. And finally the "habpanel.cfg" is removed. Restart the openHAB service. After that I had to reinstall the panel configuration once from my backups, but ever since then this is stable. No more configuration damages.

  • Twitter
  • Bookmark openHAB HABpanel configuration gets destroyed, HABpanel stays blank at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg openHAB HABpanel configuration gets destroyed, HABpanel stays blank
  • Bloglines openHAB HABpanel configuration gets destroyed, HABpanel stays blank
  • Technorati openHAB HABpanel configuration gets destroyed, HABpanel stays blank
  • Fark this: openHAB HABpanel configuration gets destroyed, HABpanel stays blank
  • Bookmark openHAB HABpanel configuration gets destroyed, HABpanel stays blank at YahooMyWeb
  • Bookmark openHAB HABpanel configuration gets destroyed, HABpanel stays blank at Furl.net
  • Bookmark openHAB HABpanel configuration gets destroyed, HABpanel stays blank at reddit.com
  • Bookmark openHAB HABpanel configuration gets destroyed, HABpanel stays blank at blinklist.com
  • Bookmark openHAB HABpanel configuration gets destroyed, HABpanel stays blank at Spurl.net
  • Bookmark openHAB HABpanel configuration gets destroyed, HABpanel stays blank at Simpy.com
  • Bookmark openHAB HABpanel configuration gets destroyed, HABpanel stays blank at blogmarks
  • Bookmark openHAB HABpanel configuration gets destroyed, HABpanel stays blank with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Identi.ca

Trackbacks

No Trackbacks

Comments

Display comments as Linear | Threaded

No comments

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.
To leave a comment you must approve it via e-mail, which will be sent to your address after submission.
Form options