Zwave-js-ui container stopped working, now container won't start

I am running the following containers:

  • homeassistant
  • mosquitto
  • portainer
  • frigate
  • zwave-js-ui

Everything was hunky dory. I was going to add zigbee and rebooted box after attaching the adapter. Then my zwave-js-ui stopped working. I get the message when I try to start the container:

driver failed programming external connectivity on endpoint zwave-js-ui (6242415d27ff4a6bc545c880a1e699b38cbf04533268848efacc6ed865398129): Error starting userland proxy: listen tcp4 bind: address already in use

I’ve checked and nothing else is using port 8091.

I’ve tried many things including stopping all of the other containers and trying to start just that one. I’ve checked my config file and I think stuff looks good there. Thoughts on next steps?

Here is my docker-compose with passwords replaced by asterisk. The frigate is very basic as I did one camera for a quick test and will be building it out further.

    container_name: portainer
    image: portainer/portainer-ce:latest
    restart: unless-stopped
      - "9000:9000/tcp"
      - "9443:9443/tcp"
      - TZ=America/New_York
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/var/run/docker.sock
      - /opt/portainer/data:/data
    container_name: mosquitto
    image: eclipse-mosquitto
    restart: unless-stopped
      - "1883:1883/tcp"
      - TZ=America/New_York
      - /opt/mosquitto/config:/mosquitto/config
      - /opt/mosquitto/data:/mosquitto/data
      - /opt/mosquitto/log:/mosquitto/log
    stdin_open: true
    tty: true

    container_name: zwave-js-ui
    image: zwavejs/zwave-js-ui:latest
    restart: always
    tty: true
    stop_signal: SIGINT
      - SESSION_SECRET=*******************
      - ZWAVEJS_EXTERNAL_CONFIG=/usr/src/app/store/.config-db
      # Uncomment if you want log times and dates to match your timezone instead of UTC
      # Available at
      #- TZ=America/New_York
      - zwave
      # Do not use /dev/ttyUSBX serial devices, as those mappings can change over time.
      # Instead, use the /dev/serial/by-id/X serial device for your Z-Wave stick.
      - '/dev/serial/by-id/usb-Silicon_Labs_Zooz_ZST10_700_Z-Wave_Stick_ce6f950cbb21ec118280b9942c86906c-if00-port0:/dev/zwave'
      - zwave-config:/opt/z-wave-js:/usr/src/app/store
   # Or by using local folder
   # - ./store:/usr/src/app/store
      - "8091:8091" # port for web interface
      - "3000:3000" # port for Z-Wave JS websocket server
    container_name: frigate
    #privileged: true # this may not be necessary for all setups
    restart: always
    image: blakeblackshear/frigate:stable-amd64
    #shm_size: "64mb" # update for your cameras based on calculation above
    #  - /dev/bus/usb:/dev/bus/usb # passes the USB Coral, needs to be modified for other versions
    #  - /dev/apex_0:/dev/apex_0 # passes a PCIe Coral, follow driver instructions here
    #  - /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
      - /etc/localtime:/etc/localtime:ro
      - /Home/ha/frigate/config.yml:/config/config.yml:ro
      - /Home/ha/frigate/media:/media/frigate
    #  - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
    #    target: /tmp/cache
    #    tmpfs:
    #      size: 1000000000
      - "5000:5000"
      - "1935:1935"
      FRIGATE_RTSP_PASSWORD: "***********"

    name: zwave

    name: zwave-config

Reboot host and try again

Also “docker ps” at command line and verify the container is not running

Ive had a docker container fail to start like this where a stopped or deleted container is somehow still bound to port and prevent container start. Maybe it took 1 or 2 reboots of host, i forget, but ultimately docker will show bound container as running or correctly shows it as stopped and allows container start.

Or your missing something :wink:

Your log says port 8091 is already in use. Do you have multiple instances of zwavejsui running? I would go into portainer and see if it is running twice. You would need to remove any old container or duplicate instances, and then run your compose to add it again. Since the config settings are stored in the persistent volume you have, removing the containers and then reinstalling won’t lose any data - it would be the same process you use when you update a container - pull new image, stop old container, remove old container, run compose to install new container with new image.

You can also try running
sudo lsof -i:8091
to see what is using the port

1 Like

I have to be missing something. I had tried this before seeking further wisdom. Doesn’t show anything running.

