openhab / openhabian

openHABian - empowering the smart home, for Raspberry Pi and Debian systems
https://community.openhab.org/t/13379
ISC License
821 stars 252 forks source link

Openhab2 cannot start #65

Closed martinjo closed 7 years ago

martinjo commented 7 years ago

After a fresh install it seems that openhab2 cannot start. Any ideas what this depends on?

[23:20:00] pi@openHABianPi:~$ sudo /etc/init.d/openhab2 status
● openhab2.service - openHAB 2 - empowering the smart home
   Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
   Active: deactivating (stop) (Result: exit-code) since Tue 2017-01-03 23:20:11 CET; 1s ago
     Docs: http://docs.openhab.org
           https://community.openhab.org
  Process: 19122 ExecStart=/usr/share/openhab2/start.sh server (code=exited, status=254)
 Main PID: 19122 (code=exited, status=254);         : 19280 (karaf)
   CGroup: /system.slice/openhab2.service
           └─control
             ├─19280 /bin/bash /usr/share/openhab2/runtime/bin/karaf stop
             └─19433 /usr/lib/jvm/java-8-oracle/jre/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopenhab.userdata=/va...

Jan 03 23:20:11 openHABianPi start.sh[19122]: at java.lang.Integer.parseInt(Integer.java:542)
Jan 03 23:20:11 openHABianPi start.sh[19122]: at java.lang.Integer.parseInt(Integer.java:615)
Jan 03 23:20:11 openHABianPi start.sh[19122]: at org.apache.karaf.main.ConfigProperties.<init>(ConfigProperties.java:208)
Jan 03 23:20:11 openHABianPi start.sh[19122]: at org.apache.karaf.main.Main.updateInstancePidAfterShutdown(Main.java:226)
Jan 03 23:20:11 openHABianPi start.sh[19122]: at org.apache.karaf.main.Main.main(Main.java:191)
Jan 03 23:20:11 openHABianPi systemd[1]: openhab2.service: main process exited, code=exited, status=254/n/a
Jan 03 23:20:12 openHABianPi stop[19280]: stop: Ignoring predefined value for KARAF_HOME
Jan 03 23:20:13 openHABianPi stop[19280]: Exception in thread "main" java.lang.NumberFormatException: null
Jan 03 23:20:13 openHABianPi stop[19280]: at java.lang.Integer.parseInt(Integer.java:542)
Jan 03 23:20:13 openHABianPi stop[19280]: at java.lang.Integer.parseInt(Integer.java:615)
Jan 03 23:20:13 openHABianPi stop[19280]: at org.apache.karaf.main.ConfigProperties.<init>(ConfigProperties.java:208)
Jan 03 23:20:13 openHABianPi stop[19280]: at org.apache.karaf.main.Stop.main(Stop.java:42)
mg-arne commented 7 years ago

I have the same issue.

cribskip commented 7 years ago

I did a fresh install yestday, openhab2 works for me. Seems like after Ignoring predefined value for KARAF_HOME it can't find its dependent components anymore.

KR Sascha

ThomDietrich commented 7 years ago

This is an unknown problem to me. Please use

sudo systemctl restart openhab2.service
sudo systemctl status openhab2.service

Then look at /var/log/daemon.log and /var/log/openhab2/openhab.log for possible cause. I don't think that's an openHABian problem and sure hope it can be solved by restarting once for example.

nboeckmann commented 7 years ago

Hi,

I've had the same exact issue after running through the openhabian-config. I've had to install openhab-addons with sudo apt-get install openhab2-addons to get it to work.

ThomDietrich commented 7 years ago

after running through the openhabian-config

So that is not a fresh install?

nboeckmann commented 7 years ago

I don't get your point. I've downloaded the openhabian image and extracted it to my SDCard and went through the described installation steps. I was having the described issue afterwards. Installing the openhab2-addons has fixed my issue.

meyju commented 7 years ago

I had the same issue after a clean install of openhabian. Installing openhab2-addons didn't fixed the problem. Did a fresh install of openhabian again and had no errors. Maybe the setup routine had some issues while downloading. I saw a lot of "dpkg ignore dependencies" messages.

rhinomods commented 7 years ago

I am having the same issue, I have made a clean install 3 times thinking I broke something. After clean install it works fine. I installed Milight binding and rebooted the Pi, and it breaks.. @ThomDietrich when i run your commands, (restart and then status) Then look into the two logs I do not see anything but the installation of the binding. No other error information.

just this under status

sudo systemctl status openhab2.service ● openhab2.service - openHAB 2 - empowering the smart home Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled) Active: activating (auto-restart) (Result: exit-code) since Mon 2017-01-30 00:47:50 CET; 79ms ago Docs: http://docs.openhab.org https://community.openhab.org Process: 9853 ExecStop=/usr/share/openhab2/runtime/bin/stop (code=exited, status=1/FAILURE) Process: 9693 ExecStart=/usr/share/openhab2/start.sh server (code=exited, status=254) Main PID: 9693 (code=exited, status=254) Jan 30 00:47:50 openHABianPi systemd[1]: Unit openhab2.service entered failed state.

ThomDietrich commented 7 years ago

Okay that's really strange. @rhinomods I'll do exactly what you described this evening with my testing RPi. Let's see...

cauer71 commented 7 years ago

I have the same issue today

ThomDietrich commented 7 years ago

Everyone, sadly I was swamped with other tasks the last couple of days. Wanted to do testing today only to find out that my spare RPi is without SD card now. I've ordered one today and will test as soon as it arrives.

cauer71 commented 7 years ago

I run the setup again. The second time it was successful

ThomDietrich commented 7 years ago

That's what I would expect. Simply doesn't make sense for hundreds of installations to succeed and single ones to magically fail. I'd suggest to check the faulty setups for problems. I've written a docu part on that:

http://docs.openhab.org/installation/openhabian.html#faq-successful

I'll close this ticket.

rekab commented 7 years ago

I ran into this today on a fresh install. Tried installing openhab2-addons, didn't fix it. Fully re-installing with

sudo apt-get remove openhab2-addons openhab2

followed by

sudo apt-get install openhab2-addons openhab2

fixed it. I don't have any other debugging info other than this appeared in the syslog (https://github.com/openhab/openhabian/files/762663/syslog.txt) while the install was running AFAICT.

ThomDietrich commented 7 years ago

I did 3 fresh installs yesterday evening and it's working out of the box as expected. (on my RPi1B+, which is not even officially supported any longer) Give the installation some time! It may take some, based on your downlink bandwidth. Be sure to follow the instructions.

rekab commented 7 years ago

I have a gigabit fiber connection and I gave it plenty of time on my brand new rpi 2. From my syslog, the initial failure was at 5:40 and was in an obvious crashloop for ~30 minutes:

$ grep -i stop.*exception syslog.txt
Feb  9 05:40:31 openHABianPi stop[1293]: Exception in thread "main" java.lang.NumberFormatException: null
Feb  9 05:40:38 openHABianPi stop[1749]: Exception in thread "main" java.lang.NumberFormatException: null
Feb  9 05:40:45 openHABianPi stop[2247]: Exception in thread "main" java.lang.NumberFormatException: null
Feb  9 05:40:53 openHABianPi stop[2889]: Exception in thread "main" java.lang.NumberFormatException: null
Feb  9 05:41:00 openHABianPi stop[3722]: Exception in thread "main" java.lang.NumberFormatException: null
...
Feb  9 06:06:28 openHABianPi stop[13093]: Exception in thread "main" java.lang.NumberFormatException: null
Feb  9 06:06:35 openHABianPi stop[13419]: Exception in thread "main" java.lang.NumberFormatException: null
Feb  9 06:06:41 openHABianPi stop[13740]: Exception in thread "main" java.lang.NumberFormatException: null
Feb  9 06:06:47 openHABianPi stop[14062]: Exception in thread "main" java.lang.NumberFormatException: null
Feb  9 06:06:54 openHABianPi stop[14385]: Exception in thread "main" java.lang.NumberFormatException: null
Feb  9 06:07:01 openHABianPi stop[14744]: Exception in thread "main" java.lang.NumberFormatException: null

