Openhab 2.2 stable upgrade errors

openhab2
upgrade
Tags: #<Tag:0x00007f6ce2f16d18> #<Tag:0x00007f6ce2f16bb0>

(Ahiel) #1

Hello,
I’ve just upgraded to 2.2 stable using openhabian.
since than openhab looks active (service is up).
there is no UI nor karaf… (karaf said it started but the port 8101 not opened - before the upgrade I didn’t have any problem to connect to it).
In the logs I see:

2017-12-18 17:48:00.561 [ERROR] [org.openhab.binding.neato ] - FrameworkEvent ERROR - org.openhab.binding.neato
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.neato [199]
Unresolved requirement: Import-Package: org.apache.commons.codec.binary; version=“1.6.0”

    at org.eclipse.osgi.container.Module.start(Module.java:444) [?:?]
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1620) [?:?]
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1600) [?:?]
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1571) [?:?]
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1514) [?:?]
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) [?:?]
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) [?:?]

2017-12-18 17:48:17.847 [ERROR] [org.apache.felix.fileinstall ] - Failed to install artifact: /usr/share/openhab2/addons/org.openhab.binding.neato-2.0.0-SNAPSHOT.jar
org.osgi.framework.BundleException: A bundle is already installed with the name “org.openhab.binding.neato” and version "2.0.0.201709042240"
at org.eclipse.osgi.container.ModuleContainer.install(ModuleContainer.java:260) [?:?]
at org.eclipse.osgi.storage.Storage.install(Storage.java:539) [?:?]
at org.eclipse.osgi.internal.framework.BundleContextImpl.installBundle(BundleContextImpl.java:146) [?:?]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.installOrUpdateBundle(DirectoryWatcher.java:1036) [8:org.apache.felix.fileinstall:3.5.8]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:952) [8:org.apache.felix.fileinstall:3.5.8]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:871) [8:org.apache.felix.fileinstall:3.5.8]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:485) [8:org.apache.felix.fileinstall:3.5.8]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:361) [8:org.apache.felix.fileinstall:3.5.8]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:312) [8:org.apache.felix.fileinstall:3.5.8]
(END)

I have the neato addon, but even when I’m removing it from the directory I still get an error (since I have neato thing configured with the PaperUI)…
This is the error without the addons:

2017-12-18 18:01:30.837 [ERROR] [org.openhab.binding.neato ] - FrameworkEvent ERROR - org.openhab.binding.neato
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.neato [199]
Unresolved requirement: Import-Package: org.apache.commons.codec.binary; version=“1.6.0”

    at org.eclipse.osgi.container.Module.start(Module.java:444) [?:?]
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1620) [?:?]
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1600) [?:?]
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1571) [?:?]
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1514) [?:?]
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) [?:?]
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) [?:?]

Any ideas?

thanks!


( ) #2

Hello @Ahiel,
I’m not sure about the source of the error (surely the manually added neato binding has something to do with it) but the following steps should help you get your openHAB instance up and running again:

  1. Remove the neato binding (till openHAB is back up)
  2. Execute sudo apt remove openhab2 (will delete the openHAB binaries but not the configuration)
  3. Execute sudo openhabian-config, Select “Update”, then “Exit”
  4. Execute sudo openhabian-config, Select “openHAB 2.2.0 stable”
  5. (Bonus:) Select “Apply Improvements”->“Fix Permissions”

Wait for a few minutes. openHAB 2.2 should start normally

Please try to document your steps exactly so we have the chance to improve the upgrade process for users to come!


[SOLVED] Menu addons not visible in paperUI
(Lars) #3

I saw also issues with the neato-binding but i have also i different (not connected?) issue with 2.2 stable:

HTTP ERROR 500
Problem accessing /start/index. Reason:

    Server Error
Caused by:
java.lang.NullPointerException
	at org.openhab.ui.dashboard.internal.DashboardService.getLocalizedText(DashboardService.java:240)
	at org.openhab.ui.dashboard.internal.DashboardServlet.lambda$0(DashboardServlet.java:203)
	at org.openhab.ui.dashboard.internal.DashboardServlet.replaceKeysWithFunction(DashboardServlet.java:217)
	at org.openhab.ui.dashboard.internal.DashboardServlet.replaceKeysWithLocaleFunction(DashboardServlet.java:203)
	at org.openhab.ui.dashboard.internal.DashboardServlet.serveDashboard(DashboardServlet.java:114)
	at org.openhab.ui.dashboard.internal.DashboardServlet.doGet(DashboardServlet.java:80)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

