mikenye / docker-readsb

Multi-architecture readsb container with support for RTLSDR, bladeRF and plutoSDR (x86_64, arm32v7, arm64v8)
83 stars 4 forks source link

Docker container continually restarts #1

Closed MrSuttonmann closed 4 years ago

MrSuttonmann commented 4 years ago

Hi, I'm trying your guide out of a Raspberry Pi 2 Model B, and I've got the container running.

I didn't get any output when I tried to run docker exec -it readsb viewadsb, and when running docker ps I could see the container restarting every few seconds, so I thought I'd view the logs:

readsb    | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
readsb    | [s6-init] ensuring user provided files have correct perms...exited 0.
readsb    | [fix-attrs.d] applying ownership & permissions fixes...
readsb    | [fix-attrs.d] done.
readsb    | [cont-init.d] executing container initialization scripts...
readsb    | [cont-init.d] done.
readsb    | [services.d] starting services
readsb    | [services.d] done.
readsb    | [cmd] /usr/local/bin/readsb exited 267
readsb    | [cont-finish.d] executing container finish scripts...
readsb    | [cont-finish.d] done.
readsb    | [s6-finish] waiting for services.
readsb    | [s6-finish] sending all processes the TERM signal.
readsb    | [s6-finish] sending all processes the KILL signal and exiting.
readsb    | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
readsb    | [s6-init] ensuring user provided files have correct perms...exited 0.
readsb    | [fix-attrs.d] applying ownership & permissions fixes...
readsb    | [fix-attrs.d] done.
readsb    | [cont-init.d] executing container initialization scripts...
readsb    | [cont-init.d] done.
readsb    | [services.d] starting services
readsb    | [services.d] done.
readsb    | [cmd] /usr/local/bin/readsb exited 267
readsb    | [cont-finish.d] executing container finish scripts...
readsb    | [cont-finish.d] done.
readsb    | [s6-finish] waiting for services.
readsb    | [s6-finish] sending all processes the TERM signal.
readsb    | [s6-finish] sending all processes the KILL signal and exiting.
readsb    | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
readsb    | [s6-init] ensuring user provided files have correct perms...exited 0.
readsb    | [fix-attrs.d] applying ownership & permissions fixes...
readsb    | [fix-attrs.d] done.
readsb    | [cont-init.d] executing container initialization scripts...
readsb    | [cont-init.d] done.
readsb    | [services.d] starting services
readsb    | [services.d] done.
readsb    | [cmd] /usr/local/bin/readsb exited 267
readsb    | [cont-finish.d] executing container finish scripts...
readsb    | [cont-finish.d] done.
readsb    | [s6-finish] waiting for services.
readsb    | [s6-finish] sending all processes the TERM signal.
readsb    | [s6-finish] sending all processes the KILL signal and exiting.
readsb    | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
readsb    | [s6-init] ensuring user provided files have correct perms...exited 0.
readsb    | [fix-attrs.d] applying ownership & permissions fixes...
readsb    | [fix-attrs.d] done.
readsb    | [cont-init.d] executing container initialization scripts...
readsb    | [cont-init.d] done.
readsb    | [services.d] starting services
readsb    | [services.d] done.
readsb    | [cmd] /usr/local/bin/readsb exited 267
readsb    | [cont-finish.d] executing container finish scripts...
readsb    | [cont-finish.d] done.
readsb    | [s6-finish] waiting for services.
readsb    | [s6-finish] sending all processes the TERM signal.
readsb    | [s6-finish] sending all processes the KILL signal and exiting.
readsb    | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
readsb    | [s6-init] ensuring user provided files have correct perms...exited 0.
readsb    | [fix-attrs.d] applying ownership & permissions fixes...
readsb    | [fix-attrs.d] done.
readsb    | [cont-init.d] executing container initialization scripts...
readsb    | [cont-init.d] done.
readsb    | [services.d] starting services
readsb    | [services.d] done.
readsb    | [cmd] /usr/local/bin/readsb exited 267
readsb    | [cont-finish.d] executing container finish scripts...
readsb    | [cont-finish.d] done.
readsb    | [s6-finish] waiting for services.
readsb    | [s6-finish] sending all processes the TERM signal.
readsb    | [s6-finish] sending all processes the KILL signal and exiting.
readsb    | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
readsb    | [s6-init] ensuring user provided files have correct perms...exited 0.
readsb    | [fix-attrs.d] applying ownership & permissions fixes...
readsb    | [fix-attrs.d] done.
readsb    | [cont-init.d] executing container initialization scripts...
readsb    | [cont-init.d] done.
readsb    | [services.d] starting services
readsb    | [services.d] done.
readsb    | [cmd] /usr/local/bin/readsb exited 267
readsb    | [cont-finish.d] executing container finish scripts...
readsb    | [cont-finish.d] done.
readsb    | [s6-finish] waiting for services.
readsb    | [s6-finish] sending all processes the TERM signal.
readsb    | [s6-finish] sending all processes the KILL signal and exiting.
readsb    | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
readsb    | [s6-init] ensuring user provided files have correct perms...exited 0.
readsb    | [fix-attrs.d] applying ownership & permissions fixes...
readsb    | [fix-attrs.d] done.
readsb    | [cont-init.d] executing container initialization scripts...
readsb    | [cont-init.d] done.
readsb    | [services.d] starting services
readsb    | [services.d] done.
readsb    | [cmd] /usr/local/bin/readsb exited 267
readsb    | [cont-finish.d] executing container finish scripts...
readsb    | [cont-finish.d] done.
readsb    | [s6-finish] waiting for services.
readsb    | [s6-finish] sending all processes the TERM signal.
readsb    | [s6-finish] sending all processes the KILL signal and exiting.
readsb    | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
readsb    | [s6-init] ensuring user provided files have correct perms...exited 0.
readsb    | [fix-attrs.d] applying ownership & permissions fixes...
readsb    | [fix-attrs.d] done.
readsb    | [cont-init.d] executing container initialization scripts...
readsb    | [cont-init.d] done.
readsb    | [services.d] starting services
readsb    | [services.d] done.
readsb    | [cmd] /usr/local/bin/readsb exited 267
readsb    | [cont-finish.d] executing container finish scripts...
readsb    | [cont-finish.d] done.
readsb    | [s6-finish] waiting for services.
readsb    | [s6-finish] sending all processes the TERM signal.
readsb    | [s6-finish] sending all processes the KILL signal and exiting.
readsb    | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
readsb    | [s6-init] ensuring user provided files have correct perms...exited 0.
readsb    | [fix-attrs.d] applying ownership & permissions fixes...
readsb    | [fix-attrs.d] done.
readsb    | [cont-init.d] executing container initialization scripts...
readsb    | [cont-init.d] done.
readsb    | [services.d] starting services
readsb    | [services.d] done.
readsb    | [cmd] /usr/local/bin/readsb exited 267
readsb    | [cont-finish.d] executing container finish scripts...
readsb    | [cont-finish.d] done.
readsb    | [s6-finish] waiting for services.
readsb    | [s6-finish] sending all processes the TERM signal.
readsb    | [s6-finish] sending all processes the KILL signal and exiting.
readsb    | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
readsb    | [s6-init] ensuring user provided files have correct perms...exited 0.
readsb    | [fix-attrs.d] applying ownership & permissions fixes...
readsb    | [fix-attrs.d] done.
readsb    | [cont-init.d] executing container initialization scripts...
readsb    | [cont-init.d] done.
readsb    | [services.d] starting services
readsb    | [services.d] done.
readsb    | [cmd] /usr/local/bin/readsb exited 267
readsb    | [cont-finish.d] executing container finish scripts...
readsb    | [cont-finish.d] done.
readsb    | [s6-finish] waiting for services.
readsb    | [s6-finish] sending all processes the TERM signal.
readsb    | [s6-finish] sending all processes the KILL signal and exiting.
readsb    | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
readsb    | [s6-init] ensuring user provided files have correct perms...exited 0.
readsb    | [fix-attrs.d] applying ownership & permissions fixes...
readsb    | [fix-attrs.d] done.
readsb    | [cont-init.d] executing container initialization scripts...
readsb    | [cont-init.d] done.
readsb    | [services.d] starting services
readsb    | [services.d] done.
readsb    | [cmd] /usr/local/bin/readsb exited 267
readsb    | [cont-finish.d] executing container finish scripts...
readsb    | [cont-finish.d] done.
readsb    | [s6-finish] waiting for services.
readsb    | [s6-finish] sending all processes the TERM signal.
readsb    | [s6-finish] sending all processes the KILL signal and exiting.
readsb    | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
readsb    | [s6-init] ensuring user provided files have correct perms...exited 0.
readsb    | [fix-attrs.d] applying ownership & permissions fixes...
readsb    | [fix-attrs.d] done.
readsb    | [cont-init.d] executing container initialization scripts...
readsb    | [cont-init.d] done.
readsb    | [services.d] starting services
readsb    | [services.d] done.
readsb    | [cmd] /usr/local/bin/readsb exited 267
readsb    | [cont-finish.d] executing container finish scripts...
readsb    | [cont-finish.d] done.
readsb    | [s6-finish] waiting for services.
readsb    | [s6-finish] sending all processes the TERM signal.
readsb    | [s6-finish] sending all processes the KILL signal and exiting.
readsb exited with code 11