until I reinstalled, at which point it started working.

If I had to guess, this is something broken in the openhab2 package installer, where there's an unstated dependency on some other package that may or may not get installed first.

ThomDietrich commented 7 years ago

Hey everyone. The new version released today includes the switch from Oracle Java to Zulu Embedded Java. I had the feeling, that your bad experience was linked to the way I had to handle the installation of Oracle Java. With Zulu the installation process got a lot cleaner and less error prone. If you have the chance, feel cheerful to try again ;)

https://github.com/openhab/openhabian/releases/tag/v1.1

purduephotog commented 7 years ago

I'm having this same problem as of today, following this web page- apt get, and rasppi http://docs.openhab.org/installation/linux.html

I execute this command: sudo systemctl status openhab2.service

pi@openhab-pi:~ $   sudo systemctl status openhab2.service
â openhab2.service - openHAB 2 - empowering the smart home
   Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
   Active: active (running) since Thu 2017-09-21 23:39:05 UTC; 452ms ago
     Docs: http://docs.openhab.org
           https://community.openhab.org
  Process: 6022 ExecStop=/usr/share/openhab2/runtime/bin/stop (code=exited, status=127)
 Main PID: 6102 (karaf)
   CGroup: /system.slice/openhab2.service
           ââ6102 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
           ââ6123 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
           ââ6124 uname -m

Sep 21 23:39:05 openhab-pi systemd[1]: Started openHAB 2 - empowering the s...e.
Sep 21 23:39:05 openhab-pi start.sh[6102]: Launching the openHAB runtime...
Sep 21 23:39:05 openhab-pi start.sh[6102]: /usr/share/openhab2/runtime/bin/s...d
Hint: Some lines were ellipsized, use -l to show in full.
ThomDietrich commented 7 years ago

Hello @purduephotog, this is the wrong place to discuss your problem. This issue tracker is the place for openHABian related development discussions. Please post your questions and usage problems in the community forum: https://community.openhab.org Your log looks okay so be sure to state what exactly is the issue in the community thread you are about to start.

theleestarr commented 5 years ago

fresh install on ubuntu server Linux version 4.4.0-141-generic (buildd@lcy01-amd64-006) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.10) ● openhab2.service - openHAB 2 - empowering the smart home Loaded: loaded (/usr/lib/systemd/system/openhab2.service; disabled; vendor preset: enabled) Active: activating (auto-restart) (Result: exit-code) since Tue 2019-01-01 21:11:36 CST; 3s ago Docs: https://www.openhab.org/docs/ https://community.openhab.org Process: 1874 ExecStop=/usr/share/openhab2/runtime/bin/karaf stop (code=exited, status=1/FAILURE) Process: 1857 ExecStart=/usr/share/openhab2/runtime/bin/karaf $OPENHAB_STARTMODE (code=exited, status=1/FAILURE) Main PID: 1857 (code=exited, status=1/FAILURE)

Jan 01 21:11:36 openhab01 systemd[1]: openhab2.service: Unit entered failed state. Jan 01 21:11:36 openhab01 systemd[1]: openhab2.service: Failed with result 'exit-code'.

rathio-git commented 5 years ago

@theleestarr

please try sudo apt-get install default-jre

hope it will fix your problem

donster22 commented 5 years ago

@theleestarr

please try sudo apt-get install default-jre

hope it will fix your problem

Perfect, that fixed my problem. Thanks.

ThomDietrich commented 5 years ago

Just to clarify, the reported issue was related to a bug that is now fixed. The proposed solution should not be the go-to solution for whoever finds this issue.

If you experience a problem that has similar symptoms than what was posted in this thread, please create a new issue and explain your situation. Thanks