tsightler / ring-mqtt

Ring devices to MQTT Bridge
MIT License
569 stars 103 forks source link

init-ring-mqtt.js seems to blow up instantly when run from docker #676

Closed zzxyz closed 1 year ago

zzxyz commented 1 year ago

Describe the Bug

fatal error when running 2nd step of docker install instructions

Steps to Reproduce

pull docker image, run init-ring-mqtt.js

Expected Behavior

expect to be prompted for ring credentials

Log Output

pi@pirate:~/src/ring-mqtt $ docker run -it --rm --mount type=bind,source=/home/pi/src/ring-mqtt,target=/data --entrypoint /app/ring-mqtt/init-ring-mqtt.js tsightler/ring-mqtt

#
# Fatal error in , line 0
# unreachable code
#
#
#
#FailureMessage Object: 0xbee7d40c
pi@pirate:~/src/ring-mqtt $

Screenshots

No response

Config File

no config. version stuff:

pi@pirate:~/src/ring-mqtt $ screenfetch
    .',;:cc;,'.    .,;::c:,,.    pi@pirate
   ,ooolcloooo:  'oooooccloo:    OS: Raspbian 10 buster
   .looooc;;:ol  :oc;;:ooooo'    Kernel: armv7l Linux 5.10.103-v7l+
     ;oooooo:      ,ooooooc.     Uptime: 22h 43m
       .,:;'.       .;:;'.       Packages: 2051
       .... ..'''''. ....        Shell: 4064
     .''.   ..'''''.  ..''.      CPU: ARMv7 rev 3 (v7l) @ 4x 1.5GHz [52.0°C]
     ..  .....    .....  ..      GPU:
    .  .'''''''  .''''''.  .     RAM: 270MiB / 3838MiB
  .'' .''''''''  .'''''''. ''.
  '''  '''''''    .''''''  '''
  .'    ........... ...    .'.
    ....    ''''''''.   .''.
    '''''.  ''''''''. .'''''
     '''''.  .'''''. .'''''.
      ..''.     .    .''..
            .'''''''
             ......
pi@pirate:~/src/ring-mqtt $ docker -v
Docker version 18.09.1, build 4c52b90
pi@pirate:~/src/ring-mqtt $

Install Type

Docker

Version

unsure

Operating System

RaspianOS

Architecture

arn7

Machine Details

pi

tsightler commented 1 year ago

It's not bug with the container, it's a bug with your system. You are running 32-bit Raspbian 10 which has ancient Docker with broken libseccomp2 package so it can't run docker images based on modern Linux OS versions.

You will need to manually install backported libseccomp2 package since I don't think Raspbian ever released a fix for this (just Google this, it's already covered here and in many, many other places).

Ideally you should upgrade you OS to newer Raspberry Pi OS based in Debian 11 or, even better, switch to 64-bit OS.

Good luck!

zzxyz commented 1 year ago

It's weird that that's the OS that comes with the system. Odd. Ok, thank you!

tsightler commented 1 year ago

It's not that weird, like anything, operating systems contain bugs too. Raspbian 10 is now ~4 years old and ships with Docker and libseccomp2 versions from roughly that time (2019), which is practically ancient from a development perspective. The breakage has to do with many newer distros being dependent on 64-bit time working even on 32-bit systems but these older versions of Docker and libseccomp2 break with this requirement. The issue has been known since at least the release of Alpine 3.13 (current version in ring-mqtt is 3.17 and latest Alpine is 3.18 while 3.13 was over 2 1/2 years ago), but Raspbian doesn't update older versions of packages by default so the only way to get newer ones is to update to the newer OS version or install a backport of the newer package.

Raspberry Pi OS 11 has been released for almost 2 years now (Oct 2021 I believe) and should be stable and includes much newer versions of these packages. OS upgrades are generally straightforward in most cases.

But you don't have to upgrade the OS version, you can find instructions all over the internet for updating just the packages needed, and even some workarounds that don't require any upgrades at all. Some links:

https://forums.raspberrypi.com/viewtopic.php?t=339240

https://blog.samcater.com/fix-workaround-rpi4-docker-libseccomp2-docker-20/

A script to fix it: https://github.com/sdr-enthusiasts/Buster-Docker-Fixes/blob/main/libseccomp2-checker.sh

But, IMO, by far the best is to just upgrade the OS to get to current versions of things.

Good luck!