Failure of update to latest docker image

Hello,

today i updated to the latest docker image and now openhab does not start anymore.
In console i got this error:

++ echo gosu openhab tini -s ./start.sh
+ '[' 'gosu openhab tini -s ./start.sh' == 'su-exec openhab tini -s ./start.sh' ']'
+ exec gosu openhab tini -s ./start.sh
/entrypoint: line 119: exec: gosu: not found

debian.sh --arch ‘amd64’ out/ ‘bookworm’ ‘@1751241600

ARG OPENHAB_VERSION=4.3.6
ARG BUILD_DATE=2025-07-17T18:07:24Z

This is my docker-compose.yml:

services:
  openhab:
    image: "openhab/openhab:latest"
    restart: always
    network_mode: host
    # ports:
    #   - "8081:8081" # HTTP port of the web interface
    #   - "8443:8443" # HTTPS port of the web interface
    #   - "5007:5007" # LSP port for validating rules 
    #   - "8101:8101" # SSH port of the Console
    #   - "9124:9124" # HomeKit Port
    cap_add:
      - NET_ADMIN
      - NET_RAW
    volumes:
      #- "/etc/localtime:/etc/localtime:ro"
      #- "/etc/timezone:/etc/timezone:ro"
      - install_script_cont_init.de:/etc/cont-init.d
      - addons:/openhab/addons
      - conf:/openhab/conf
      - userdata:/openhab/userdata
    environment:
      CRYPTO_POLICY: "unlimited"
      EXTRA_JAVA_OPTS: "-Duser.timezone=Europe/Berlin"
      OPENHAB_HTTP_PORT: "8081"
      OPENHAB_HTTPS_PORT: "8443"
      LC_ALL: "de_DE.UTF-8"
      LANG: "de_DE.UTF-8"
      LANGUAGE: "de_DE.UTF-8"
    
  mariadb:
    image: mariadb:latest
    env_file:
      - ./.env
    ports:
      - "3307:3306"
    volumes:
      - db:/var/lib/mysql
    restart: unless-stopped
volumes:
  install_script_cont_init.de:
  addons:
  conf:
  userdata:
  db:

Any ideas?

Something in your system insists on using gosu while it got replaced with su-exec.

Do you use Portainer or something like that? I know Portainer stores all the default ENV or CMD values even though you don’t override them. Then it keeps using outdated default values after the defaults changed.

I had to replace gosu with su-exec for advanced container setting in portainer

IMG_1348

1 Like

Thanks for your replies!

Yes, i am using portainer with stack deployment from my local gitea.
How do i change to su-exec in docker-compose.yml?

I have a test environment in docker with portainer, the only thing I had to do was a recreation of the container with repulling the image, after that the container used su-exec (it’s openHAB5.0 here, should be the same anyway…)

EDIT: Same for openHAB4, totally forgot that I had another test environment for openHAB4 as well…

I just updated the image for OpenHAB4 - same error.

Use

    image: openhab/openhab:latest
    command: ["su-exec", "openhab", "tini", "-s", "./start.sh"]

as a workaround if your are building with compose.

Using “Default” would be better for these options. Otherwise you probably always have to manually update each option whenever the default value changes for good reasons. :upside_down_face:

Thank you! Re-deploying the stack (not just recreating the container/image) resolved the problem for me.

1 Like

Do not fully understand, did you change anything in portainer or just re-deployed? My compose does not contain anything like gosu…
I can see in the portainer advanced container settings that gosu command but I am not that specialist and have no idea where this is coming from.
Should I change that or just re-deploy?

image

EDIT:
OK in the meanwhile I just stopped and re-created but doesn’t help, not reachable

Changed now in advanced settings to su-exec but also no success.
What I also can see in glances that openhab is still recreating and using gosu.
What can I do here (Just noticed cannot save the change to su-exec in advanced settings)
image

I only deleted and redeployed the container (without deleting the volumes).

1 Like

OK, also removed the container (selecting without deleting the non-persistent volumes) and deployed the custom template again and YESSS up and running!

1 Like

Whats up with docker images acutally?

Did the update to lastest right now and the container does not start again:

++ echo su-exec openhab tini -s ./start.sh
+ '[' 'su-exec openhab tini -s ./start.sh' == 'su-exec openhab tini -s ./start.sh' ']'
+ command=($@ server)
+ exec su-exec openhab tini -s ./start.sh server
Launching the openHAB runtime...
Cannot parse null string
Error occurred shutting down framework: java.lang.NumberFormatException: Cannot parse null string
java.lang.NumberFormatException: Cannot parse null string
	at java.base/java.lang.Integer.parseInt(Unknown Source)
	at java.base/java.lang.Integer.parseInt(Unknown Source)
	at org.apache.karaf.main.ConfigProperties.<init>(ConfigProperties.java:251)
	at org.apache.karaf.main.Main.updateInstancePidAfterShutdown(Main.java:232)
	at org.apache.karaf.main.Main.main(Main.java:197)

The forum search found this similar experience:

Try to create a new empty container with the same OpenHAB image. If it starts you might have the same issue I had.
Curiously starting the original image worked fine so that allowed me to take action.

1 Like

Thanks for your reply.

I could solve it right now - was a case of limited space on hard disk and so the userdb migration failed.

2 Likes

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