Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot start openHAB after shutdown or stop #31

Open
ecoen66 opened this issue Jul 17, 2017 · 16 comments · May be fixed by #50
Open

Cannot start openHAB after shutdown or stop #31

ecoen66 opened this issue Jul 17, 2017 · 16 comments · May be fixed by #50

Comments

@ecoen66
Copy link

ecoen66 commented Jul 17, 2017

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

losteine01 commented Dec 21, 2017 via email

@Stefan136
Copy link

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
Copy link

losteine01 commented Dec 22, 2017

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.

@pitschi
Copy link

pitschi commented Jan 7, 2018

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
Copy link
Member

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
Copy link

YeouWei commented Apr 2, 2018

@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
Copy link

jonadem commented May 4, 2018

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

@cutlasjgh cutlasjgh linked a pull request Jun 13, 2018 that will close this issue
@DJPlaya
Copy link

DJPlaya commented Nov 28, 2018

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
Copy link

cpolzer commented Sep 4, 2019

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?

@ecoen66 ecoen66 closed this as completed Jan 4, 2021
@jonadem
Copy link

jonadem commented Jan 4, 2021

Why was the issue closed ?

The issue is still there on my side.

Thx

@ecoen66
Copy link
Author

ecoen66 commented Jan 4, 2021

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 ecoen66 reopened this Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants