Unraid Docker Compose issue

I’m sure I am way off from having this correct. I have an Unraid server and run docker from it and would like to have the BrewBlox controller on it. I have pieced together what I think should work and the logs look like it’s working properly but when I go to he web address I get a 404 error.

Any help is greatly appreciated!

Here is my docker compose file and then the 404 error.

version: '3.7'

services:
  eventbus:
    image: brewblox/mosquitto:develop
    labels:
      - traefik.http.services.eventbus.loadbalancer.server.port=15675
      
#   ui:
#     image: brewblox/brewblox-ui:develop
#     volumes:
#       #- /usr/share/nginx/html/ui
#       - /mnt/user/appdata/brewblox
#     labels:
#     #   - traefik.http.routers.ui.rule=PathPrefix(`/ui`) || Path(`/`)      
#       - traefik.http.routers.ui.rule=Host(`brewblox.local`) && (PathPrefix(`/ui`) || Path(`/`))
#     restart: unless-stopped
#     privileged: true
#     # command: '--name=spark-one'
    
  spark-one:
    image: brewblox/brewblox-devcon-spark:develop
    volumes:
      - /mnt/user/appdata/brewblox
    privileged: true
    restart: unless-stopped
    command: >-
      --name=spark-one
      --device-id=300045000851353532343835
      --device-host=192.168.1.80
#   webby:
#     image: nginx
#     labels:
#       - traefik.http.routers.webby.rule=Host(`webby.local`)
#       - traefik.http.routers.webby.priority=9004    
    

  victoria:
    image: victoriametrics/victoria-metrics
    labels:
      - traefik.http.services.victoria.loadbalancer.server.port=8428
    volumes:
      - /mnt/user/appdata/brewblox
    command: >-
      --retentionPeriod=100y
      --influxMeasurementFieldSeparator=/
      --http.pathPrefix=/victoria
      --search.latencyOffset=10s

  redis:
    image: redis:6.0
    labels:
      - traefik.enable=false
    volumes:
      - /mnt/user/appdata/brewblox
    command: --appendonly yes

  history:
    image: brewblox/brewblox-history:develop

  node-red:
    image: brewblox/node-red:develop
    volumes:
      - /mnt/user/appdata/brewblox

#   sparkey:
#     image: brewblox/brewblox-devcon-spark:develop
#     restart: unless-stopped
#     privileged: true
#     volumes:
#       - /mnt/user/appdata/brewblox
#     command: --name=sparkey --simulation --device-id=1C0029001247343339383037

# #   spock:
# #     image: brewblox/brewblox-devcon-spark:develop
# #     restart: unless-stopped
# #     privileged: true
# #     volumes:
# #       - /mnt/user/appdata/brewblox
# #     command: --name=spock --simulation --device-id=1C0029001247343339383037
    


#   tilt:
#     image: brewblox/brewblox-tilt:develop
#     labels:
#       - traefik.enable=false
#     volumes:
#       - /mnt/user/appdata/brewblox
#     restart: unless-stopped
#     network_mode: host
#     privileged: true
#     command: --mqtt-port=9001 --simulate=Pink

  traefik:
    image: traefik:2.2
    ports:
      - '9002:9002'
      - '9003:9003'
    labels:
      - traefik.http.routers.api.rule=PathPrefix(`/api`) || PathPrefix(`/dashboard`)
      - traefik.http.routers.api.service=api@internal
      - traefik.http.middlewares.prefix-strip.stripprefixregex.regex=/[^/]+      
    volumes:
      - /mnt/user/appdata/brewblox
      - /var/run/docker.sock:/var/run/docker.sock
    command: >-
      --api.dashboard=true
      --providers.docker=true
      --providers.docker.constraints="Label(`com.docker.compose.project`, `brewblox-ui`)"
      --providers.docker.defaultrule="PathPrefix(`/{{ index .Labels \"com.docker.compose.service\" }}`)"
      --providers.file.directory=/config
      --entrypoints.web.address=:9002
      --entrypoints.websecure.address=:9003  
      --entrypoints.web.http.redirections.entrypoint.to=websecure
      # <= Other services in your config go here
#   hass:
#     image: brewblox/brewblox-hass:develop
#     restart: unless-stopped
#     command: >-
#         --hass-mqtt-host=192.168.1.229:1883

image

You have the traefik service that listens at 9002, but that’s a proxy to redirect requests to other services. The UI service that serves the actual page is commented out.

The traefik service now only considers docker containers from compose projects in a directory called “brewblox-ui”.

The compose file in the UI repo may not be the best starting point. brewblox-ctl/docker-compose.shared.yml at develop · BrewBlox/brewblox-ctl · GitHub is the base compose file we deploy during installation.

I’m not familiar with unraid servers. Is there a specific reason brewblox-ctl won’t work, or is this more of a hobby to do it manually? Happy to help either way.

Thanks for the info. No reason that I can see that the brewblox-ctl wouldn’t work other than I didn’t see it when looking at getting it converted. There are a few changes that I’ll need to make in order for it to run in Unraid. I’ll post the results as soon as I get it working or if I run into any other snags.

Thanks!

Working on it this morning and I was able to get the UI up and running and the Spark-One Service can see the controller. I’m now getting an error message from the controller tht says incompatible firmware and when I try to Flash and update I get a request failed status code of 404.

The firmware on the controller is old enough to be incompatible with the current OTA protocol. To update the firmware, connect it over USB, stop the spark service, and run:

docker run --pull always -it --rm --privileged -v /dev:/dev brewblox/firmware-flasher:edge flash