i removed&reinstalled openhab 2.2 and the issue is not gone…any ideas? thx :slight_smile:


( ) #4

Hello @magicofit, could you please tell us the language your system/browser is operating with?

Are you able to access http://openhab-device-ip:8080/paperui/index.html


(Ahiel) #5

Ok thank you!
Now openhab and karaf is up.
In the logs I see those errors (binding addon (installed previously with PaperUI):

2017-12-18 18:58:18.664 [WARN ] [.smarthome.config.core.Configuration] - Could not set field value for field ‘port’: Can not set java.mat
h.BigDecimal field org.openhab.binding.network.internal.NetworkHandlerConfiguration.port to java.lang.String
java.lang.IllegalArgumentException: Can not set java.math.BigDecimal field org.openhab.binding.network.internal.NetworkHandlerConfigurati
on.port to java.lang.String
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167) [?:?]
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171) [?:?]
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81) [?:?]
at java.lang.reflect.Field.set(Field.java:764) [?:?]
at org.apache.commons.lang.reflect.FieldUtils.writeField(FieldUtils.java:523) [41:org.apache.commons.lang:2.6.0]
at org.apache.commons.lang.reflect.FieldUtils.writeField(FieldUtils.java:500) [41:org.apache.commons.lang:2.6.0]
at org.apache.commons.lang.reflect.FieldUtils.writeField(FieldUtils.java:560) [41:org.apache.commons.lang:2.6.0]
at org.eclipse.smarthome.config.core.Configuration.as(Configuration.java:106) [103:org.eclipse.smarthome.config.core:0.10.0.b1]
at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.getConfigAs(BaseThingHandler.java:284) [116:org.eclipse.smarthome.co
re.thing:0.10.0.b1]
at org.openhab.binding.network.handler.NetworkHandler.initialize(NetworkHandler.java:152) [235:org.openhab.binding.network:2.2.0]
at org.openhab.binding.network.handler.NetworkHandler.initialize(NetworkHandler.java:202) [235:org.openhab.binding.network:2.2.0]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [109:org
.eclipse.smarthome.core:0.10.0.b1]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [109:org.eclipse.smarthome.core:0.10.0.b1]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
2017-12-18 18:58:18.699 [WARN ] [.smarthome.config.core.Configuration] - Could not set field value for field ‘retry’: Can not set java.math.BigDecimal field org.openhab.binding.network.internal.NetworkHandlerConfiguration.retry to java.lang.String
java.lang.IllegalArgumentException: Can not set java.math.BigDecimal field org.openhab.binding.network.internal.NetworkHandlerConfiguration.retry to java.lang.String
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167) [?:?]
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171) [?:?]
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81) [?:?]
at java.lang.reflect.Field.set(Field.java:764) [?:?]
at org.apache.commons.lang.reflect.FieldUtils.writeField(FieldUtils.java:523) [41:org.apache.commons.lang:2.6.0]
at org.apache.commons.lang.reflect.FieldUtils.writeField(FieldUtils.java:500) [41:org.apache.commons.lang:2.6.0]
at org.apache.commons.lang.reflect.FieldUtils.writeField(FieldUtils.java:560) [41:org.apache.commons.lang:2.6.0]
at org.eclipse.smarthome.config.core.Configuration.as(Configuration.java:106) [103:org.eclipse.smarthome.config.core:0.10.0.b1]
at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.getConfigAs(BaseThingHandler.java:284) [116:org.eclipse.smarthome.core.thing:0.10.0.b1]
2017-12-18 18:58:18.705 [WARN ] [.smarthome.config.core.Configuration] - Could not set field value for field ‘timeout’: Can not set java.math.BigDecimal field org.openhab.binding.network.internal.NetworkHandlerConfiguration.timeout to java.lang.String
java.lang.IllegalArgumentException: Can not set java.math.BigDecimal field org.openhab.binding.network.internal.NetworkHandlerConfiguration.timeout to java.lang.String
2017-12-18 18:58:18.881 [WARN ] [lipse.smarthome.io.net.exec.ExecUtil] - Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program “arping” (in directory “.”): error=2, No such file or directory)
2017-12-18 18:58:18.956 [INFO ] [ternal.dhcp.DHCPPacketListenerServer] - DHCP request packet listener online
2017-12-18 18:58:19.033 [WARN ] [.smarthome.config.core.Configuration] - Could not set field value for field ‘port’: Can not set java.math.BigDecimal field org.openhab.binding.network.internal.NetworkHandlerConfiguration.port to java.lang.String
java.lang.IllegalArgumentException: Can not set java.math.BigDecimal field org.openhab.binding.network.internal.NetworkHandlerConfiguration.port to java.lang.String
2017-12-18 18:58:19.040 [WARN ] [.smarthome.config.core.Configuration] - Could not set field value for field ‘retry’: Can not set java.math.BigDecimal field org.openhab.binding.network.internal.NetworkHandlerConfiguration.retry to java.lang.String
java.lang.IllegalArgumentException: Can not set java.math.BigDecimal field org.openhab.binding.network.internal.NetworkHandlerConfiguratioon.retry to java.lang.String
2017-12-18 18:58:19.050 [WARN ] [.smarthome.config.core.Configuration] - Could not set field value for field ‘timeout’: Can not set java.math.BigDecimal field org.openhab.binding.network.internal.NetworkHandlerConfiguration.timeout to java.lang.String
java.lang.IllegalArgumentException: Can not set java.math.BigDecimal field org.openhab.binding.network.internal.NetworkHandlerConfiguration.timeout to java.lang.String
2017-12-18 18:58:19.127 [WARN ] [lipse.smarthome.io.net.exec.ExecUtil] - Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program “arping” (in directory “.”): error=2, No such file or directory)

