openhab-qnap-qpkg icon indicating copy to clipboard operation
openhab-qnap-qpkg copied to clipboard

Cannot start openHAB after shutdown or stop

Open ecoen66 opened this issue 7 years ago • 16 comments

I have to delete the distribution/runtime/instances/instance.properties file in order to be able to start openHAB correctly after a NAS shutdown or Stopping openHAB. I am using qpkg 2.0.0-3.

ecoen66 avatar Jul 17 '17 23:07 ecoen66

I got similar issue after a Power Outage with the latest version running 2.0.0-3. Although OH2 seems to start normally I cannot connect to the GUI on ports 8090 or 8444.

When I checked the console output I get the following message.

`[/etc/init.d] # ./openHAB.sh console

  • Note: JAVA_HOME=/usr/local/jre
  • Note: OPENHAB_HTTP_PORT=8090
  • Note: OPENHAB_HTTPS_PORT=8444 Launching the openHAB runtime... karaf: There is a Root instance already running with name main and pid 21416 [/etc/init.d] # [/etc/init.d] # ps | grep 21416 14047 admin 1036 S grep 21416 [/etc/init.d] # ` Seems OH2 cannot be start as PID is already in use ?!?

Any idea.

Stefan136 avatar Jul 23 '17 10:07 Stefan136

Got it running :-) I also deleted the instance file and started OH again.

Can't this file be removed by the script if the process was terminated incorrectly due to power outage fir example?

Stefan136 avatar Jul 23 '17 10:07 Stefan136

I'm leaving a comment here as a reminder for myself as well as future visitors.

I have a QNAP TS-453A (QTS 4.3.3.0238) running OpenHAB 2.0.0-0 and JRE 8.131.1. If my QNAP has unexpectedly shut down/rebooted, usually due to a power outage, these are the steps that work for me.

  1. Log into QNAP via web browser
  2. Open App Center and Stop OpenHAB
  3. Log into QNAP via terminal (OSX)
  4. Navigate to OpenHAB's directory and delete the instance file: /share/CACHEDEV1_DATA/.qpkg/openHAB/distribution/runtime/instances/instance.properties
  5. Go back to App Center and Start OpenHAB

I do not have issues with OpenHAB if I manually reboot my QNAP, such as performing a system update. Manually stopping/starting OpenHAB also has no issues.

TheBlueMajestic avatar Jul 27 '17 16:07 TheBlueMajestic

Hi, I have the same issue, After a restart of the NAS the web interface does not work anynmore. I wanted to follow the suggestion to delete the instance file but I do not have such directory. Can you help me where to find it? It is a QNAP TS-210, fw 4.2.6 OH 2.0.0-3. is there any way to prevent it to happen in the future? i am really new to the whole thing..,

thanks for any help

losteine01 avatar Dec 21 '17 02:12 losteine01

The directory name can be different on your NAS. On my device it is /share/CE_CACHEDEV1_DATA/.qpkg/openHAB Check for a folder with similar name and replace CE_CACHEDEV1_DATA with your directory name. Hope this helps

Stefan136 avatar Dec 21 '17 20:12 Stefan136

Thanks, unfortunately I have nothing even remotely like that:

[/share] # cd /share [/share] # ls Download@ HDF_DATA/ HDL_DATA/ HDR_DATA/ HDX_DATA/ Web@ HDA_DATA/ HDG_DATA/ HDM_DATA/ HDS_DATA/ HDY_DATA/ backup@ HDB_DATA/ HDH_DATA/ HDN_DATA/ HDT_DATA/ HDZ_DATA/ external/ HDC_DATA/ HDI_DATA/ HDO_DATA/ HDU_DATA/ Multimedia@ homes@ HDD_DATA/ HDJ_DATA/ HDP_DATA/ HDV_DATA/ Public@ openHAB@ HDE_DATA/ HDK_DATA/ HDQ_DATA/ HDW_DATA/ Recordings@

These are all the directories.

I actually never managed to make it properly work, now I decided to delete it and start from scratch..

There seems to be some trouble with the java on my QNAP I reinstalled it, now I have version 1.8.0.65. there are only this and 8.144 available, but with the 144 it does not seem to work at all.

I will let you know how it goes.

losteine01 avatar Dec 21 '17 20:12 losteine01

Lets try this

Goto directory /etc/init.d Then check for the symlink ls -l openHAB.sh

You should see the path to your openHab directory.

[/etc/init.d] # ls -l openHAB.sh lrwxrwxrwx 1 admin administ 49 Dec 8 15:35 openHAB.sh -> /share/CE_CACHEDEV1_DATA/.qpkg/openHAB/openHAB.sh* [/etc/init.d] #

Stefan136 avatar Dec 21 '17 21:12 Stefan136

I restarted the whole process, installed openHAB again from scratch. Added zwave binding, tried to figure out what USB port the AEON stick is connected and it died again, could not access the web interface. as per your advice i, found the location of the file: [/share/HDA_DATA/.qpkg/openHAB/distribution/runtime/instances] # removed instance.properties restarted openHAB now when i try to access the web interface i have an error;

HTTP ERROR: 404 Problem accessing /start/index. Reason: Not Found

if i try to run openHAB, this is the response: [/etc/init.d] # ./openHAB.sh console

  • Note: JAVA_HOME=/usr/local/jre
  • Note: OPENHAB_HTTP_PORT=8090
  • Note: OPENHAB_HTTPS_PORT=8444 [/etc/init.d] #

I checked the log, there is nothing new in that since it crashed. installing took several hours...no point trying it again if the same thing happens again and again.

losteine01 avatar Dec 22 '17 20:12 losteine01

I added the following in the file ${QPKG_ROOT}/openHAB.sh at the end of the stop part after the thing waiting for 60 seconds :

# remove the process properties file if [ -f ${QPKG_DISTRIBUTION}/runtime/instances/instance.properties ]; then rm -f ${QPKG_DISTRIBUTION}/runtime/instances/instance.properties fi

I am testing if it works in all the cases at the moment but it should work.

pitschi avatar Jan 07 '18 14:01 pitschi

Personally, I dislike this method. By removing this file you remove the knowledge of a running instance. openHAB is not designed to run multiple instances in parallel and waiting 60 seconds might be too less for slow CPUs. I don't know what side effects it has to remove this file on each stop, but I would recommend to analyse the state of the system and make use of this file, instead of removing it 😉

thopiekar avatar Jan 07 '18 17:01 thopiekar

@Stefan136 I tried your method and change into the openHAB directory.

[/] # cd /etc/init.d [/etc/init.d] # ls -l openHAB.sh lrwxrwxrwx 1 admin administ 40 Apr 2 08:57 openHAB.sh -> /share/MD0_DATA/.qpkg/openHAB/openHAB.sh* [/etc/init.d] # cd / [/etc/init.d] # cd /share/MD0_DATA/.qpkg/openHAB/distribution/runtime [/share/MD0_DATA/.qpkg/openHAB/distribution/runtime] # ls bin/ etc/ lib/ services.cfg system/ [/share/MD0_DATA/.qpkg/openHAB/distribution/runtime] #

However, I can't find the instances directory. Any idea why?

YeouWei avatar Apr 02 '18 01:04 YeouWei

I had installed openHAB in a 'share', the command which works was : [/share/openHAB] # rm userdata/tmp/instances/instance.properties (with the previous instructions)

jonadem avatar May 04 '18 23:05 jonadem

I have this Problem with Version 2.3.0, and thats from the first start on! I dont have a instace.properties File, and there is no Process or PID displayed. This Problem happens on Win 7 and Win Server 2016 using the latest Java 8. I tried to install it with choco and manually without any Change.

DJPlaya avatar Nov 28 '18 09:11 DJPlaya

I have this Problem with Version 2.3.0, and thats from the first start on! I dont have a instace.properties File, and there is no Process or PID displayed. This Problem happens on Win 7 and Win Server 2016 using the latest Java 8. I tried to install it with choco and manually without any Change.

How does this correlate to QNAP and openHAB?

cpolzer avatar Sep 04 '19 06:09 cpolzer

Why was the issue closed ?

The issue is still there on my side.

Thx

jonadem avatar Jan 04 '21 08:01 jonadem

I haven't used OpenHab in 1-2 years now - I've been using and developing plugins for Homebridge. I will reopen the issue for those who are still dealing with it.

ecoen66 avatar Jan 04 '21 12:01 ecoen66