I think the key entry in the log is this one:

[cmd] /usr/local/bin/readsb exited 267

Here's my YML file:

version: '2.0'

networks:
  adsbnet:

services:

  readsb:
    image: mikenye/readsb:latest
    tty: true
    container_name: readsb
    restart: always
    devices:
      - /dev/bus/usb/001/005:/dev/bus/usb/001/005
    ports:
      - 8080:80
      - 30005:30005
    networks:
      - adsbnet
    command:
      - --dcfilter
      - --device-type=rtlsdr
      - --fix
      - --forward-mlat
      - --json-location-accuracy=2
      - --lat=REDACTED
      - --lon=REDACTED
      - --mlat
      - --modeac
      - --ppm=0
      - --net
      - --stats-every=3600
      - --quiet
      - --write-json=/var/run/readsb

and the output of lsusb:

pi@adsbpi:/opt/adsb $ lsusb
Bus 001 Device 005: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T
Bus 001 Device 004: ID 148f:5372 Ralink Technology, Corp. RT5372 Wireless Adapter
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Any ideas? Thanks for your hard work on this guide, I'd love to see this working!

mikenye commented 4 years ago

Hi @plinkpaste, thanks for getting in touch.

It looks like the readsb binary is exiting abnormally when it's trying to start.

Could you try running readsb manually to see if this gives us any more meaningful info?

To do this:

docker run --rm -it --name readsb --device /dev/bus/usb/001/005:/dev/bus/usb/001/005 -p 8080:80 -p 30005:30005 --entrypoint bash mikenye/readsb

This will create the container and drop you into a shell.

One in there, please run:

readsb --dcfilter --device-type=rtlsdr --fix --forward-mlat --json-location-accuracy=2 --lat=REDACTED --lon=REDACTED --mlat --modeac --ppm=0 --net --stats-every=3600

Please change REDACTED to valid lat/long.

If you could post the output of this process, it would be appreciated.

Once readsb fails, if you can exit the container with CTRL-D. This temporary container will be automatically deleted upon exit (--rm).

Also, I've had another user report an issue with the RTL2838. The solution was to downgrade rtl-sdr to 0.5.3 (from 0.6.0). Unfortunately I can't get readsb to build against rtl-sdr 0.5.3, so if your problem ends up being related, you may have to forego the readsb container, and use the piaware container instead (which uses dump1090, which readsb is forked from). See: https://github.com/mikenye/docker-piaware/issues/15

Thanks!

-Mike

MrSuttonmann commented 4 years ago

Hi Mike, thanks for your response.

I tried running manually, but this is the output I get:

pi@adsbpi:/opt/adsb $ docker run --rm -it --name readsb --device /dev/bus/usb/001/005:/dev/bus/usb/001/005 -p 8080:80 -p 30005:30005 --entrypoint bash mikenye/readsb