and the network binding not seems to work…


(Lars) #6

Yes! http://openhab-device-ip:8080/paperui/index.html is accessable to me (this makes me a little happy ^^)
system/browser is operating with german (de-DE)


(Alexander Rosswog) #7

Hello,
tried to upgrade to 2.2.0.1 stable too (on Debian Stretch 64bit) and hat a lot of problems. Openhab2 didn’t start anymore, it looped all the time. Starting all services and automatically stopping all of them.

I did a backup of the config and delete alle Openhab-directories and packages. After that I tried a new/fresh installation on the same os and it get worse.

Openhab do not start anymore, it hangs all the time with the following log entries:Dez 18, 2017 9:13:12 PM org.apache.karaf.main.lock.SimpleFileLock lock
INFORMATION: Lock acquired
Dez 18, 2017 9:13:12 PM org.apache.karaf.main.Main$KarafLockCallback lockAquired
INFORMATION: Lock acquired. Setting startlevel to 100
Dez 18, 2017 9:15:03 PM org.apache.karaf.main.lock.SimpleFileLock lock
INFORMATION: Trying to lock /var/lib/openhab2/tmp/lock
Dez 18, 2017 9:15:03 PM org.apache.karaf.main.lock.SimpleFileLock lock
INFORMATION: Lock acquired
Dez 18, 2017 9:15:03 PM org.apache.karaf.main.Main$KarafLockCallback lockAquired
INFORMATION: Lock acquired. Setting startlevel to 100

A little help would be great.


(Ahiel) #8

Try to reinstall it (Openhab 2.2 stable upgrade errors - as mentioned here)


(Alexander Rosswog) #9

