OH 2.2 stopped working after updating Java

Hi,

due to hints in these threads I updated my OH 2.2 java to an actual Version.
I used way of updating java

pi@OpenHAB:~ $ java -version
java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) Client VM (build 25.151-b12, mixed mode)

Unfortunately OH stopped working after this…

pi@OpenHAB:~ $ sudo service openhab2 status
● openhab2.service - openHAB 2 - empowering the smart home
   Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2017-10-18 23:06:35 CEST; 798ms ago
     Docs: http://docs.openhab.org
           https://community.openhab.org
  Process: 12400 ExecStop=/usr/share/openhab2/runtime/bin/karaf stop (code=exited, status=1/FAILURE)
 Main PID: 12526 (karaf)
   CGroup: /system.slice/openhab2.service
           ├─12526 /bin/sh /usr/share/openhab2/runtime/bin/karaf daemon
           ├─12609 /bin/sh /usr/share/openhab2/runtime/bin/karaf daemon
           ├─12610 /usr/bin/java -version
           ├─12611 grep -E "([0-9].[0-9]\..*[0-9]).*"
           ├─12612 awk {print substr($3,2,length($3)-2)}
           ├─12613 awk {print substr($1, 3, 3)}
           └─12614 sed -e s;\.;;g

Oct 18 23:06:35 OpenHAB systemd[1]: Started openHAB 2 - empowering the smart home.
pi@OpenHAB:~ $ update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                                   Priority   Status
------------------------------------------------------------
* 0            /usr/java/jdk1.8.0_151/bin/java                         1000      auto mode
  1            /usr/java/jdk1.8.0_151/bin/java                         1000      manual mode
  2            /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/bin/java   318       manual mode

Press <enter> to keep the current choice[*], or type selection number: 

Is there anybody out there who could give me a hint?

regards K

PS I moved this Thread from here

What does the last startup log for openHAB say, you can find this at the very end of:

sudo journalctl -u openhab2 -b

fyi, there’s also a 8u152 available now.

There seems to be an karaf issue…

Oct 19 02:19:43 OpenHAB systemd[1]: openhab2.service: Control process exited, code=exited status=1
Oct 19 02:19:43 OpenHAB systemd[1]: openhab2.service: Unit entered failed state.
Oct 19 02:19:43 OpenHAB systemd[1]: openhab2.service: Failed with result 'exit-code'.
Oct 19 02:19:49 OpenHAB systemd[1]: openhab2.service: Service hold-off time over, scheduling restart.
Oct 19 02:19:49 OpenHAB systemd[1]: Stopped openHAB 2 - empowering the smart home.
Oct 19 02:19:49 OpenHAB systemd[1]: Started openHAB 2 - empowering the smart home.
Oct 19 02:19:50 OpenHAB karaf[14798]: There is a Root instance already running with name main and pid 476
Oct 19 02:19:50 OpenHAB systemd[1]: openhab2.service: Main process exited, code=exited, status=1/FAILURE
Oct 19 02:19:51 OpenHAB karaf[14914]: Can't connect to the container. The container is not running.
Oct 19 02:19:51 OpenHAB systemd[1]: openhab2.service: Control process exited, code=exited status=1
Oct 19 02:19:51 OpenHAB systemd[1]: openhab2.service: Unit entered failed state.
Oct 19 02:19:51 OpenHAB systemd[1]: openhab2.service: Failed with result 'exit-code'.
Oct 19 02:19:56 OpenHAB systemd[1]: openhab2.service: Service hold-off time over, scheduling restart.
Oct 19 02:19:56 OpenHAB systemd[1]: Stopped openHAB 2 - empowering the smart home.
lines 1-40

Since you’re using the snapshot version, with apt, try stopping the service and then stopping any additional instance: (If the following doesn’t work, what did the output of the status command give below?)

sudo systemctl stop openhab2
sudo openhab-cli stop
sudo openhab-cli status
sudo systemctl start openhab2

this happens…

sudo /bin/systemctl status openhab2.service
● openhab2.service - openHAB 2 - empowering the smart home
   Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Thu 2017-10-19 15:31:46 CEST; 25ms ago
     Docs: http://docs.openhab.org
           https://community.openhab.org
  Process: 24403 ExecStop=/usr/share/openhab2/runtime/bin/karaf stop (code=exited, status=1/FAILURE)
  Process: 24287 ExecStart=/usr/share/openhab2/runtime/bin/karaf $OPENHAB_STARTMODE (code=exited, status=1/FAILURE)
 Main PID: 24287 (code=exited, status=1/FAILURE)

Oct 19 15:31:46 OpenHAB systemd[1]: openhab2.service: Control process exited, code=exited status=1
Oct 19 15:31:46 OpenHAB systemd[1]: openhab2.service: Unit entered failed state.
Oct 19 15:31:46 OpenHAB systemd[1]: openhab2.service: Failed with result 'exit-code'.

As in, what is the output of:

sudo openhab-cli status

There should also now be new, different information in journalctl. Providing that the above command couldn’t find another running instance.

here we go…

pi@OpenHAB:~ $ sudo openhab-cli status
A systemd service configuration exists...
Use 'sudo /bin/systemctl status openhab2.service' to find the status of an openHAB service
openHAB is not running.

To summarise what we’ve been doing, and what I expect has happened. There may have been an issue in updating JAVA while openHAB was running, from the first journalctl post it was clear that it couldn’t start because there was another stuck instance. This is clearly no-longer the case but there’s still a failure somewhere.

Does

sudo openhab-cli start --debug

work for starting an instance in the shell?

here is the answer

sudo openhab-cli start --debug
A systemd service configuration exists...
Use 'sudo /bin/systemctl start openhab2.service' to start an openHAB service
Launching an instance in this terminal..
Launching the openHAB runtime...
There is a Root instance already running with name main and pid 476

It would be safer to restart your device, there’s clearly a stuck process.

However if you can’t restart (and only if), you can kill that instance by running the following and then openHAB should be able to start.

sudo kill -9 476
sudo systemctl start openhab2
1 Like

Thanks a lot for this support… after the reboot all came up perfectly…

and the HABPanel Gallery is working

1 Like

Fantastic! Glad you’re up and running! :slight_smile:

Great, glad you could sort it out!