failed to resize tty, using default size
                                        pi@adsbpi:/opt/adsb $

I think it's possible my Pi might not be able to handle running Docker.

mikenye commented 4 years ago

Try docker run hello-world. Does that work?

MrSuttonmann commented 4 years ago

No, I get a blank output.

I'll give this a go with my Pi 4, the only issue is I'm currently using that as a TV tuner, so I hope the DVB I'm using for ADSB won't interfere...

mikenye commented 4 years ago

OK, it sounds like your docker install might have issues...

MrSuttonmann commented 4 years ago

Came across this.

Apparently the default hello-world container doesn't work on ARM. I tried the ARM version and got an output:

pi@adsbpi:/opt/adsb $ docker run hypriot/armhf-hello-world
Unable to find image 'hypriot/armhf-hello-world:latest' locally
latest: Pulling from hypriot/armhf-hello-world
Image docker.io/hypriot/armhf-hello-world:latest uses outdated schema1 manifest format. Please upgrade to a schema2 image for better future compatibility. More information at https://docs.docker.com/registry/spec/deprecated-schema-v1/
4b84770bb49c: Pull complete
a3ed95caeb02: Pull complete
Digest: sha256:b618ec0cc3acf683e8d77ad6c5ec81546cddde2036eda9a78f628effdeca74cd
Status: Downloaded newer image for hypriot/armhf-hello-world:latest
Hello from Docker.
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker Hub account:
 https://hub.docker.com

For more examples and ideas, visit:
 https://docs.docker.com/userguide/

pi@adsbpi:/opt/adsb $

I see you've tested readsb on a Raspi 4, which is also ARM, so in theory it should work, right?

mikenye commented 4 years ago

Running on my Odroid, I get the following:

$ docker run hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (arm32v7)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

So the default hello-world should work on ARM...

Could you post the output of uname -m?

MrSuttonmann commented 4 years ago

Hm, interesting.

uname -m gives the following:

armv6l

mikenye commented 4 years ago

Are you sure it’s an RPi2? What operating system and version are you running? The RPi 2 should have an A7 CPU, and hence have an architecture of ‘armv7l’. If you’re running an old OS it is possible that this is the culprit. For example, even though the newer RPis have ARMv8 CPUs, the operating system at the time of release was built for the ‘armv7l’ architecture and we are only recently getting versions that fully support the ARMv8 architecture...

mikenye commented 4 years ago

The wikipedia page has a handy table with the specifications for each model: https://en.wikipedia.org/wiki/Raspberry_Pi

MrSuttonmann commented 4 years ago

My bad, it's actually a RPi 1 B+, and I'm running Raspbian Buster on it.

I should probably upgrade it, or just run fr24feed on it instead.

mikenye commented 4 years ago

No problems. You could try building the containers yourself? It isn't too hard.

git clone https://github.com/mikenye/docker-readsb.git
cd docker-readsb
docker build -t readsb .

See how you go.

For now, I'll close this one out as this architecture isn't one I can support - I don't have an RPi1B+ to compile on! :-)

Good luck and if you need any further assistance please get in touch.

Kind regards, Mike Nye

MrSuttonmann commented 4 years ago

I'll give that a go. Thanks for your help!

mikenye commented 4 years ago

Any time!