I stopped the Spark Service and ran the logic. It updated the firmware and now Controller Firmware shows 02/22/2023 but I’m still unable to connect to it and I’m still getting the 404 error message. Do I need to reset it and update the firmware again?

image

Going by the service date, you may be using develop tags for services? I suggest you use edge instead, as develop may break randomly while we work on new features.

That seemed to work. I have a green wifi signal and I can see the temps of the probes. Thank you for your help. I’ll post my docker-compose on this thread so if anyone is looking for an Unraid solution they can use mine as a starting point.

One thing I did notice is when I try to rename the probe names they don’t change and I get a message stating 404 page not found message.

image

Could you please post your compose again? This looks like the service is pushing updates to the eventbus, but not receiving http calls.

# DO NOT EDIT: THIS FILE WILL BE RESET DURING UPDATES
#
# This file contains configuration for the shared Brewblox services
#
# If you need to make change to any of the shared services,
# you can do so in docker-compose.yml.
#
# For more information, see https://docs.docker.com/compose/extends/
version: "3.7"

services:
  eventbus:
    image: brewblox/mosquitto:edge
    restart: unless-stopped
    labels:
      - traefik.http.services.eventbus.loadbalancer.server.port=15675
    volumes:
      - /mosquitto:/mosquitto/include
    #   - type: bind
    #     source: ./mosquitto
    #     target: /mosquitto/include
    #     read_only: true
    ports:
      - "${BREWBLOX_PORT_MQTT:-1884}:1883"
  victoria:
    image: victoriametrics/victoria-metrics:v1.88.0
    restart: unless-stopped
    labels:
      - traefik.http.services.victoria.loadbalancer.server.port=8428
    volumes:
      - /victoria:/victoria-metrics-data
    #   - type: bind
    #     source: ./victoria
    #     target: /victoria-metrics-data
    command: >-
      --retentionPeriod=100y
      --influxMeasurementFieldSeparator=/
      --http.pathPrefix=/victoria
      --search.latencyOffset=10s
  redis:
    image: redis:6.0
    restart: unless-stopped
    labels:
      - traefik.enable=false
    volumes:
      - /redis:/data
    #   - type: bind
    #     source: ./redis
    #     target: /data
    command: --appendonly yes
  history:
    image: brewblox/brewblox-history:edge
    restart: unless-stopped
    volumes:
      - /etc/localtime:/etc/localtime
    #   - type: bind
    #     source: /etc/localtime
    #     target: /etc/localtime
    #     read_only: true
    # Privileged to avoid a bug in libseccomp for Debian Buster hosts
    # This flag should be removed when Debian Buster is no longer supported
    # For an explanation: https://github.com/sdr-enthusiasts/Buster-Docker-Fixes
    privileged: true
  traefik:
    image: traefik:2.8
    restart: unless-stopped
    labels:
      - traefik.http.routers.api.rule=PathPrefix(`/api`) || PathPrefix(`/dashboard`)
      - traefik.http.routers.api.service=api@internal
      - traefik.http.middlewares.prefix-strip.stripprefixregex.regex=/[^/]+
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /traefik:/config
      - /etc/localtime:/etc/localtime
      
    #   - type: bind
    #     source: ./traefik
    #     target: /config
    #     read_only: true
    #   - type: bind
    #     source: /var/run/docker.sock
    #     target: /var/run/docker.sock
    #   - type: bind
    #     source: /etc/localtime
    #     target: /etc/localtime
    #     read_only: true
    ports:
      - "${BREWBLOX_PORT_HTTP:-80}:${BREWBLOX_PORT_HTTP:-80}"
      - "${BREWBLOX_PORT_HTTPS:-443}:${BREWBLOX_PORT_HTTPS:-443}"
    command: >-
      --api.dashboard=true
      --providers.docker=true
      --providers.docker.constraints="LabelRegex(`com.docker.compose.project`, `${COMPOSE_PROJECT_NAME}`)"
      --providers.docker.defaultrule="PathPrefix(`/{{ index .Labels \"com.docker.compose.service\" }}`)"
      --providers.file.directory=/config
      --entrypoints.web.address=:${BREWBLOX_PORT_HTTP}
      --entrypoints.websecure.address=:${BREWBLOX_PORT_HTTPS}
      --entrypoints.websecure.http.tls=true
      
  sparkone:
    image: brewblox/brewblox-devcon-spark:edge
    volumes:
      - /mnt/user/appdata/brewblox
    privileged: true
    restart: unless-stopped
    command: >-
      --name=spark-one
      --device-id=1C0029001247343339383037
      --device-host=192.168.1.80      
      
  ui:
    image: brewblox/brewblox-ui:edge
    restart: unless-stopped
    labels:
      - traefik.http.routers.ui.rule=PathPrefix(`/ui`) || Path(`/`)
    volumes:
      - /etc/localtime:/etc/localtime
    #   - type: bind
    #     source: /etc/localtime
    #     target: /etc/localtime
    #     read_only: true

Service name must match --name arg. You have service sparkone with name spark-one. This is relevant for routing, as traefik uses service name as prefix, and the service registers endpoints with --name prefix.

Is it intentional that you’re using absolute /redis and /victoria paths, instead of relative ./?

You may also want to update the volumes for the spark service. The defaults are:

    volumes:
    - type: bind
      source: /etc/localtime
      target: /etc/localtime
      read_only: true
    - type: bind
      source: ./spark/backup
      target: /app/backup

Ok, the naming arg was the issue. I was able to do some renaming and setup the graph.

I’ll play around with the absolute vs relative, but I was getting errors when I added the ./.

Thank you for your help.

For the relative dirs, you need to create the directory before starting the compose services. They used to be auto-created, but this behavior was changed in a recent update.