OpenHAB2 not start after update to 2.3


(X3fil) #1
  • Platform information:
    • Hardware: armv7l/1G/16GB SD
    • OS: Armbian Debian GNU/Linux 9 (stretch)
    • Java Runtime Environment: openjdk version “1.8.0_152”
    • openHAB version: 2.3.0-1

Hello to all,

After updating my little linux box, OenHAB stopped to work.
If I try to start it in debug:

root@oh:/usr/share/openhab2# ./start_debug.sh 
Launching the openHAB runtime...
Listening for transport dt_socket at address: 5005

No other logs are generated.
The process is there:

# ps -edaf | grep openhab
root      3457  3338  2 12:18 pts/2    00:00:10 /usr/bin/java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopenhab.userdata=/var/lib/openhab2 -Dopenhab.logdir=/var/log/openhab2 -Dfelix.cm.dir=/var/lib/openhab2/config -Djetty.host=0.0.0.0 -Djetty.http.compliance=RFC2616 -Dorg.ops4j.pax.web.listening.addresses=0.0.0.0 -Dorg.osgi.service.http.port=8080 -Dorg.osgi.service.http.port.secure=8443 -Djava.awt.headless=true -Djava.endorsed.dirs=/usr/lib/jvm/zulu-embedded-8-armhf/jre/lib/endorsed:/usr/lib/jvm/zulu-embedded-8-armhf/lib/endorsed:/usr/share/openhab2/runtime/lib/endorsed -Djava.ext.dirs=/usr/lib/jvm/zulu-embedded-8-armhf/jre/lib/ext:/usr/lib/jvm/zulu-embedded-8-armhf/lib/ext:/usr/share/openhab2/runtime/lib/ext -Dkaraf.instances=/var/lib/openhab2/tmp/instances -Dkaraf.home=/usr/share/openhab2/runtime -Dkaraf.base=/var/lib/openhab2 -Dkaraf.data=/var/lib/openhab2 -Dkaraf.etc=/var/lib/openhab2/etc -Dkaraf.logs=/var/log/openhab2 -Dkaraf.restart.jvm.supported=true -Djava.io.tmpdir=/var/lib/openhab2/tmp -Djava.util.logging.config.file=/var/lib/openhab2/etc/java.util.logging.properties -Dkaraf.startLocalConsole=true -Dkaraf.startRemoteShell=true -classpath /usr/share/openhab2/runtime/lib/boot/org.apache.karaf.diagnostic.boot-4.1.5.jar:/usr/share/openhab2/runtime/lib/boot/org.apache.karaf.jaas.boot-4.1.5.jar:/usr/share/openhab2/runtime/lib/boot/org.apache.karaf.main-4.1.5.jar:/usr/share/openhab2/runtime/lib/boot/org.osgi.core-6.0.0.jar org.apache.karaf.main.Main
root      3553  2033  0 12:25 pts/1    00:00:00 grep openhab

What could I check?

Thanks,

Simon


(Udo Hartmann) #2

Which version did you come from?


(X3fil) #3

Hello @Udo_Hartmann!

Previous version was 2.2.
Strange is, no logs at all. So I have no idea how/where to start with.

Thanks, Simon


(Rich Koshak) #4

Check th permissions on /var/log/openhab2 and make sure the openhab user has permission to write to that folder. I think OH will still come up as the openhab user when using start_debug.sh.


(Udo Hartmann) #5

Hmm…
My first idea was this Openhabian no logs issue, but as you came from OH2.2…

I would recommend to do

sudo apt remove openhab2
sudo apt install openhab2

(Maybe backup your config first :wink: just in case…)


(X3fil) #6

@rlkoshak permissions are ok.
I’ve deleted the openhab log, restarted, and an empty openhab.log is created.

@Udo_Hartmann, I’ll try to remove OH2 and reinstall.
Of course, I’ll make a OH backup following the doc/thread here:


I’ll let you know!

Simon


(X3fil) #7

Hello,
I’ve made a backup, removed packages and cleaned the installation (–purge), then installed again.
Restore of the configuration, now seems to work correctly :slight_smile:
Thanks!!

Simon


(Thomas) #8

Hello everyone,

My platform information:

  • Hardware: Raspberry PI 3
  • OS: Raspbian (stretch)
  • openHAB version: 2.3.0-1

Yesterday I updated my OH2 via apt from version 2.2 --> 2.3

sudo apt update
sudo apt upgrade

After that I got the same problem. OH2 does not come up after restarting the service or reboot the PI3. There are no logs written to

/var/log/openhab2/openhab2.log

The service itself seems to run. I checked that with

sudo systemctl status openhab2.services

I also can log in into the karaf console. So it is running…?

What I did then:

  • I made a backup as described by @xefil . (./usr/share/openhab2/runtime/bin/backup)
  • Removed openhab2 via apt remove openhab2 and apt purge openhab2
  • Then reinstalled OH2 via apt install openhab2
  • Check wether I can reach PaperUI on the new installation… Works fine!
  • Restore the backup

But after that procedure the behaviour was the same again as I described above.
No reachable OH2
No logs in …/openhab2.log

Are there any new ideas?
What can I do?

Thanks,
Thomas


(X3fil) #9

Hello @didder26 ,
Have you backed-up only those two folders?

cp -arv /etc/openhab2 /backup/...
cp -arv /var/lib/openhab2 /backup/...

Seems like something from the old config (program files?) is stopping the startup process.
Maybe someone could suggest you which files from var-lib-openhab could be skipped from backup which could cause some conflicts… I dunno :-/


(Johan F) #10

I have had this problem several times and for me it has allways been the same thing:

I have openhab run by root by changing this file:

/usr/lib/systemd/system/openhab2.service

After an upgrade the file is restored to the original settings and the system cannot write to the nessecary files any more… I dont know if its the same for you, but I would guess something with file permissions…


(X3fil) #11

Thanks @Johan_F, good to know for the next time (hope isn’t needed anyway :wink: )

Cheers, Simon


(Thomas) #12

Thanks for your support :slight_smile:

@xefil I used the Backup and Restore Script from OH2 described here to backup and restore my config. I have to take a look in that generated zip first.

@Johan_F Sorry, but I don’t understand what you have changed about that mentioned file :-/. Do you mean setting the permissions to that file like e.g.

sudo chmod 666 /usr/lib/systemd/system/openhab2.service

Regards,
Thomas


(Thomas) #13

Hey everybody,

I got my OH2 installation running again with version 2.3.0-1.
Thanks @xefil for your hint to old config files in /var/lib/openhab2

What I did to restore my previously made backup manually:

  1. Remove all OH2 instances (-purge)
  2. Install OH2 in the current version 2.3.0-1 (sudo apt install openhab2)
  3. Extract my “Backup.zip” (made by the OH2 Backup-Skript before) to my Home-folder
  4. Copy the whole “conf” folder into /etc/openhab2/
  5. Change the Owner of all these files to “openhab:openhab”
  6. Copy from “userdata” (Backup.zip) only the two folders “config” and “jsondb” to /var/lib/openhab2/
  7. Change the Owner of all the copied files to “openhab:openhab”
  8. Start OH2 (sudo systemctl start openhab2)
  9. Login to PaperUI and check all functions
  10. It works! :+1:

So I guess there might have been a problem within the folder “userdata/etc” within the Backup.zip, which causes my problem.

Thanks for everybodys help :metal:

Thomas


(X3fil) #14

Great @didder26 !

It’s funny to notice how much I’m used to use OpenHAB for my daily activities… util it stopped to work and I need to open manually my car gate every day :smiley:

I wish you all a great week!

Simon