[SOLVED] Openhab runtime "hang" on Docker container in Synology NAS

Continuing the discussion from OpenHAB3 Docker Test Instance on Synology:

  • Platform information: SynologyDS1019+
    • Hardware: INTEL Celeron J3455 / 8 GB RAM
    • OS: DSM 6.2.3

I’m attempting to run an openHAB container in Docker on a Synology NAS.

My openhab container starts but hangs and will not successfully launch runtime, and will hang presumably infinitely.
openhab itself seems to work properly in the UI, as I’m able to add the Z-wave binding I needed and discover the Z-wave stick and things on my Z-wave network. As a consequence of the runtime hang I cannot access the openhab CLI. Any ideas? I’ve my docker-compose file is embedded below.

version: "3.3"  # current test

services:
  openhab:
    container_name: openhab
    image: "openhab/openhab:latest"
    restart: always
    network_mode: host
    volumes:
      - "/etc/localtime:/etc/localtime:ro"
      - "/etc/TZ:/etc/timezone:ro"
      - "./addons:/openhab/addons"
      - "./conf:/openhab/conf"
      - "./userdata:/openhab/userdata"
    environment:
      USER_ID: "1027"
      OPENHAB_HTTP_PORT: "8080"
      OPENHAB_HTTPS_PORT: "8443"
      EXTRA_JAVA_OPTS: "-Dgnu.io.rxtx.SerialPorts=/dev/ttyACM0"
      LC_ALL: "en_US.UTF-8"
      LANG: "en_US.UTF-8"
      LANGUAGE: "en_US.UTF-8"
    devices:
      - "/dev/ttyACM0"

Thanks for reading -Ekona

I am a bit confused by your issue. If you are able to access the UI and add bindings, then OpenHab is not hung. However, if you cant access the CLI, then perhaps you didn’t change the Karaf console port per the below:

Old Ag

Thanks for replying…I changed the ssh port as advised and restarted the container, the same problem persists.
Perhaps I’m explaining wrong–by “hang” I mean that the container log for openhab is stuck on “Launching the openHAB runtime…” and the command line does not accept input nor displays “openhab>” as usual.

This is the log from openhab/userdata/logs; most warns seem to be from Z-wave things not being discovering properly due to miscommunication between Z-wave nodes not having to do with openhab:

2021-01-07 14:28:44.339 [INFO ] [org.openhab.ui.internal.UIService   ] - Started UI on port 8080
2021-01-07 14:28:54.540 [WARN ] [org.openhab.core.net.NetUtil        ] - Found multiple local interfaces - ignoring 192.168.100.169
2021-01-07 14:28:55.493 [INFO ] [.core.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
2021-01-07 14:28:57.884 [INFO ] [e.automation.internal.RuleEngineImpl] - Rule engine started.
2021-01-07 14:29:08.267 [INFO ] [ab.ui.habpanel.internal.HABPanelTile] - Started HABPanel at /habpanel
2021-01-07 14:29:13.664 [WARN ] [.io.rest.auth.internal.TokenResource] - Couldn't find a user with a session matching the provided refresh_token
2021-01-07 14:29:13.667 [WARN ] [.io.rest.auth.internal.TokenResource] - Token issuing failed: invalid_grant
2021-01-07 14:29:21.833 [INFO ] [p.auth.internal.AuthorizePageServlet] - First user account created: openhab
2021-01-07 14:29:24.686 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Time zone set to 'America/Los_Angeles'.
2021-01-07 14:29:24.695 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Locale set to 'en_US'.
2021-01-07 14:29:57.539 [INFO ] [zwave.handler.ZWaveControllerHandler] - Attempting to add listener when controller is null
2021-01-07 14:30:02.642 [INFO ] [ve.internal.protocol.ZWaveController] - Starting ZWave controller
2021-01-07 14:30:02.643 [INFO ] [ve.internal.protocol.ZWaveController] - ZWave timeout is set to 5000ms. Soft reset is false.
2021-01-07 14:30:47.120 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'zwave:device:d3b887c4da:node40' to inbox.
2021-01-07 14:30:58.971 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'zwave:device:d3b887c4da:node43' to inbox.
2021-01-07 14:32:04.233 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'zwave:device:d3b887c4da:node39' to inbox.
2021-01-07 14:32:30.589 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'zwave:device:d3b887c4da:node63' to inbox.
2021-01-07 14:32:43.979 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'zwave:device:d3b887c4da:node45' to inbox.
2021-01-07 14:32:44.544 [WARN ] [wave.discovery.ZWaveDiscoveryService] - NODE 57: Device discovery could not resolve to a thingType! 0047:5A52:54FF::1.8
2021-01-07 14:32:44.548 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'zwave:device:d3b887c4da:node57' to inbox.
2021-01-07 14:32:58.237 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'zwave:device:d3b887c4da:node55' to inbox.
2021-01-07 14:32:58.538 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'zwave:device:d3b887c4da:node46' to inbox.
2021-01-07 14:33:51.012 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'zwave:device:d3b887c4da:node64' to inbox.
2021-01-07 14:34:04.284 [WARN ] [wave.discovery.ZWaveDiscoveryService] - NODE 58: Device discovery could not resolve to a thingType! 0047:5A52:54FF::1.8
2021-01-07 14:34:04.286 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'zwave:device:d3b887c4da:node58' to inbox.
2021-01-07 14:34:04.978 [WARN ] [wave.discovery.ZWaveDiscoveryService] - NODE 52: Device discovery could not resolve to a thingType! 0047:5A52:54FF::1.8
2021-01-07 14:34:04.982 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'zwave:device:d3b887c4da:node52' to inbox.
2021-01-07 14:34:56.870 [WARN ] [wave.discovery.ZWaveDiscoveryService] - NODE 51: Device discovery could not resolve to a thingType! 0047:5A52:54FF::1.8
2021-01-07 14:34:56.872 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'zwave:device:d3b887c4da:node51' to inbox.
2021-01-07 14:34:56.915 [WARN ] [wave.discovery.ZWaveDiscoveryService] - NODE 62: Device discovery could not resolve to a thingType! 0047:5A52:54FF::1.8
2021-01-07 14:34:56.917 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'zwave:device:d3b887c4da:node62' to inbox.
2021-01-07 14:34:58.083 [WARN ] [wave.discovery.ZWaveDiscoveryService] - NODE 50: Device discovery could not resolve to a thingType! 0047:5A52:54FF::1.8
2021-01-07 14:34:58.085 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'zwave:device:d3b887c4da:node50' to inbox.
2021-01-07 14:34:58.126 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'zwave:device:d3b887c4da:node41' to inbox.
2021-01-07 14:34:59.320 [WARN ] [wave.discovery.ZWaveDiscoveryService] - NODE 49: Device discovery could not resolve to a thingType! 0047:5A52:54FF::1.8
2021-01-07 14:34:59.325 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'zwave:device:d3b887c4da:node49' to inbox.
2021-01-07 14:34:59.370 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'zwave:device:d3b887c4da:node38' to inbox.
2021-01-07 14:34:59.986 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'zwave:device:d3b887c4da:node44' to inbox.
2021-01-07 14:35:35.175 [WARN ] [wave.discovery.ZWaveDiscoveryService] - NODE 61: Device discovery could not resolve to a thingType! 0047:5A52:54FF::1.8
2021-01-07 14:35:35.177 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'zwave:device:d3b887c4da:node61' to inbox.
2021-01-07 14:35:39.845 [WARN ] [wave.discovery.ZWaveDiscoveryService] - NODE 53: Device discovery could not resolve to a thingType! 0047:5A52:54FF::1.8
2021-01-07 14:35:39.847 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'zwave:device:d3b887c4da:node53' to inbox.
2021-01-07 14:36:19.311 [WARN ] [wave.discovery.ZWaveDiscoveryService] - NODE 48: Device discovery could not resolve to a thingType! 0047:5A52:54FF::1.8
2021-01-07 14:36:19.313 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'zwave:device:d3b887c4da:node48' to inbox.
2021-01-07 14:36:32.115 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'zwave:device:d3b887c4da:node56' to inbox.
2021-01-07 14:36:45.816 [WARN ] [wave.discovery.ZWaveDiscoveryService] - NODE 60: Device discovery could not resolve to a thingType! 0047:5A52:54FF::1.8
2021-01-07 14:36:45.818 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'zwave:device:d3b887c4da:node60' to inbox.
2021-01-07 14:37:33.751 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'zwave:device:d3b887c4da:node42' to inbox.
2021-01-07 14:37:50.888 [WARN ] [wave.discovery.ZWaveDiscoveryService] - NODE 59: Device discovery could not resolve to a thingType! 0047:5A52:54FF::1.8
2021-01-07 14:37:50.893 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'zwave:device:d3b887c4da:node59' to inbox.
2021-01-07 14:38:04.445 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'zwave:device:d3b887c4da:node54' to inbox.
2021-01-07 14:38:04.835 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'zwave:device:d3b887c4da:node47' to inbox.
2021-01-07 16:43:44.552 [WARN ] [org.apache.karaf.shell.ssh.Activator] - Error starting activator
java.lang.IllegalStateException: Service not tracked for class interface org.osgi.service.cm.ConfigurationAdmin
	at org.apache.karaf.util.tracker.BaseActivator.getTrackedService(BaseActivator.java:369) ~[bundleFile:?]
	at org.apache.karaf.util.tracker.BaseActivator.ensureStartupConfiguration(BaseActivator.java:154) ~[bundleFile:?]
	at org.apache.karaf.shell.ssh.Activator.doStart(Activator.java:96) ~[bundleFile:?]
	at org.apache.karaf.util.tracker.BaseActivator.run(BaseActivator.java:312) [bundleFile:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:834) [?:?]
2021-01-07 16:52:59.720 [INFO ] [ab.ui.habpanel.internal.HABPanelTile] - Stopped HABPanel
2021-01-07 16:52:59.951 [INFO ] [basic.internal.servlet.WebAppServlet] - Stopped Basic UI
2021-01-07 16:53:00.011 [INFO ] [org.openhab.ui.internal.UIService   ] - Stopped UI

thank you

The log behavior is totally normal I think. For me it has been like this all the way back already with oh2.

The container log doesn’t show the openhab log files like openhab.log or events.log

So after successfully starting openhab (launching runtime) there should be no more logs in the container. Only in very rare cases I get additional log lines here, I think if an error on OS level occurs.

For the 2nd part (command line) I not really sure what you mean?

i can confirm that the protocol part of my container (in syno UI) mostly doesn’t show anything after OH has started. I guess you refer to this screen:

going to the terminal tab almost always shows me first a blinking cursor but nothing more:

hitting ‘enter’ one time then shows me this and i can use the karaf console:

Running OH3.1 Snapshot at the moment but this behaviour hasn’t changed for me from the very beginning of OH in Docker on Syno…

Regards,
T.

Here are my respective OH container log and karaf console below–the console does not respond to any keystrokes at all, and when I mentioned “command line” I meant the karaf console, my mistake:


as I mentioned OH seems to work fine so far but who knows what problems this could be causing me in the future.

The log output looks exactly the same for me. There is nothing more to log as this is the container log and not the openhab log. There should really be no issue.

For the Karaf console part I can’t say much as I never used it from the DSM Docker UI. I always log into Karaf via ssh from VS code.

I agree Sebastian, but was wary of my own conclusions. I’ll document if anything comes up

Thank you,
-E

1 Like