openhab / openhab-docker

Repository for building Docker containers for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
209 stars 128 forks source link

error: exec: "tini": executable file not found in $PATH #409

Closed axi92 closed 1 year ago

axi92 commented 1 year ago

Summary

I tried to start it and it says it cant find tini. All other containers are running smooth. Zigbee2MQTT, my mqtt server, unify controller, ...

Expected Behavior

Start openhab

Current Behavior

I start it on my linux/arm/v7 nas with this: docker run --name openhab1 -ti --rm -v /etc/localtime:/etc/localtime:ro -v /etc/timezone:/etc/timezone:ro -e CRYPTO_POLICY=unlimited --entrypoint=/bin/bash openhab/openhab:3.3.0-debian the output that I get is:

+ IFS='
        '
++ ls -d /usr/lib/jvm/temurin-11-jdk-armhf
+ export JAVA_HOME=/usr/lib/jvm/temurin-11-jdk-armhf
+ JAVA_HOME=/usr/lib/jvm/temurin-11-jdk-armhf
+ '[' limited = unlimited ']'
+ /etc/ca-certificates/update.d/adoptium-cacerts
/etc/ssl/certs/adoptium/cacerts successfully populated.
+ capsh --print
+ grep -E Current:.+,cap_net_admin,cap_net_raw,.+
+ rm -f /openhab/runtime/instances/instance.properties
+ rm -f /openhab/userdata/tmp/instances/instance.properties
+ NEW_USER_ID=9001
+ NEW_GROUP_ID=9001
+ echo 'Starting with openhab user id: 9001 and group id: 9001'
Starting with openhab user id: 9001 and group id: 9001
+ id -u openhab
+ initialize_volume /openhab/conf /openhab/dist/conf
+ volume=/openhab/conf
+ source=/openhab/dist/conf
++ ls -A /openhab/conf
+ '[' -z 'automation
html
icons
items
persistence
rules
scripts
services
sitemaps
sounds
things
transform' ']'
+ initialize_volume /openhab/userdata /openhab/dist/userdata
+ volume=/openhab/userdata
+ source=/openhab/dist/userdata
++ ls -A /openhab/userdata
+ '[' -z 'backup
cache
config
etc
jsondb
kar
logs
marketplace
persistence
secrets
tmp' ']'
++ cmp /openhab/userdata/etc/version.properties /openhab/dist/userdata/etc/version.properties
+ '[' '!' -z ']'
+ chown -R openhab:openhab /openhab
+ sync
+ '[' -d /etc/cont-init.d ']'
+ sync
+ '[' true == false ']'
+ exec gosu openhab tini -s ./start.sh
error: exec: "tini": executable file not found in $PATH
+ IFS='
        '
++ ls -d /usr/lib/jvm/temurin-11-jdk-armhf
+ export JAVA_HOME=/usr/lib/jvm/temurin-11-jdk-armhf
+ JAVA_HOME=/usr/lib/jvm/temurin-11-jdk-armhf
+ '[' limited = unlimited ']'
+ /etc/ca-certificates/update.d/adoptium-cacerts
/etc/ssl/certs/adoptium/cacerts successfully populated.
+ grep -E Current:.+,cap_net_admin,cap_net_raw,.+
+ capsh --print
+ rm -f /openhab/runtime/instances/instance.properties
+ rm -f /openhab/userdata/tmp/instances/instance.properties
+ NEW_USER_ID=9001
+ NEW_GROUP_ID=9001
+ echo 'Starting with openhab user id: 9001 and group id: 9001'
Starting with openhab user id: 9001 and group id: 9001
+ id -u openhab
+ initialize_volume /openhab/conf /openhab/dist/conf
+ volume=/openhab/conf
+ source=/openhab/dist/conf
++ ls -A /openhab/conf
+ '[' -z 'automation
html
icons
items
persistence
rules
scripts
services
sitemaps
sounds
things
transform' ']'
+ initialize_volume /openhab/userdata /openhab/dist/userdata
+ volume=/openhab/userdata
+ source=/openhab/dist/userdata
++ ls -A /openhab/userdata
+ '[' -z 'backup
cache
config
etc
jsondb
kar
logs
marketplace
persistence
secrets
tmp' ']'
++ cmp /openhab/userdata/etc/version.properties /openhab/dist/userdata/etc/version.properties
+ '[' '!' -z ']'
+ chown -R openhab:openhab /openhab
+ sync
+ '[' -d /etc/cont-init.d ']'
+ sync
+ '[' true == false ']'
+ exec gosu openhab tini -s ./start.sh
error: exec: "tini": executable file not found in $PATH

