ElectricBrainUK / UnraidAPI

A WIP open source Node JS API for controlling UNraid
GNU General Public License v3.0
125 stars 13 forks source link

Unraid crashes when unraid API is booted up #62

Open DerUntote opened 1 year ago

DerUntote commented 1 year ago

Describe the bug When i am starting the following stack, over the unraid compose addon, I am getting my Unraid Array stopped and unraid is no more reachable after another minute / array is finally stopped.

To Reproduce Steps to reproduce the behavior:

  1. add my docker compose
  2. add .ENV File
  3. start it over docker compose addon of unraid
  4. after unraid connects to my MQTT Server which is hosted on IOBroker, another service which is not included here.
  5. I see in Unraid WebUI that my Array getting stopped
  6. After 1-2 Minutes my Unraid Webui is no more reachable
  7. System needs to reboot to get available again.

Expected behavior My Unraid System is not touched

Screenshots If applicable, add screenshots to help explain your problem.

Unraid server (please complete the following information): 8.11.5

Unraidapi docker container (please complete the following information): latest

Additional context

Diagnostic files from unRAID Its not including the error, because its not saved due to reboot tower-diagnostics-20230107-0816.zip

i used the Ulimate Unraid Dashboard Guide to setup a Dashboard for Unraid. Part of it is Unraid API. When i boot this one up, my Unraid Array gets offline, Unraid crashes/gets unavailable over network after a Minute or so. https://github.com/HStep20/Ultimate-Unraid-Dashboard-Guide

I have a NGinx network, most of the rest docker-compose is untouched.

https://github.com/HStep20/Ultimate-Unraid-Dashboard-Guide/blob/master/Ultimate_Unraid_Dashboard.yml

and here is my edited compose

version: "3"
services:
  influxdb:
    container_name: GUS-influx
    image: influxdb:1.8.4
    networks: 
      - nginx
    hostname: ${HOSTNAME}
    ports:
      - 8086:8086
    volumes:
      - ${APPDATA_PATH}/GUS-influxdb:/var/lib/influxdb
    restart: unless-stopped
    environment:
      TZ: ${TIMEZONE}
    labels:
      - "net.unraid.docker.icon=https://raw.githubusercontent.com/pootzko/InfluxData.Net/master/nuget-icon.png"

  chronograf:
    image: chronograf:alpine
    container_name: GUS-chronograf
    networks: 
      - nginx
    hostname: ${HOSTNAME}
    volumes:
      - ${APPDATA_PATH}/GUS-chronograf:/var/lib/chronograf
    ports:
      - ${CHRONOGRAF_UI_PORT}:8888
    depends_on:
      - influxdb
    labels:
      - "net.unraid.docker.icon=https://external-content.duckduckgo.com/ip3/docs.influxdata.com.ico"
      - "net.unraid.docker.webui=http://[IP]:[PORT:7889]/"

  telegraf:
    container_name: GUS-telegraf
    image: telegraf:1.20.2-alpine
    privileged: true
    network_mode: host
    hostname: ${HOSTNAME}
    expose:
      - 6379
    volumes:
      - /var/run/utmp:/var/run/utmp:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /:/rootfs:ro
      - /sys:/rootfs/sys:ro
      - /etc:/rootfs/etc:ro
      - /proc:/rootfs/proc:ro
      - ${APPDATA_PATH}/GUS-telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
      - /run/udev:/run/udev:ro
    environment:
      HOST_PROC: /rootfs/proc
      HOST_SYS: /rootfs/sys
      HOST_ETC: /rootfs/etc
      HOST_MOUNT_PREFIX: /rootfs
      TZ: ${TIMEZONE}
    restart: unless-stopped
    command: /bin/sh -c 'apk update && apk upgrade && apk add ipmitool && apk add smartmontools && apk add lm_sensors && telegraf'
    depends_on:
      - influxdb
    labels:
      - "net.unraid.docker.icon=https://github.com/atribe/unRAID-docker/raw/master/icons/telegraf.png"  

  varken:
    container_name: GUS-varken
    image: boerderij/varken
    networks: 
      - nginx
    hostname: ${HOSTNAME}
    volumes:
      - ${APPDATA_PATH}/GUS-varken:/config
    environment:
      TZ: ${TIMEZONE}
    restart: unless-stopped
    depends_on:
      - influxdb
    labels:
      - "net.unraid.docker.icon=https://raw.githubusercontent.com/benderstwin/docker-templates/master/images/varken.png"

  grafana:
    container_name: GUS-grafana
    image: grafana/grafana
    networks: 
      - nginx
    hostname: ${HOSTNAME}
    ports:
      - ${GRAFANA_UI_PORT}:3000
    volumes:
      - ${APPDATA_PATH}/GUS-grafana:/var/lib/grafana
    environment:
      GF_SERVER_ROOT_URL: ${GF_SERVER_ROOT_URL}
      GF_SECURITY_ADMIN_PASSWORD: ${GF_SECURITY_ADMIN_PASSWORD}
      TZ: ${TIMEZONE}
    depends_on:
      - influxdb
      - telegraf
    #  - unraidapi
      - varken
    restart: unless-stopped
    command: grafana-cli plugins install grafana-piechart-panel && grafana-cli plugins install grafana-worldmap-panel && grafana-cli plugins install marcusolsson-json-datasource && grafana-cli plugins install dalvany-image-panel
    labels:
      - "net.unraid.docker.icon=https://github.com/atribe/unRAID-docker/raw/master/icons/grafana.png"
      - "net.unraid.docker.webui=http://[IP]:[PORT:3000]/"

  unraidapi:
    container_name: GUS-unraidapi
    image: electricbrainuk/unraidapi
    network_mode: bridge
    networks: 
      - nginx
    hostname: ${HOSTNAME}
    ports:
      - ${UNRAID_API_UI_PORT}:80
    volumes:
      - ${APPDATA_PATH}/GUS-UnraidAPI:/app/config
    environment:
      MQTTBroker: 192.168.3.2
      MQTTPort: 1883
      MQTTPass: supersecure
      MQTTUser: username
      MQTTBaseTopic: unraidapi
      KeyStorage: config
      TZ: ${TIMEZONE}
    restart: unless-stopped
    depends_on:
      - influxdb
    labels:
      - "net.unraid.docker.icon=https://raw.githubusercontent.com/ElectricBrainUK/UnraidAPI/master/static/iconx64.png"
      - "net.unraid.docker.webui=http://[IP]:[PORT:13305]/"

networks:
  nginx:
    external: true

here my ENV File

HOSTNAME="192.168.3.2"
TIMEZONE="Europe/Berlin"
APPDATA_PATH="/mnt/user/appdata"
CHRONOGRAF_UI_PORT=7889
UNRAID_API_UI_PORT=13305
GRAFANA_UI_PORT=3000
GF_SERVER_ROOT_URL="https://grafana.domain.com"
GF_SECURITY_ADMIN_PASSWORD="SUPERSECUREPASSWORD"

The last 2 entries are anonymized.


In my AppData folder of unraidAPI these files where created:

The server.json includes a lot of personal information I don't want to share but:

mqttKeys includes a valid key

{"192.168.3.2":"ABCIAMAKEY=="}

[1] "192.168.3.2":{"serverDetails":{"arrayStatus":"Started","moverRunning":false,"parityCheckRunning":false,"title":"Tower","cpu":"11th Gen Intel® Core™ i7-11700K @ 3.60GHz","memory":"64 GiB DDR4 ","motherboard":"Micro-Star International Co., Ltd. MAG B560 TORPEDO (MS-7D15) , Version 2.0","version":"6.11.5","on":true}

DerUntote commented 1 year ago

Hi,

iam now testing to remove MQTT out of unraid API setup, maybe this will help


 WARN  mode option is deprecated. You can safely remove it from nuxt.config

(node:26) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /app/node_modules/@nuxt/components/package.json.
Update this package.json to use a subpath pattern like "./*".
(Use `node --trace-deprecation ...` to show where the warning was created)

> unraidapi@0.5.0 start
> cross-env NUXT_HOST=0.0.0.0 NODE_ENV=production node server/index.js

mqtt disabled

 READY  Server listening on http://0.0.0.0:80
DerUntote commented 1 year ago

deactivation of MQTT fixed it for now. I will investigate it further, if I ever need MQTT.

KrX3D commented 1 year ago

Hi, maybe this is also related.

https://github.com/ElectricBrainUK/UnraidAPI/issues/40