I`m using Debian-Stretch with x86 cpu, not a raspberry…


(Christos) #10

Same here. Did an upgrade from 2.1 stable to 2.2 stable and nothing is starting. Completely removed the openhab2 and restinalled two times but nothing. Nothing on the openhab logs which tells me that the application does not even starting. The only thing I see is the following in syslog

I think the main issue is with Karaf

start.sh[5790]: KARAF_BASE is not valid: /usr/share/openhab2/userdata

Here is everything

Dec 18 22:21:08 raspberrypi systemd[1]: Starting The openHAB 2 Home Automation Bus Solution...
Dec 18 22:21:08 raspberrypi systemd[1]: Started The openHAB 2 Home Automation Bus Solution.
Dec 18 22:21:08 raspberrypi start.sh[5790]: Launching the openHAB runtime...
Dec 18 22:21:08 raspberrypi start.sh[5790]: mkdir: cannot create directory ‘/usr/share/openhab2/userdata/tmp’: No such file or directory
Dec 18 22:21:13 raspberrypi influxd[866]: [I] 2017-12-18T21:21:13Z failed to store statistics: timeout service=monitor
Dec 18 22:21:24 raspberrypi start.sh[5790]: KARAF_BASE is not valid: /usr/share/openhab2/userdata
Dec 18 22:21:24 raspberrypi systemd[1]: openhab2.service: main process exited, code=exited, status=1/FAILURE
Dec 18 22:21:25 raspberrypi kill[5940]: kill: invalid argument S
Dec 18 22:21:25 raspberrypi kill[5940]: Usage:
Dec 18 22:21:25 raspberrypi kill[5940]: kill [options] <pid> [...]
Dec 18 22:21:25 raspberrypi kill[5940]: Options:
Dec 18 22:21:25 raspberrypi kill[5940]: <pid> [...]            send signal to every <pid> listed
Dec 18 22:21:25 raspberrypi kill[5940]: -<signal>, -s, --signal <signal>
Dec 18 22:21:25 raspberrypi kill[5940]: specify the <signal> to be sent
Dec 18 22:21:25 raspberrypi kill[5940]: -l, --list=[<signal>]  list all signal names, or convert one to a name
Dec 18 22:21:25 raspberrypi kill[5940]: -L, --table            list all signal names in a nice table
Dec 18 22:21:25 raspberrypi kill[5940]: -h, --help     display this help and exit
Dec 18 22:21:25 raspberrypi systemd[1]: openhab2.service: control process exited, code=exited status=1
Dec 18 22:21:25 raspberrypi systemd[1]: Unit openhab2.service entered failed state.
Dec 18 22:21:25 raspberrypi kill[5940]: -V, --version  output version information and exit
Dec 18 22:21:25 raspberrypi kill[5940]: For more details see kill(1).
Dec 18 22:21:25 raspberrypi systemd[1]: openhab2.service holdoff time over, scheduling restart.

The discussion here did not solve it

Edit: Actually checking the path mentioned in the error message I see that /usr/share/openhab2/userdata does not exist !

pi@raspberrypi:/usr/share/openhab2 $ pwd
/usr/share/openhab2
pi@raspberrypi:/usr/share/openhab2 $ ls
addons  LICENSE.TXT  runtime  start_debug.sh  start.sh
pi@raspberrypi:/usr/share/openhab2 $

Not sure how this has happened


(Ben Clark) #11

What is the output of

openhab-cli info

?


(Christos) #12
pi@raspberrypi:/usr/share/openhab2 $ openhab-cli info
Version:     2.2.0 (Build)

User:        openhab (Environment Variable Set)
User Groups: openhab tty dialout

Directories: Folder Name      | Path                        | User:Group
             -----------      | ----                        | ----------
             OPENHAB_HOME     | /usr/share/openhab2         | root:root
             OPENHAB_RUNTIME  | /usr/share/openhab2/runtime | openhab:openhab
             OPENHAB_USERDATA | /var/lib/openhab2           | openhab:openhab
             OPENHAB_CONF     | /etc/openhab2               | openhab:openhab
             OPENHAB_LOGDIR   | /var/log/openhab2           | openhab:openhab

URLs:        http://192.168.1.18:8080
             https://192.168.1.18:8443

As I mentioned in the edit of my post above I see clearly that the path /usr/share/openhab2/userdata does not exist!


(Ben Clark) #13

It shouldn’t exist. The userdata folder should be pointing towards /var/lib/openhab2 as your last command shows correctly.

Does the command:

sudo chown -R openhab:openhab /usr/share/openhab2

help at all?


(Christos) #14

Currently the folder is owned by root

drwxr-xr-x   4 root root  4096 Dec 18 22:20 openhab2
pi@raspberrypi:/usr/share $

I changed it to openhab as you suggested but still the same

drwxr-xr-x   4 openhab openhab  4096 Dec 18 22:20 openhab2
pi@raspberrypi:/usr/share $
Dec 18 22:42:51 raspberrypi start.sh[10344]: Launching the openHAB runtime...
Dec 18 22:42:51 raspberrypi start.sh[10344]: mkdir: cannot create directory ‘/usr/share/openhab2/userdata/tmp’: No such file or directory
Dec 18 22:42:53 raspberrypi start.sh[10344]: KARAF_BASE is not valid: /usr/share/openhab2/userdata
Dec 18 22:42:53 raspberrypi systemd[1]: openhab2.service: main process exited, code=exited, status=1/FAILURE

(Ben Clark) #15

Ah I’ve found the problem. For some reason you’re not using the service file provided by the installation we need to point towards the correct service file:

sudo systemctl disable openhab2 
sudo systemctl daemon-reload
sudo systemctl enable openhab2.service
sudo systemctl start openhab2.service

(Christos) #16

Not sure how you found that :slight_smile: I do not remember changing the service file to be honest.

In any case I tried it but still the same issue …

pi@raspberrypi:/var/log $ sudo systemctl disable openhab2
Synchronizing state for openhab2.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d openhab2 defaults
Executing /usr/sbin/update-rc.d openhab2 disable
insserv: warning: current start runlevel(s) (empty) of script `openhab2' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `openhab2' overrides LSB defaults (0 1 6).
pi@raspberrypi:/var/log $ sudo systemctl daemon-reload
pi@raspberrypi:/var/log $ sudo systemctl enable openhab2.service
Synchronizing state for openhab2.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d openhab2 defaults
insserv: warning: current start runlevel(s) (empty) of script `openhab2' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `openhab2' overrides LSB defaults (0 1 6).
Executing /usr/sbin/update-rc.d openhab2 enable
pi@raspberrypi:/var/log $ sudo systemctl start openhab2.service
pi@raspberrypi:/var/log $
Dec 18 22:59:41 raspberrypi systemd[1]: Reloading.
Dec 18 22:59:43 raspberrypi systemd[1]: Reloading.
Dec 18 22:59:44 raspberrypi systemd[1]: Reloading.
Dec 18 22:59:45 raspberrypi systemd[1]: Reloading.
Dec 18 22:59:45 raspberrypi systemd[1]: Reloading.
Dec 18 22:59:47 raspberrypi systemd[1]: Reloading.
Dec 18 22:59:52 raspberrypi systemd[1]: Reloading.
Dec 18 22:59:54 raspberrypi systemd[1]: Starting The openHAB 2 Home Automation Bus Solution...
Dec 18 22:59:54 raspberrypi systemd[1]: Started The openHAB 2 Home Automation Bus Solution.
Dec 18 22:59:54 raspberrypi start.sh[14030]: Launching the openHAB runtime...
Dec 18 22:59:54 raspberrypi start.sh[14030]: mkdir: cannot create directory ‘/usr/share/openhab2/userdata/tmp’: No such file or directory
Dec 18 23:00:03 raspberrypi start.sh[14030]: KARAF_BASE is not valid: /usr/share/openhab2/userdata
Dec 18 23:00:03 raspberrypi systemd[1]: openhab2.service: main process exited, code=exited, status=1/FAILURE