CONTAINER ID   IMAGE                                          COMMAND                  CREATED       STATUS       PORTS                                                                                            NAMES
2212eb9bffa5   blakeblackshear/frigate:stable-amd64           "/init python3 -u -m…"   4 hours ago   Up 3 hours>1935/tcp, :::1935->1935/tcp,>5000/tcp, :::5000->5000/tcp             frigate
c6d459cdd98e   portainer/portainer-ce:latest                  "/portainer"             4 hours ago   Up 3 hours>9000/tcp, :::9000->9000/tcp, 8000/tcp,>9443/tcp, :::9443->9443/tcp   portainer
efe569d1fc03   eclipse-mosquitto                              "/docker-entrypoint.…"   4 hours ago   Up 3 hours>1883/tcp, :::1883->1883/tcp                                                        mosquitto
b47a94c9f1fa   "/init"                  8 weeks ago   Up 3 hours                                                                                                    homeassistant

I’ve rebooted several times in the past few hours. Maybe I’m not rebooting right?

Could be a problem with the way docker itself is installed. Are you able to run docker commands as a non root user?

What is the host os you are running it on?

Yes, tried this earlier, too. Forgot that I got this:

node    1286 root   19u  IPv4  18186      0t0  TCP localhost:8091 (LISTEN)

I couldn’t figure out what that went to, got distracted, and forgot about it…
So this is interesting:

UID          PID    PPID  C STIME TTY          TIME CMD
root        1286     650  0 11:44 ?        00:00:02 /snap/zwave-js-ui/136/bin/no

Yet my portainer shows it’s not running and no IP – EDIT: it’s showing an IP. It wasn’t earlier. I’m not able to access the web interface from the FTP.

I am running on Debian 11. I can “docker compose up -d” without sudo and it works.

I also killed the running PID, confirmed it was dead, and get same error trying to start the zwave-js container.

Then I check for that port again and got:

UID          PID    PPID  C STIME TTY          TIME CMD
root       72647   72544  0 15:42 ?        00:00:01 /snap/zwave-js-ui/136/bin/node --preserve-symlinks server/bin/www.js

So it’s like it’s failing but still tying up the port.

Okay gents, this is weird…I can access it from http://localhost:8091. So what the heck is going on? Nothing is configured in this and it looks different than I remember. What in sam hill??

I unplugged the z-wave adapter and restarted…no change.

I commented out the whole z-wave section of my docker compose and ran docker compose -d --remove-orphans and it showed it was removed…and I can still access via localhost:8091. So…where the heck is this thing launching from???

Have you maybe installed the Snap package for it on your host? So it’s not coming from Docker at all?


Yes, interesting. I was able to stop the snap service and then spin up my container and now container isn’t erroring out.

However, how the heck did the snap get installed and how do I get rid of it. I tried to disable it and it says it’s not installed.

snap services
Service                    Startup   Current   Notes
zwave-js-ui.zwave-js-ui    enabled   active    -
zwavejs2mqtt.zwavejs2mqtt  disabled  inactive  -
sudo snap disable zwave-js-ui.zwave-js-ui
error: snap "zwave-js-ui.zwave-js-ui" is not installed

Not sure what to do next. Also, the container was given a new network and so HA zwave-js-ui integration cannot connect to my container. Do you know if there is a way to change the IP it’s pointing to?

Give the container a hostname and use that. Dont use IP because they randomly change

Honestly you dont need to even bind port if HA is in container since it will connect over docker network. UI not accessible this way however

If you install Home assistant container in host networking mode (which is what the documentation says and necessary for many integrations to work) then it wont be in the same docker network as zwavejsui and wont be accessible by container name.

If homeassistant is in host networking mode, zwavejsui is configured to map port 3000 to the host, and they are on the same machine, you should be able to just readd the zwavejs integration and specify
ws://localhost:3000 as the url.

Using localhost will make any changes to the docker ip for the zwavejs container not impact the connection , since port 3000 will always be bound to the host machine.

So, this was not working. I finally figured out that I had to tick on the WS server in the z-wave-js gui. I also lost my security keys in the process, and generating new ones means excluding and including all of my devices again. THANKFULLY most of my devices haven’t been added yet because they are in-wall switches that I haven’t yet installed after uninstalling them from my old house.

Still zero clue how the snap version got installed (I took no steps to do this). Anyone have any thoughts on that? This has been working great for 6 weeks until a couple of days ago and they only new thing added was that zigbee radio. Could Debian have installed the snap version just based on me plugging it in and rebooting (akin to Windows finding a driver)?