mikenye / docker-readsb

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

readsb Exit Code 267 #16

Closed marvk closed 4 years ago

marvk commented 4 years ago

I'm following the setup guide in the wiki.

On the step "Create docker-compose.yml file", after running docker-compose up -d and then trying to run the command docker exec -it readsb viewadsb, I get the error

Error response from daemon: Container e6f2422e4bf4a7d9ac708c484340737b10d6389015bda10b3b746541580277b9 is restarting, wait until the container is running

When I check the logs, I'm getting the following messages continually:

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] 01-readsb: executing...
readsb    | [cont-init.d] 01-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.

This is on a Raspberry Pi Model B (RBCA000) on Raspbian Buster Lite (February 2020)

mikenye commented 4 years ago

Hi @marvk, sorry you're having issues with the image.

Could you please post the output of the command uname -a from your Pi?

Also, are you able to share your docker-compose.yml file? Please censor your location and other sensitive information.

Thanks.

marvk commented 4 years ago

Thanks for the quick reply!

uname -a

Linux strawberry 4.19.97+ #1294 Thu Jan 30 13:10:54 GMT 2020 armv6l GNU/Linux

docker-compose.yml


networks:
  adsbnet:

services:

  readsb:
    image: mikenye/readsb:latest
    tty: true
    container_name: readsb
    restart: always
    devices:
      - /dev/bus/usb/001/004:/dev/bus/usb/001/004
    ports:
      - 8080:8080
      - 30005:30005
    networks:
      - adsbnet
    environment:
      - TZ=Europe/Berlin
    command:
      - --dcfilter
      - --device-type=rtlsdr
      - --fix
      - --json-location-accuracy=2
      - --lat=xx.xxxxx
      - --lon=xx.xxxxx
      - --modeac
      - --ppm=0

      - --net
      - --stats-every=3600
      - --quiet
      - --write-json=/run/readsb

Is the armv6l architecture the issue?

mikenye commented 4 years ago

Hi @marvk, I believe so. While waiting for you to respond I added arm/v6 support to the image, so if you pull mikenye/readsb:latest and re-try, hopefully that works for you. Let me know.

marvk commented 4 years ago

@mikenye Sadly, no such luck. Still the same issue. I thought it might have been caused by the missing RTL-SDR kernel module blacklist (Forgot sudo, oops), but that wasn't it either.

pi@strawberry:/opt/adsb $ sudo docker-compose up -d
Creating network "adsb_adsbnet" with the default driver
Pulling readsb (mikenye/readsb:latest)...
latest: Pulling from mikenye/readsb
Digest: sha256:9be5e96775076b0d38ce6ac39683f7f16fbe26125c30fa0ec3eb415113e17a8e
Status: Downloaded newer image for mikenye/readsb:latest
Creating readsb ... done
pi@strawberry:/opt/adsb $ sudo docker-compose logs -f
Attaching to readsb
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] 01-readsb: executing...
readsb    | [cont-init.d] 01-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.
mikenye commented 4 years ago

Hi @marvk, I've made a version of the image that has some debugging added that should help diagnose the problem.

Can you change your image out for mikenye/readsb:issue_16 and re-run, posting the output here?

Thanks.

marvk commented 4 years ago

@mikenye Unfortunately, there's no additional output. It's exactly the same. And yes, it's using the correct image:

pi@strawberry:/opt/adsb $ sudo docker ps
CONTAINER ID        IMAGE                     COMMAND                  CREATED             STATUS                          PORTS               NAMES
f7c97a5dc4d4        mikenye/readsb:issue_16   "/init --dcfilter --…"   3 minutes ago       Restarting (1) 14 seconds ago                       readsb
mikenye commented 4 years ago

@marvk ok. Can you try the following:

docker run --rm -it --entrypoint /bin/sh mikenye/readsb:issue_16

That should place you in a root shell inside a freshly created container using the mikenye/readsb:issue_16 image.

Then run the following commands:

set -x
sh /etc/cont-init.d/01-readsb

If you could paste all of the output, that would be great.

Then when you're done, you can type CTRL+D to exit the container. The temp container will be automatically deleted (--rm).

Thanks.

marvk commented 4 years ago

@mikenye I've been trying the whole time to get it to boot into a shell, but no luck.

pi@strawberry:~ $ sudo docker run --rm -it --entrypoint /bin/sh mikenye/readsb:issue_16
failed to resize tty, using default size
                                        pi@strawberry:~ $

I don't think the resizing is the issue, I've tried this workaround and the issue persisted.

I've also tried to run the command you suggested as the Entrypoint:

pi@strawberry:~ $ sudo docker run --rm -it --entrypoint "/bin/sh /etc/cont-init.d/01-readsb" mikenye/readsb:issue_16
docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"/bin/sh /etc/cont-init.d/01-readsb\": stat /bin/sh /etc/cont-init.d/01-readsb: no such file or directory": unknown.
ERRO[0009] error waiting for container: context canceled
mikenye commented 4 years ago

@marvk try sudo docker run --rm -it --entrypoint /bin/sh mikenye/readsb:issue_16 /etc/cont-init.d/01-readsb

mikenye commented 4 years ago

If you get the resize error, try removing -it from the command...

marvk commented 4 years ago

@mikenye Still no output, not even in docker logs <ID>.

mikenye commented 4 years ago

OK. Let's see if we can get a basic debian container running (the readsb container is based off debian).

docker run --rm -it debian:stable-slim

Let's see if that drops you into a debian container shell, and we'll take it from there.

marvk commented 4 years ago

No output, however, a hello world container works:

pi@strawberry:~ $ sudo docker run --rm 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.

[...]
mikenye commented 4 years ago

Looking at the debian docker images, it looks like they don't support armv6...

https://hub.docker.com/layers/debian/library/debian/stable-slim/images/sha256-1684b2165cfb014cdb958fafde567d26e34a756bbec979a7d735f8c988c6d8bf?context=explore

linux/386
linux/amd64
linux/arm/v5
linux/arm/v7
linux/arm64/v8
linux/mips64le
linux/ppc64le
linux/s390x

This would likely explain why the image is misbehaving...

Having said that, the hello-world image doesn't include support for armv6 either...

I'll need to do some more reading on this.

Apart from the hello-world image, do you have any other images working?

marvk commented 4 years ago

It's hypriot/armhf-hello-world. So it's an architecture issue after all.

I haven't tried any other images, since the only reason I'm trying to change my setup with this old Pi is that the ADS-B Receiver Project has become unmaintained.

If you want me to try anything else, please let me know.

mikenye commented 4 years ago

The weird thing is that it uses armhf architecture, which I build for and which Debian absolutely supports...

I’m going to do some more testing as I’m not 100% convinced there isn’t a problem somewhere...

I’ll keep you posted.

mikenye commented 4 years ago

I had some time to test the image on an armhf platform that I have.

$ docker run --rm -it mikenye/readsb --net-only
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-readsb: executing...
WARNING: TZ environment variable not set
[cont-init.d] 01-readsb: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Tue May 26 08:33:39 2020 UTC  Mictronics v3.8.3 starting up.
Net-only mode, no SDR device or file open.

And from within the container:

# uname -a
Linux 398e8a0de8b8 4.14.176-174 #1 SMP PREEMPT Mon Apr 13 15:19:40 -03 2020 armv7l GNU/Linux

# file /bin/sh
/bin/sh: symbolic link to dash

# file /bin/dash
/bin/dash: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=642545b6392ba038e9c366fa9c33b9ed0f835cf9, stripped

So as you can see above, it looks like the armhf image works fine on armv7l.

Some googling suggests that Debian's armhf architecture only supports armv7l and onwards (https://www.debian.org/releases/stable/armhf/).

So I'm willing to call this one "unable to fix" unfortunately. I can't really convert the image to Alpine due to incompatibilities with musl...

marvk commented 4 years ago

Thanks for your work!

So I'm willing to call this one "unable to fix" unfortunately.

Bummer. So it's either a new Pi or installing the software manually.

mikenye commented 4 years ago

Unfortunately. I’m sorry.