Docker container 2.5.9 Restarting

I’m seeing openhab restart recently…In portainer I see:

|2020-12-23 14:39:25|network|Container connected to host network|
|2020-12-23 14:39:25|network|Container disconnected from host network|
|2020-12-23 14:39:24|container|Container openhab exited with status code 137|

But nothing is in the openhab logs apart from the start up messages:

2020-12-23 14:39:09.667 [INFO ] [clipse.smarthome.model.script.Node19] - Node19 Changed to Online
2020-12-23 14:39:17.393 [INFO ] [smarthome.model.script.Paradox State] - Container state: running
2020-12-23 14:39:17.419 [INFO ] [smarthome.model.script.Camera Events] - Container state: running
**2020-12-23 14:39:18.409 [INFO ] [arthome.model.script.Mosquitto State] - Container state: running**
**2020-12-23 14:39:44.526 [WARN ] [org.apache.karaf.shell.ssh.SshUtils ] - Configured cipher 'aes256-ctr' not available**
2020-12-23 14:39:44.570 [WARN ] [org.apache.karaf.shell.ssh.SshUtils ] - Configured cipher 'aes192-ctr' not available
2020-12-23 14:39:45.141 [WARN ] [org.apache.karaf.shell.ssh.SshUtils ] - Configured cipher 'aes256-ctr' not available
2020-12-23 14:39:45.142 [WARN ] [org.apache.karaf.shell.ssh.SshUtils ] - Configured cipher 'aes192-ctr' not available
2020-12-23 14:39:49.900 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Time zone set to 'Pacific/Auckland'.
2020-12-23 14:39:49.913 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Location set to '-41.21744137100655,174.90742438161374'.
2020-12-23 14:39:49.922 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Locale set to 'en_NZ'.

I think the 2020-12-23 14:39:44.526 is the first entry upon restart.
Are there any other logs i can look at?

The docker logs are particularly unhelpful just shows the container starting:

2020-12-22T20:07:18.570323901Z org.ops4j.pax.url.wrap [org.ops4j.pax.url.commons.handler.HandlerActivator] DEBUG : Handler for protocols [wrap] started
2020-12-23T01:39:26.357407839Z ++ test -t 0
2020-12-23T01:39:26.361512442Z ++ echo false
2020-12-23T01:39:26.361555372Z + interactive=false
2020-12-23T01:39:26.361569718Z + set -euo pipefail
2020-12-23T01:39:26.361582596Z + IFS='
2020-12-23T01:39:26.361594811Z 	'
2020-12-23T01:39:26.361611450Z + '[' limited = unlimited ']'
2020-12-23T01:39:26.361627450Z + rm -f /openhab/runtime/instances/instance.properties
2020-12-23T01:39:26.402471541Z + rm -f /openhab/userdata/tmp/instances/instance.properties
2020-12-23T01:39:26.423361205Z + NEW_USER_ID=1000
2020-12-23T01:39:26.424509449Z + NEW_GROUP_ID=1001
2020-12-23T01:39:26.426238393Z + echo 'Starting with openhab user id: 1000 and group id: 1001'
2020-12-23T01:39:26.427401812Z Starting with openhab user id: 1000 and group id: 1001
2020-12-23T01:39:26.436141624Z + id -u openhab
2020-12-23T01:39:26.465222958Z + initialize_volume /openhab/conf /openhab/dist/conf
2020-12-23T01:39:26.466156832Z + volume=/openhab/conf
2020-12-23T01:39:26.466618370Z + source=/openhab/dist/conf
2020-12-23T01:39:26.475211987Z ++ ls -A /openhab/conf
2020-12-23T01:39:26.481830080Z + '[' -z 'a.out
2020-12-23T01:39:26.481885907Z .git
2020-12-23T01:39:26.481899930Z .gitattributes
2020-12-23T01:39:26.481912401Z html
2020-12-23T01:39:26.481924156Z icons
2020-12-23T01:39:26.481938618Z items
2020-12-23T01:39:26.481953413Z persistence
2020-12-23T01:39:26.481968036Z README.txt
2020-12-23T01:39:26.482015068Z rules
2020-12-23T01:39:26.482030152Z scripts
2020-12-23T01:39:26.482043282Z services
2020-12-23T01:39:26.482055436Z sitemaps
2020-12-23T01:39:26.482066225Z sounds
2020-12-23T01:39:26.482076888Z things
2020-12-23T01:39:26.482087646Z transform
2020-12-23T01:39:26.482100591Z .vscode' ']'
2020-12-23T01:39:26.482133976Z + initialize_volume /openhab/userdata /openhab/dist/userdata
2020-12-23T01:39:26.482164950Z + volume=/openhab/userdata
2020-12-23T01:39:26.482178645Z + source=/openhab/dist/userdata
2020-12-23T01:39:26.483909633Z ++ ls -A /openhab/userdata
2020-12-23T01:39:26.488569609Z + '[' -z 'backup
2020-12-23T01:39:26.488621178Z cache
2020-12-23T01:39:26.488635888Z config
2020-12-23T01:39:26.488649865Z etc
2020-12-23T01:39:26.488662993Z habmin
2020-12-23T01:39:26.488676059Z jsondb
2020-12-23T01:39:26.488688890Z logs
2020-12-23T01:39:26.488702202Z openhabcloud
2020-12-23T01:39:26.488715403Z persistence
2020-12-23T01:39:26.488727993Z temp
2020-12-23T01:39:26.488740813Z tmp
2020-12-23T01:39:26.488753614Z uuid
2020-12-23T01:39:26.488765774Z zwave' ']'
2020-12-23T01:39:26.490680723Z ++ cmp /openhab/userdata/etc/version.properties /openhab/dist/userdata/etc/version.properties
2020-12-23T01:39:26.502114741Z + '[' '!' -z ']'
2020-12-23T01:39:26.502188292Z + chown -R openhab:openhab /openhab
2020-12-23T01:39:27.846668201Z + sync
2020-12-23T01:39:28.032682957Z + '[' -d /etc/cont-init.d ']'
2020-12-23T01:39:28.032755723Z + sync
2020-12-23T01:39:28.108769651Z + '[' false == false ']'
2020-12-23T01:39:28.109535734Z ++ IFS=' '
2020-12-23T01:39:28.109566831Z ++ echo gosu openhab tini -s ./start.sh
2020-12-23T01:39:28.111496027Z + '[' 'gosu openhab tini -s ./start.sh' == 'gosu openhab tini -s ./start.sh' ']'
2020-12-23T01:39:28.111593155Z + command=($@ server)
2020-12-23T01:39:28.111625007Z + exec gosu openhab tini -s ./start.sh server
2020-12-23T01:39:28.150722514Z Launching the openHAB runtime...
2020-12-23T01:39:35.670609618Z org.ops4j.pax.url.wrap [org.ops4j.pax.url.commons.handler.HandlerActivator] DEBUG : Handler for protocols [wrap] started

The only thing I can say is I’m running in Docker and have not had any unexpected restarts. I’m not really sure how to even go about debugging this. Maybe search the Karaf projects and docs to find out what an error return code of 137 means.

So i think my issue was running out of total memory on the the host.

I’d never before set memory limits on docker containers, so have done that now. Constrained openhab container to 1gb.

How do I tell java to limit itself as well? They should match I feel.

Also I had homeassistant running, but cant’ remember the last time I went in it, that was consuming about 1g as well.

You’d want it to be less as there is some overhead in the container itself. There are a couple of command line arguments you can set by passing them in as the JAVA_OPT environment variable (I’m going from memory but it’s documented in dockerhub. The arguments are xmxXXX and xmsXXX where XXX is the number of MB.

But I’m not sure it matters if you set them. Whether the container runs out of memory it Java his The max heap it’s going to crash with out of memory errors.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.