Hi all
I have problem with start script after upgrade to openhab 2.2 if I run systemctl start openhab2, openhab 2.2 try to starts but with no success. In /var/log syslog I get
Dec 18 19:48:22 localhost start.sh[23567]: Launching the openHAB runtime…
Dec 18 19:48:25 localhost start.sh[23567]: null
Dec 18 19:48:25 localhost start.sh[23567]: Error occurred shutting down framework: java.lang.NumberFormatException: null
Dec 18 19:48:25 localhost start.sh[23567]: java.lang.NumberFormatException: null
Dec 18 19:48:25 localhost start.sh[23567]: at java.lang.Integer.parseInt(Integer.java:542)
Dec 18 19:48:25 localhost start.sh[23567]: at java.lang.Integer.parseInt(Integer.java:615)
Dec 18 19:48:25 localhost start.sh[23567]: at org.apache.karaf.main.ConfigProperties.(ConfigProperties.java:214)
Dec 18 19:48:25 localhost start.sh[23567]: at org.apache.karaf.main.Main.updateInstancePidAfterShutdown(Main.java:228)
Dec 18 19:48:25 localhost start.sh[23567]: at org.apache.karaf.main.Main.main(Main.java:193)
Dec 18 19:48:25 localhost systemd[1]: openhab2.service: main process exited, code=exited, status=254/n/a
Dec 18 19:48:25 localhost systemd[1]: Unit openhab2.service entered failed state.
Dec 18 19:48:25 localhost wpa_supplicant[887]: wlan0: Failed to initiate sched scan
Dec 18 19:48:25 localhost systemd[1]: openhab2.service holdoff time over, scheduling restart.
Dec 18 19:48:25 localhost systemd[1]: Stopping Starts and stops the openHAB Home Automation Bus…
Dec 18 19:48:25 localhost systemd[1]: Starting Starts and stops the openHAB Home Automation Bus…
Dec 18 19:48:25 localhost systemd[1]: Started Starts and stops the openHAB Home Automation Bus.
If I run /usr/share/openhab2/start.sh openhab starts…
btw
After upgrade i have to manually create directory userdata in /usr/share/openhab
java -version
java version "1.8.0_151"
Java™ SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot™ Client VM (build 25.151-b12, mixed mode)
uname -a
Linux cubietruck 4.13.16-sunxi #20 SMP Fri Nov 24 19:50:07 CET 2017 armv7l GNU/Linux
Hi
If I run sudo openhab-cli start --debug
I get
root@cubietruck:/lib/systemd/system# 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…
Listening for transport dt_socket at address: 5005
Hit ‘’ for a list of available commands
and ‘[cmd] --help’ for help on a specific command.
Hit ‘’ or type ‘system:shutdown’ or ‘logout’ to shutdown openHAB.
openhab> 22:58:16.750 [CM Configuration Updater (ManagedService Update: pid=[org.openhab.mail])] ERROR org.apache.felix.configadmin - [org.openhab.core.scriptengine.action.ActionService, org.osgi.service.cm.ManagedService, id=134, bundle=235/mvn:org.openhab.action/org.openhab.action.mail/1.11.0]: Updating property mail of configuration org.openhab.mail caused a problem: Parameters mail:hostname and mail:from are mandatory and must be configured. Please check your openhab.cfg!
org.osgi.service.cm.ConfigurationException: mail : Parameters mail:hostname and mail:from are mandatory and must be configured. Please check your openhab.cfg!
at org.openhab.action.mail.internal.MailActionService.updated(MailActionService.java:86) [235:org.openhab.action.mail:1.11.0]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189) [7:org.apache.felix.configadmin:1.8.16]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152) [7:org.apache.felix.configadmin:1.8.16]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85) [7:org.apache.felix.configadmin:1.8.16]
at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1479) [7:org.apache.felix.configadmin:1.8.16]
at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1435) [7:org.apache.felix.configadmin:1.8.16]
at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141) [7:org.apache.felix.configadmin:1.8.16]
at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109) [7:org.apache.felix.configadmin:1.8.16]
at java.lang.Thread.run(Thread.java:748) [?:?]
openhab starts
but if i run systemctl start openhab2.service openhab is trying to start but it can’t.
my openhab2.service looks like that
Unit]
Description=Starts and stops the openHAB Home Automation Bus
Documentation=http://www.openhab.org
Wants=network-online.target
After=network-online.target
Can’t get openHAB up and running either getting this error in the logs when trying to start’
Dec 18 23:06:58 raspberrypi systemd[1]: Starting The openHAB 2 Home Automation Bus Solution...
Dec 18 23:06:58 raspberrypi systemd[1]: Started The openHAB 2 Home Automation Bus Solution.
Dec 18 23:06:58 raspberrypi start.sh[2312]: Launching the openHAB runtime...
Dec 18 23:07:00 raspberrypi start.sh[2312]: null
Dec 18 23:07:00 raspberrypi start.sh[2312]: Error occurred shutting down framework: java.lang.NumberFormatException: null
Dec 18 23:07:00 raspberrypi start.sh[2312]: java.lang.NumberFormatException: null
Dec 18 23:07:00 raspberrypi start.sh[2312]: at java.lang.Integer.parseInt(Integer.java:542)
Dec 18 23:07:00 raspberrypi start.sh[2312]: at java.lang.Integer.parseInt(Integer.java:615)
Dec 18 23:07:00 raspberrypi start.sh[2312]: at org.apache.karaf.main.ConfigProperties.<init>(ConfigProperties.java:214)
Dec 18 23:07:00 raspberrypi start.sh[2312]: at org.apache.karaf.main.Main.updateInstancePidAfterShutdown(Main.java:228)
Dec 18 23:07:00 raspberrypi start.sh[2312]: at org.apache.karaf.main.Main.main(Main.java:193)
Dec 18 23:07:00 raspberrypi systemd[1]: openhab2.service: main process exited, code=exited, status=254/n/a
Dec 18 23:07:00 raspberrypi kill[2448]: kill: invalid argument S
java version "1.8.0_151"
Java™ SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot™ Client VM (build 25.151-b12, mixed mode)
I can get openhab to start as a non service using @Benjy comments.
I decided to remove 2.1 and install 2.2 I now have the Welcome to openHAB 2 - Initial Setup screen in my browser but when I select standard the browser try’s going to start/inbox page but just stays on the Welcome to openHAB 2 - Initial Setup screen.
Nothing happens either when I select Standard or Demo
So does that log change at all with restarts? Is that timestamp current? I suspect that if it’s not then you should reinstall with the default logging configuration:
Moving openhab2.service fixed it for me with manual installation. Docs probably should be updated as I ended up reloading from scratch. Although I’m having other problems and might revert to the upgraded version if they don’t go away.
Thank you @Benjy, I had also the issue that OpenHAB did not start after upgrading fom 2.1 -> 2.2. Removing the contents of /var/lib/openhab2/cache/ and /var/lib/openhab2/tmp/ solved the issue for me.
I was using apt to upgrade. Maybe the package should clear cache and tmp automatically.
The installation package does this automatically after the install completes, but for reasons I can’t explain just yet the first run of a new update sometimes (only rarely) runs better after a cache/tmp removal.
I will add a cli shortcut so that the command:
sudo openhab-cli clean-cache
is all that would be needed, instead of having to remember and type out the directories each time.