Possible Solution

I tried to override the entrypoint with a bash and then "/entrypoint" manualy with the following "gosu openhab tini -s ./start.sh" but it still fails with an error:

root@83828ac7acf5:/openhab#  gosu openhab /usr/bin/tini -s ./start.sh
error: exec: "/usr/bin/tini": stat /usr/bin/tini: permission denied

Then I tried to start it with root with just ./start.sh and it works... So the only workaround for this is to override the cmd with ./start.sh that makes the sad part that it runs with root.

Steps to Reproduce

  1. Start it with the command above

Context

This image was running for weeks, last night it went down and since then I was not able to start it again

Your Environment

Qnap NAS

Image

Docker Host

Configuration

Client:
 Context:    default
 Debug Mode: false

Server:
 Containers: 5
  Running: 4
  Paused: 0
  Stopped: 1
 Images: 11
 Server Version: 20.10.17-qnap5
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay qnet
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux kata-runtime runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1
 runc version: v1.1.2-0-ga916309f
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 4.2.8
 Operating System: QTS 5.0.1 (20221022)
 OSType: linux
 Architecture: armv7l
 CPUs: 2
 Total Memory: 7.976GiB
 Name: NAS19149D
 ID: QC5Y:KMEK:3U2J:AXYG:CQJD:QS32:WTHA:52QG:EXZS:56BQ:KBJJ:MANX
 Docker Root Dir: /share/CACHEDEV1_DATA/Container/container-station-data/lib/docker
 Debug Mode: true
  File Descriptors: 224
  Goroutines: 123
  System Time: 2022-11-19T22:47:39.46303074+01:00
  EventsListeners: 1
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
 Product License: Community Engine
 Default Address Pools:
   Base: 172.29.0.0/16, Size: 22
wborn commented 1 year ago

If it works like described in the docs using the default entrypoint... and all you want it is running everything as non-root, this issue duplicates https://github.com/openhab/openhab-docker/issues/353.

axi92 commented 1 year ago

I did not change anything I just want to run the openhab docker file as it is without changing its entry point or cmd. But that gives me the error above. As you see in the logs I run it as designed with exec gosu openhab tini -s ./start.sh what the default cmd is.

I read the #353 and I dont think it duplicates my ticket. I have the problem that it ran a long time with no issues. And suddenly it stops working and I have no clue why.

The only workaround for me was to run it as root, that way it still works.

wborn commented 1 year ago

If it worked before then maybe the cached Docker image got corrupt somehow? I'd try to delete the cached image and make it redownload a fresh copy.

axi92 commented 1 year ago

I already tried pulling the image new and also with the M4 image. Same output. I could imagine that it is a docker issue? But I never had this. But why would a container stop working just out of nowhere? I work a lot with docker but never had such an issue.

wborn commented 1 year ago

I could imagine that it is a docker issue? But I never had this. But why would a container stop working just out of nowhere?

If you update the Docker engine on your host OS a perfectly working container can stop working from one day to another. Does the container work on other Docker hosts?

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

axi92 commented 1 year ago

I moved my openhab container to a zimaboard. So I dont have to deal with the qnap arm weird docker anymore =)

wborn commented 1 year ago

That board looks nice, at a good price and very compatible due to x86. :+1: To get it working on the QNAP, their community might have more answers on how to handle any QNAP Docker weirdness. :slightly_smiling_face: