openhab / openhab-qnap-qpkg

openHAB Packages for QNAP NAS systems
Eclipse Public License 2.0
77 stars 21 forks source link

Cannot start openHAB after shutdown or stop #31

Open ecoen66 opened 6 years ago

ecoen66 commented 6 years ago

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.

Stefan136 commented 6 years ago

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

Any idea.

Stefan136 commented 6 years ago

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?

TheBlueMajestic commented 6 years ago

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.

losteine01 commented 6 years ago

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

Stefan136 commented 6 years ago

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

losteine01 commented 6 years ago

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.

Stefan136 commented 6 years ago

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] #

losteine01 commented 6 years ago

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

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.

pitschi commented 6 years ago

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.

thopiekar commented 6 years ago

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 😉

YeouWei commented 6 years ago

@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?

jonadem commented 6 years ago

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

DJPlaya commented 5 years ago

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.

cpolzer commented 4 years ago

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?

jonadem commented 3 years ago

Why was the issue closed ?

The issue is still there on my side.

Thx

ecoen66 commented 3 years ago

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.