(Ben Clark) #17

I know this is a service issue because the service is trying to use start.sh, which the systemd files don’t use. It looks like it’s using a really old version of a sysvinit script. So let’s try to disable that too:

sudo systemctl disable openhab2 
sudo update-rc.d openhab2 disable
sudo systemctl daemon-reload
sudo systemctl enable openhab2.service
sudo systemctl start openhab2.service 

If we can stop it from updating from update-rc.d then I’m confident that it’ll start.


(Christos) #18

You know a lot better than me so I trust you :slight_smile:
It is very strange that I am using an old version of that script. Isn’t that being updated ?

I am using openhab on raspbian by the way not openhabian

I still get the same issue

pi@raspberrypi:/etc/openhab2 $ sudo systemctl disable openhab2
Synchronizing state for openhab2.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d openhab2 defaults
Executing /usr/sbin/update-rc.d openhab2 disable
insserv: warning: current start runlevel(s) (empty) of script `openhab2' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `openhab2' overrides LSB defaults (0 1 6).
pi@raspberrypi:/etc/openhab2 $ sudo update-rc.d openhab2 disable
insserv: warning: current start runlevel(s) (empty) of script `openhab2' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `openhab2' overrides LSB defaults (0 1 6).
pi@raspberrypi:/etc/openhab2 $ sudo systemctl daemon-reload
pi@raspberrypi:/etc/openhab2 $ sudo systemctl enable openhab2.service
Synchronizing state for openhab2.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d openhab2 defaults
insserv: warning: current start runlevel(s) (empty) of script `openhab2' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `openhab2' overrides LSB defaults (0 1 6).
Executing /usr/sbin/update-rc.d openhab2 enable
pi@raspberrypi:/etc/openhab2 $ sudo systemctl start openhab2.service
Dec 18 23:34:49 raspberrypi systemd[1]: Reloading.
Dec 18 23:34:51 raspberrypi systemd[1]: Reloading.
Dec 18 23:34:51 raspberrypi systemd[1]: Reloading.
Dec 18 23:34:52 raspberrypi systemd[1]: Reloading.
Dec 18 23:34:52 raspberrypi systemd[1]: Reloading.
Dec 18 23:34:53 raspberrypi systemd[1]: Reloading.
Dec 18 23:34:53 raspberrypi systemd[1]: Reloading.
Dec 18 23:34:54 raspberrypi systemd[1]: Reloading.
Dec 18 23:35:01 raspberrypi systemd[1]: Starting The openHAB 2 Home Automation Bus Solution...
Dec 18 23:35:01 raspberrypi systemd[1]: Started The openHAB 2 Home Automation Bus Solution.
Dec 18 23:35:01 raspberrypi start.sh[19902]: Launching the openHAB runtime...
Dec 18 23:35:01 raspberrypi start.sh[19902]: mkdir: cannot create directory ‘/usr/share/openhab2/userdata/tmp’: No such file or directory
Dec 18 23:35:03 raspberrypi start.sh[19902]: KARAF_BASE is not valid: /usr/share/openhab2/userdata
Dec 18 23:35:03 raspberrypi systemd[1]: openhab2.service: main process exited, code=exited, status=1/FAILURE

