Exec instance started: /bin/sh -c curl -f http://localhost:${OPENHAB_HTTP_PORT}/ || exit 1

Referring to my reported issue on GitHub, I hope someone of you can support me :frowning:
(Exec instance started: /bin/sh -c curl -f http://localhost:${OPENHAB_HTTP_PORT}/ || exit 1 路 Issue #408 路 openhab/openhab-docker 路 GitHub)

Portainer Event Log is showing frequent and repeated entries

2022-10-19 16:23:00 | container | Exec instance exited
2022-10-19 16:23:00 | container | Exec instance started: /bin/sh -c curl -f http://localhost:${OPENHAB_HTTP_PORT}/ || exit 1
2022-10-19 16:23:00 | container | Exec instance created: /bin/sh -c curl -f http://localhost:${OPENHAB_HTTP_PORT}/ || exit 1
2022-10-19 16:18:00 | container | Exec instance exited
2022-10-19 16:17:59 | container | Exec instance started: /bin/sh -c curl -f http://localhost:${OPENHAB_HTTP_PORT}/ || exit 1
2022-10-19 16:17:59 | container | Exec instance created: /bin/sh -c curl -f http://localhost:${OPENHAB_HTTP_PORT}/ || exit 1
2022-10-19 16:12:59 | container | Exec instance exited
2022-10-19 16:12:59 | container | Exec instance started: /bin/sh -c curl -f http://localhost:${OPENHAB_HTTP_PORT}/ || exit 1
2022-10-19 16:12:59 | container | Exec instance created: /bin/sh -c curl -f http://localhost:${OPENHAB_HTTP_PORT}/ || exit 1
2022-10-19 16:07:59 | container | Exec instance exited
2022-10-19 16:07:59 | container | Exec instance started: /bin/sh -c curl -f http://localhost:${OPENHAB_HTTP_PORT}/ || exit 1
2022-10-19 16:07:59 | container | Exec instance created: /bin/sh -c curl -f http://localhost:${OPENHAB_HTTP_PORT}/ || exit 1
2022-10-19 16:02:59 | container | Exec instance exited
2022-10-19 16:02:59 | container | Exec instance started: /bin/sh -c curl -f http://localhost:${OPENHAB_HTTP_PORT}/ || exit 1
2022-10-19 16:02:59 | container | Exec instance created: /bin/sh -c curl -f http://localhost:${OPENHAB_HTTP_PORT}/ || exit 1
2022-10-19 15:57:59 | container | Exec instance exited
2022-10-19 15:57:59 | container | Exec instance started: /bin/sh -c curl -f http://localhost:${OPENHAB_HTTP_PORT}/ || exit 1
2022-10-19 15:57:59 | container | Exec instance created: /bin/sh -c curl -f http://localhost:${OPENHAB_HTTP_PORT}/ || exit 1

Summary
Log files within Portainer show events with regard to OPENHAB_HTTP_PORT

Expected Behavior
No error events are shown in the event log.

Current Behavior
container | Exec instance exited
container | Exec instance started: /bin/sh -c curl -f http://localhost:${OPENHAB_HTTP_PORT}/ || exit 1
container | Exec instance created: /bin/sh -c curl -f http://localhost:${OPENHAB_HTTP_PORT}/ || exit 1

Possible Solution
Adapt configuration and/or start command to fix these entries.

Steps to Reproduce
docker run
鈥搉ame openhab
鈥搉et=host
-v /etc/localtime:/etc/localtime:ro
-v /etc/timezone:/etc/timezone:ro
-v /opt/openhab/conf:/openhab/conf
-v /opt/openhab/userdata:/openhab/userdata
-v /opt/openhab/addons:/openhab/addons
-d
-e OPENHAB_HTTP_PORT=8081
-e OPENHAB_HTTPS_PORT=8444
-e USER_ID=$USER_ID
-e GROUP_ID=$GROUP_ID
鈥搑estart=always
openhab/openhab:latest

Context
These entries are spamming the event log

Your Environment
Raspberry Pi 4 Model B Rev 1.5
Docker version 20.10.5+dfsg1, build 55c4c88

PRETTY_NAME=鈥淒ebian GNU/Linux 11 (bullseye)鈥
NAME=鈥淒ebian GNU/Linux鈥
VERSION_ID=鈥11鈥
VERSION=鈥11 (bullseye)鈥
VERSION_CODENAME=bullseye
ID=debian
HOME_URL=鈥https://www.debian.org/鈥
SUPPORT_URL=鈥https://www.debian.org/support鈥
BUG_REPORT_URL=鈥https://bugs.debian.org/鈥

Image
openhab/openhab:latest
Debian GNU/Linux 11 (bullseye)

Docker Host
pi@raspberrypi4:~ $ docker info
Client:
Context: default
Debug Mode: false
Plugins:
compose: Docker Compose (Docker Inc., v2.12.0)

Server:
Containers: 4
Running: 3
Paused: 0
Stopped: 1
Images: 4
Server Version: 20.10.5+dfsg1
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 1.4.13ds1-1deb11u2
runc version: 1.0.0~rc93+ds1-5+deb11u2
init version:
Security Options:
seccomp
Profile: default
cgroupns
Kernel Version: 5.15.65-v8+
Operating System: Debian GNU/Linux 11 (bullseye)
OSType: linux
Architecture: aarch64
CPUs: 4
Total Memory: 7.629GiB
Name: raspberrypi4
ID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

Configuration
Start via Docker run command

I am wondering how it could be that it refers to curl and 鈥榚xec instance鈥 ( is the later meaning the exec binding or is this something different like exec a process ? ). Is this something special for that docker build OH as I think the basic OH installation does not make use of curl nor of exec binding.
Seems to be executed every 5 minutes. Is this due to the fact that the previous one got a timeout ?

Hello @Wolfgang_S, thank you for your reply.
I used the official docker build from openhab/openhab - Docker Image | Docker Hub
The docker run command you can find above. Do you mean there is a connection to the exec binding which is running?

It does because the container has a healthcheck so if it fails the container is restarted:

You could try to disable the healthcheck with by adding the --no-healthcheck when creating the container (see docs).

If that works better you can then run curl -f http://localhost:${OPENHAB_HTTP_PORT}/ in the container to investigate why that command fails.

thanks! I did check the OH source code but not the docker related, specific stuff.

Thanks for taking care here as well (not only on GitHub :slight_smile: ). Your help and engagement is really appreciated!

I turned off the HealthCheck within a new docker run. The 5 minute boarder is also crossed.
Result: NO message is logged in the Portainer Events.
To sum up: You seem to have found the issue :slight_smile:

When then entering the cmd within the docker:
root@raspberrypi4:/openhab# curl -f http://localhost:${OPENHAB_HTTP_PORT}/

I get the following message displayed:

<!doctype html><html><head><meta charset="utf-8"><meta http-equiv="Content-Security-Policy" content="default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap: content: blob:; style-src 'self' 'unsafe-inline';"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,minimal-ui,viewport-fit=cover"><meta name="theme-color" content="#e64a19"><meta name="format-detection" content="telephone=no"><meta name="msapplication-tap-highlight" content="no"><title>openHAB</title><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"><link rel="apple-touch-icon" href="/res/icons/apple-touch-icon.png" type="image/png" sizes="180x180" crossorigin="use-credentials"><link rel="icon" href="/res/icons/favicon.svg" type="image/svg+xml" sizes="any" crossorigin="use-credentials"><link rel="icon" href="/res/icons/128x128.png" type="image/png" sizes="128x128" crossorigin="use-credentials"><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"><link href="/css/app.css" rel="stylesheet"></head><body><div id="app"></div><script src="/js/app.js"></script></body></html>
1 Like

Maybe the issue is fixed in a more recent Docker version.

For instance in 20.10.18 there is a fix for healthchecks:

  • Fix an issue where exec processes and healthchecks were not terminated when they timed out moby/moby#44018.
1 Like

Thank you for the hint and your researches. I will give it a try :slight_smile: