Daemon shuts down after upgrade to 2.2

I am running a local installation of OH 2.1. Running on a raspi 3 with raspbian Jessie 4.1.20-v7+

I did an upgrade to 2.2 with the build in upgrade script and since then the systemctl script fails to bring the server fully up.
i.e. the server starts up, runs for a brief moment and then just shuts down again… gracefully.

in the openhab.log this looks sthl like this:

2018-01-23 16:02:51.724 [INFO ] [b.core.service.AbstractActiveService] - TCP Refresh Service has been started
2018-01-23 16:02:51.727 [INFO ] [ing.tcp.protocol.internal.TCPBinding] - The preamble for all write operations will be set to the default value of ""
2018-01-23 16:02:51.730 [INFO ] [ing.tcp.protocol.internal.TCPBinding] - The postamble for all write operations will be set to the default value of ""
2018-01-23 16:02:51.740 [WARN ] [ing.tcp.AbstractSocketChannelBinding] - When using address masks we will not verify if we are already listening to similar incoming connections
2018-01-23 16:02:51.753 [INFO ] [ing.tcp.AbstractSocketChannelBinding] - We will accept data coming from the remote end 192.168.0.108:*
2018-01-23 16:02:51.753 [INFO ] [ing.tcp.protocol.internal.TCPBinding] - The characterset will be set to the default value of ASCII
2018-01-23 16:03:07.473 [INFO ] [ui.habmin.internal.servlet.HABminApp] - Started HABmin servlet at /habmin
2018-01-23 16:03:08.403 [INFO ] [pse.smarthome.model.script.Homematic] - Terasse geschaltet
2018-01-23 16:03:08.407 [INFO ] [pse.smarthome.model.script.Homematic] - Haustuere geschaltet
2018-01-23 16:03:08.475 [INFO ] [pse.smarthome.model.script.Homematic] - Waschkueche geschaltet
2018-01-23 16:03:08.482 [INFO ] [pse.smarthome.model.script.Homematic] - Keller_glas geschaltet
2018-01-23 16:03:13.587 [INFO ] [basic.internal.servlet.WebAppServlet] - Stopped Basic UI
2018-01-23 16:03:40.996 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Daemmerung': An error occurred during the script execution: null
2018-01-23 16:03:41.259 [INFO ] [nx.internal.connection.KNXConnection] - Closing KNX connection
2018-01-23 16:03:41.448 [INFO ] [penhab.io.transport.mqtt.MqttService] - Stopping broker connection 'mosquitto'
2018-01-23 16:03:41.492 [WARN ] [ence.internal.PersistenceManagerImpl] - Failed to delete cron job for dbId 'rrd4j'
2018-01-23 16:03:41.516 [INFO ] [b.core.service.AbstractActiveService] - HTTP Refresh Service has been shut down
2018-01-23 16:03:41.610 [INFO ] [b.core.service.AbstractActiveService] - TCP Refresh Service has been shut down
2018-01-23 16:03:41.872 [INFO ] [ui.habmin.internal.servlet.HABminApp] - Stopped HABmin servlet
2018-01-23 16:03:43.013 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Stopped Paper UI
2018-01-23 16:03:43.079 [INFO ] [.dashboard.internal.DashboardService] - Stopped dashboard

When I use the start.sh script - the server starts up fine and keeps running as long as I keep the console open.

I have done the following so far:
Deleted the tmp and cache folder
systemctl daemon-reload
reboot of the whole system

log:tail in the karaf console (nothing obviously different.)

16:07:24.081 [INFO ] [ab.core.service.AbstractActiveService] - TCP Refresh Service has been started
16:07:24.094 [WARN ] [ding.tcp.AbstractSocketChannelBinding] - When using address masks we will not verify if we are already listening to similar incoming connections
16:07:24.099 [INFO ] [ding.tcp.AbstractSocketChannelBinding] - We will accept data coming from the remote end 192.168.0.108:*
16:07:24.727 [INFO ] [smarthome.event.ItemStateChangedEvent] - Wohnzimmer_temp changed from NULL to 19.3
- more stuff initialising-
16:07:27.379 [INFO ] [smarthome.event.ItemStateChangedEvent] - Rasen2 changed from NULL to OFF
16:07:27.713 [INFO ] [.ui.habmin.internal.servlet.HABminApp] - Started HABmin servlet at /habmin
- more stuff initialising-
16:07:28.757 [INFO ] [smarthome.event.ItemStateChangedEvent] - Garagentaster changed from NULL to 100
16:07:28.765 [INFO ] [smarthome.event.ItemStateChangedEvent] - Garage_stop changed from NULL to ON
- more stuff initialising-
16:07:28.841 [INFO ] [smarthome.event.ItemStateChangedEvent] - EG_PS_Esszimmer_sperren changed from NULL to OFF
- more stuff initialising-
16:08:42.406 [INFO ] [smarthome.event.ItemStateChangedEvent] - stromzaehler_bezug changed from 3173.717 to 3173.723
16:08:42.422 [INFO ] [smarthome.event.ItemStateChangedEvent] - stromzaehler_aktuell changed from 65.000 to 208.000