Edit: Checking your other post I see that you suggested the command

sudo openhab-cli start --debug

This starts up karaf and openhab. If I exit and then try the above commands the service still does not start with the same errors


(Ben Clark) #19

Eek, I’m sure this must be frustrating for you.

Is the what the service file should look like (notice that the exec start is karaf, not start.sh). Can you confirm that this exists in /usr/lib/systemd/system/openhab2.service


(Christos) #20

It is but I have no demands for an opensource software :slight_smile:

Yes it looks correct I had already checked it while googling the error

pi@raspberrypi:/etc/openhab2 $ cat /usr/lib/systemd/system/openhab2.service
[Unit]
Description=openHAB 2 - empowering the smart home
Documentation=http://docs.openhab.org
Documentation=https://community.openhab.org
Wants=network-online.target
After=network-online.target

[Service]
Environment=OPENHAB_HOME=/usr/share/openhab2
Environment=OPENHAB_CONF=/etc/openhab2
Environment=OPENHAB_RUNTIME=/usr/share/openhab2/runtime
Environment=OPENHAB_USERDATA=/var/lib/openhab2
Environment=OPENHAB_LOGDIR=/var/log/openhab2
Environment=OPENHAB_STARTMODE=daemon
EnvironmentFile=-/etc/default/openhab2

User=openhab
Group=openhab

WorkingDirectory=/usr/share/openhab2
ExecStart=/usr/share/openhab2/runtime/bin/karaf $OPENHAB_STARTMODE
ExecStop=/usr/share/openhab2/runtime/bin/karaf stop

SuccessExitStatus=0 143
RestartSec=5
Restart=on-failure
TimeoutStopSec=120

LimitNOFILE=102642

[Install]
WantedBy=multi-user.target