The only thing that is definately going wrong is the initialisation of homegear (for Homematic) where I get the same error in both cases. Yet when OH is running, homematic devices are running fine as well.

16:06:35.221 [INFO ] [nternal.communicator.client.RpcClient] - Interface 'WIRED' on gateway '24711b1e' not available, disabling support
16:06:35.231 [INFO ] [nternal.communicator.client.RpcClient] - Interface 'HMIP' on gateway '24711b1e' not available, disabling support
16:06:35.239 [INFO ] [nternal.communicator.client.RpcClient] - Interface 'CUXD' on gateway '24711b1e' not available, disabling support
16:06:35.249 [INFO ] [nternal.communicator.client.RpcClient] - Interface 'GROUP' on gateway '24711b1e' not available, disabling support
16:06:35.436 [INFO ] [communicator.AbstractHomematicGateway] - HmGatewayInfo[id=HOMEGEAR,type=Homegear,firmware=0.7.14-1563,address=VBC8594994,wired=false,hmip=false,cuxd=false,group=false]
16:06:35.531 [INFO ] [knx.internal.connection.KNXConnection] - Established connection to KNX bus on 127.0.0.1:3671 in mode TUNNEL.
16:06:36.081 [INFO ] [ing.homematic.internal.misc.MiscUtils] - Datapoint name 'HM-XMLRPC-Client/Client.php' contains invalid characters, new Datapoint name 'HM-XMLRPC-Client_Client_php'
16:06:36.087 [INFO ] [ing.homematic.internal.misc.MiscUtils] - Datapoint name 'ReadMe.txt' contains invalid characters, new Datapoint name 'ReadMe_txt'
16:06:36.092 [INFO ] [ing.homematic.internal.misc.MiscUtils] - Datapoint name 'Connect.php' contains invalid characters, new Datapoint name 'Connect_php'
16:06:36.097 [INFO ] [ing.homematic.internal.misc.MiscUtils] - Datapoint name 'GetID.php' contains invalid characters, new Datapoint name 'GetID_php'
16:06:36.102 [INFO ] [ing.homematic.internal.misc.MiscUtils] - Datapoint name 'Test.php' contains invalid characters, new Datapoint name 'Test_php'

What does your systemctl script look like?

When openHAB fails, what is the output of sudo journalctl -u <servicename> -b

the output when openhab fails is:

Jan 23 22:02:51 pi2 start.sh[9075]: Launching the openHAB runtime...
Jan 23 22:03:04 pi2 start.sh[9075]:                           __  _____    ____
Jan 23 22:03:04 pi2 start.sh[9075]:   ____  ____  ___  ____  / / / /   |  / __ )
Jan 23 22:03:04 pi2 start.sh[9075]:  / __ \/ __ \/ _ \/ __ \/ /_/ / /| | / __  |
Jan 23 22:03:04 pi2 start.sh[9075]: / /_/ / /_/ /  __/ / / / __  / ___ |/ /_/ /
Jan 23 22:03:04 pi2 start.sh[9075]: \____/ .___/\___/_/ /_/_/ /_/_/  |_/_____/
Jan 23 22:03:04 pi2 start.sh[9075]:     /_/                        2.2.0
Jan 23 22:03:04 pi2 start.sh[9075]:                                Release Build
Jan 23 22:03:04 pi2 start.sh[9075]: Hit '<tab>' for a list of available commands
Jan 23 22:03:04 pi2 start.sh[9075]: and '[cmd] --help' for help on a specific command.
Jan 23 22:03:04 pi2 start.sh[9075]: Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown openHAB.
Jan 23 22:03:06 pi2 start.sh[9075]: openhab> Error executing command: java.lang.NullPointerException

not very enlightening… a NullPointer Exception - but where remains unclear.

I’d have guessed that the Rule “Daemmerung” might be to blame, but actually the BasicUI shuts down before the entry in the log. Also the very same rule was fine in 2.1

The systemd script looks like this:

[Unit]
Description=Starts and stops the openHAB Home Automation Bus
Documentation=http://www.openhab.org
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
GuessMainPID=yes
User=root
ExecStart=/opt/openhab2/start.sh
ExecStop=kill -SIGINT $MAINPID
Restart=on-failure
WorkingDirectory=/opt/openhab2

[Install]
WantedBy=multi-user.target

I might be onto sth.

I changed the call of the start script

ExecStart=/opt/openhab2/start.sh server

and so far it seems to work now

1 Like

That’s right, server should be used within a service file. You’ll get more helpful output to journalctl too.