sdr-enthusiasts / docker-flightradar24

Multi-architecture docker container (arm32v7/arm64/x86_64) running flightradar24 fr24feed. Designed to work in tandem with https://sdr-e.com/docker-adsb-ultrafeeder
137 stars 19 forks source link

Cannot connect to readsb container, failed to synchonize time #280

Closed harenber closed 1 month ago

harenber commented 1 month ago

It seems I cannot get the fr24feed to run.

Here is my docker-compose.yml (some personal information replaced with XXX):

cubietruck:/container# cat fr24/docker-compose.yml
version: '3.7'

services:
volumes:
  readsbpb_rrd:
  readsbpb_autogain:

services:
  readsb:
    image: ghcr.io/sdr-enthusiasts/docker-readsb-protobuf:latest
    tty: true
    container_name: readsb
    hostname: readsb
    restart: always
    devices:
      - /dev/bus/usb:/dev/bus/usb
    ports:
      - 8080:8080
      - 30005:30005
    environment:
      - TZ="Europe/Berlin"
      - READSB_DCFILTER=true
      - READSB_DEVICE_TYPE=rtlsdr
      - READSB_FIX=true
      - READSB_GAIN=autogain
      - READSB_LAT=XXX
      - READSB_LON=XXX
      - READSB_MODEAC=true
      - READSB_RX_LOCATION_ACCURACY=2
      - READSB_STATS_RANGE=true
      - READSB_NET_ENABLE=true
    volumes:
      - readsbpb_rrd:/run/collectd
      - readsbpb_autogain:/run/autogain
      - /proc/diskstats:/proc/diskstats:ro
    tmpfs:
      - /run/readsb:size=64M
      - /var/log:size=32M

  fr24feed:
    container_name: fr24
    image: mikenye/fr24feed:latest
    tty: true
    ports:
      - 8754:8754
    volumes:
      - /etc/localtime:/etc/localtime:ro
    environment:
      - TZ="Europe/Berlin"
      - FR24KEY=XXX
      - MLAT=no
      - BEASTHOST=readsb

Error messages are like:

cubietruck:/container# docker logs -f fr24
[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] 00-libsecomp2: executing... 
[cont-init.d] 00-libsecomp2: exited 0.
[cont-init.d] 01-fr24feed: executing... 
WARNING: Setting timezone via TZ is not supported in this container. fr24feed requires the container has a timezone of GMT (+0).
fr24feed version: 1.0.34-0
[cont-init.d] 01-fr24feed: exited 0.
[cont-init.d] 02-show-architecture.sh: executing... 

Hardware information:
Machine:   x86_64
Processor: unknown
Platform:  unknown

[cont-init.d] 02-show-architecture.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2024-07-13 10:54:06 | ______  _  _         _      _                    _              _____    ___ 
2024-07-13 10:54:06 | |  ___|| |(_)       | |    | |                  | |            / __  \  /   |
2024-07-13 10:54:06 | | |_   | | _   __ _ | |__  | |_  _ __  __ _   __| |  __ _  _ __`' / /' / /| |
2024-07-13 10:54:06 | |  _|  | || | / _` || '_ \ | __|| '__|/ _` | / _` | / _` || '__| / /  / /_| |
2024-07-13 10:54:06 | | |    | || || (_| || | | || |_ | |  | (_| || (_| || (_| || |  ./ /___\___  |
2024-07-13 10:54:06 | \_|    |_||_| \__, ||_| |_| \__||_|   \__,_| \__,_| \__,_||_|  \_____/    |_/
2024-07-13 10:54:06 |                __/ |                                                         
2024-07-13 10:54:06 |               |___/                                                          
2024-07-13 10:54:06 | 24-07-13 10:54:06.575 [I][http-server.cpp:270] [httpd]Server started, listening on :::8754
2024-07-13 10:54:06 | [i]PacketSenderConfiguration::fetch_config(): Yoda configuration for this receiver is disabled
2024-07-13 10:54:06 | [d]TLSConnection::ctor(): Enable verify_peer in production code!
2024-07-13 10:54:06 | BeastBase::connectTcp(): Unable go connect, error: Cannot assign requested address[reader][e]Could not connect to tcp://readsb:30005
2024-07-13 10:54:07 | [time][e]Failed to synchronize time

What I already tested:

cubietruck:/container# telnet cubietruck.fritz.box 30005
Trying 127.0.0.1...
Connected to cubietruck.fritz.box.
Escape character is '^]'.
3M #X2*`2,3M #
              2x8233M #ܞ2

But whatever I do, the fr24feed container is still complaining as mentioned above.

Any pointers would be really appreciated.

Thanks, Torsten

JMTK commented 1 month ago

Try ensuring that the host's timezone is set as well: https://unix.stackexchange.com/a/718458/63223

harenber commented 1 month ago

Thanks for the suggestion @JMTK . Already tried that:

cubietruck:/container# ls -l /etc/localtime 
lrwxrwxrwx    1 root     root            17 Jul 16 15:27 /etc/localtime -> /etc/zoneinfo/UTC
cubietruck:/container# date
Tue Jul 16 15:31:23 UTC 2024
cubietruck:/container# docker compose up -d
[+] Running 3/3
 ✔ Network fr24_default  Created                                                                                                                                                                              0.1s 
 ✔ Container readsb      Started                                                                                                                                                                              0.3s 
 ✔ Container fr24        Started                                                                                                                                                                              0.3s 
cubietruck:/container# docker compose logs fr24feed
fr24  | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
fr24  | [s6-init] ensuring user provided files have correct perms...exited 0.
fr24  | [fix-attrs.d] applying ownership & permissions fixes...
fr24  | [fix-attrs.d] done.
fr24  | [cont-init.d] executing container initialization scripts...
fr24  | [cont-init.d] 00-libsecomp2: executing... 
fr24  | [cont-init.d] 00-libsecomp2: exited 0.
fr24  | [cont-init.d] 01-fr24feed: executing... 
fr24  | WARNING: Setting timezone via TZ is not supported in this container. fr24feed requires the container has a timezone of GMT (+0).
fr24  | fr24feed version: 1.0.34-0
fr24  | [cont-init.d] 01-fr24feed: exited 0.
fr24  | [cont-init.d] 02-show-architecture.sh: executing... 
fr24  | 
fr24  | Hardware information:
fr24  | Machine:   x86_64
fr24  | Processor: unknown
fr24  | Platform:  unknown
fr24  | 
fr24  | [cont-init.d] 02-show-architecture.sh: exited 0.
fr24  | [cont-init.d] done.
fr24  | [services.d] starting services
fr24  | [services.d] done.
fr24  | 2024-07-16 15:31:27 | ______  _  _         _      _                    _              _____    ___ 
fr24  | 2024-07-16 15:31:27 | |  ___|| |(_)       | |    | |                  | |            / __  \  /   |
fr24  | 2024-07-16 15:31:27 | | |_   | | _   __ _ | |__  | |_  _ __  __ _   __| |  __ _  _ __`' / /' / /| |
fr24  | 2024-07-16 15:31:27 | |  _|  | || | / _` || '_ \ | __|| '__|/ _` | / _` | / _` || '__| / /  / /_| |
fr24  | 2024-07-16 15:31:27 | | |    | || || (_| || | | || |_ | |  | (_| || (_| || (_| || |  ./ /___\___  |
fr24  | 2024-07-16 15:31:27 | \_|    |_||_| \__, ||_| |_| \__||_|   \__,_| \__,_| \__,_||_|  \_____/    |_/
fr24  | 2024-07-16 15:31:27 |                __/ |                                                         
fr24  | 2024-07-16 15:31:27 |               |___/                                                          
fr24  | 2024-07-16 15:31:27 | 24-07-16 15:31:27.936 [I][http-server.cpp:270] [httpd]Server started, listening on :::8754
fr24  | 2024-07-16 15:31:28 | [i]PacketSenderConfiguration::fetch_config(): Yoda configuration for this receiver is disabled
fr24  | 2024-07-16 15:31:28 | [d]TLSConnection::ctor(): Enable verify_peer in production code!
fr24  | 2024-07-16 15:31:28 | BeastBase::connectTcp(): Unable go connect, error: Network is unreachable[reader][e]Could not connect to tcp://readsb:30005
fr24  | 2024-07-16 15:31:28 | [time][e]Failed to synchronize time
fr24  | 2024-07-16 15:31:33 | BeastBase::connectTcp(): Unable go connect, error: Network is unreachable[reader][e]Could not connect to tcp://readsb:30005
fr24  | 2024-07-16 15:31:35 | [time][e]Failed to synchronize time
cubietruck:/container# 

Still doesn't seem to work.

When I remove the "TZ" variable from the containers, at least the "WARNING: Setting timezone via TZ is not supported in this container. fr24feed requires the container has a timezone of GMT (+0)." message disappears, but otherwise:

cubietruck:/container# docker compose logs fr24feed
fr24  | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
fr24  | [s6-init] ensuring user provided files have correct perms...exited 0.
fr24  | [fix-attrs.d] applying ownership & permissions fixes...
fr24  | [fix-attrs.d] done.
fr24  | [cont-init.d] executing container initialization scripts...
fr24  | [cont-init.d] 00-libsecomp2: executing... 
fr24  | [cont-init.d] 00-libsecomp2: exited 0.
fr24  | [cont-init.d] 01-fr24feed: executing... 
fr24  | fr24feed version: 1.0.34-0
fr24  | [cont-init.d] 01-fr24feed: exited 0.
fr24  | [cont-init.d] 02-show-architecture.sh: executing... 
fr24  | 
fr24  | Hardware information:
fr24  | Machine:   x86_64
fr24  | Processor: unknown
fr24  | Platform:  unknown
fr24  | 
fr24  | [cont-init.d] 02-show-architecture.sh: exited 0.
fr24  | [cont-init.d] done.
fr24  | [services.d] starting services
fr24  | [services.d] done.
fr24  | 2024-07-16 15:37:01 | ______  _  _         _      _                    _              _____    ___ 
fr24  | 2024-07-16 15:37:01 | |  ___|| |(_)       | |    | |                  | |            / __  \  /   |
fr24  | 2024-07-16 15:37:01 | | |_   | | _   __ _ | |__  | |_  _ __  __ _   __| |  __ _  _ __`' / /' / /| |
fr24  | 2024-07-16 15:37:01 | |  _|  | || | / _` || '_ \ | __|| '__|/ _` | / _` | / _` || '__| / /  / /_| |
fr24  | 2024-07-16 15:37:01 | | |    | || || (_| || | | || |_ | |  | (_| || (_| || (_| || |  ./ /___\___  |
fr24  | 2024-07-16 15:37:01 | \_|    |_||_| \__, ||_| |_| \__||_|   \__,_| \__,_| \__,_||_|  \_____/    |_/
fr24  | 2024-07-16 15:37:01 |                __/ |                                                         
fr24  | 2024-07-16 15:37:01 |               |___/                                                          
fr24  | 2024-07-16 15:37:01 | 24-07-16 15:37:01.072 [I][http-server.cpp:270] [httpd]Server started, listening on :::8754
fr24  | 2024-07-16 15:37:01 | [i]PacketSenderConfiguration::fetch_config(): Yoda configuration for this receiver is disabled
fr24  | 2024-07-16 15:37:01 | [d]TLSConnection::ctor(): Enable verify_peer in production code!
fr24  | 2024-07-16 15:37:01 | BeastBase::connectTcp(): Unable go connect, error: Network is unreachable[reader][e]Could not connect to tcp://readsb:30005
fr24  | 2024-07-16 15:37:01 | [time][e]Failed to synchronize time
fr24  | 2024-07-16 15:37:06 | BeastBase::connectTcp(): Unable go connect, error: Network is unreachable[reader][e]Could not connect to tcp://readsb:30005
fr24  | 2024-07-16 15:37:08 | [time][e]Failed to synchronize time
fr24  | 2024-07-16 15:37:11 | BeastBase::connectTcp(): Unable go connect, error: Network is unreachable[reader][e]Could not connect to tcp://readsb:30005
fr24  | 2024-07-16 15:37:16 | BeastBase::connectTcp(): Unable go connect, error: Network is unreachable[reader][e]Could not connect to tcp://readsb:30005
fr24  | 2024-07-16 15:37:17 | [time][e]Failed to synchronize time
fr24  | 2024-07-16 15:37:21 | BeastBase::connectTcp(): Unable go connect, error: Network is unreachable[reader][e]Could not connect to tcp://readsb:30005
cubietruck:/container# 

And about the "could not connect to tcp://readsb:30005":

cubietruck:/container# docker exec -it fr24 /bin/bash
root@92e3b04ac2bb:/# apt update && apt -y install telnet
Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB]
Get:2 http://deb.debian.org/debian-security bullseye-security InRelease [48.4 kB]
Get:3 http://deb.debian.org/debian bullseye-updates InRelease [44.1 kB]
Get:4 http://deb.debian.org/debian bullseye/main amd64 Packages [8067 kB]
Get:5 http://deb.debian.org/debian-security bullseye-security/main amd64 Packages [280 kB]
Get:6 http://deb.debian.org/debian bullseye-updates/main amd64 Packages [18.8 kB]
Fetched 8574 kB in 2s (5032 kB/s)                          
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
36 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  netbase
The following NEW packages will be installed:
  netbase telnet
0 upgraded, 2 newly installed, 0 to remove and 36 not upgraded.
Need to get 91.0 kB of archives.
After this operation, 209 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bullseye/main amd64 netbase all 6.3 [19.9 kB]
Get:2 http://deb.debian.org/debian bullseye/main amd64 telnet amd64 0.17-42 [71.1 kB]
Fetched 91.0 kB in 0s (889 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package netbase.
(Reading database ... 8203 files and directories currently installed.)
Preparing to unpack .../archives/netbase_6.3_all.deb ...
Unpacking netbase (6.3) ...
Selecting previously unselected package telnet.
Preparing to unpack .../telnet_0.17-42_amd64.deb ...
Unpacking telnet (0.17-42) ...
Setting up netbase (6.3) ...
Setting up telnet (0.17-42) ...
update-alternatives: using /usr/bin/telnet.netkit to provide /usr/bin/telnet (telnet) in auto mode
update-alternatives: warning: skip creation of /usr/share/man/man1/telnet.1.gz because associated file /usr/share/man/man1/telnet.netkit.1.gz (of link group telnet) doesn't exist
root@92e3b04ac2bb:/# telnet readsb 30005
Trying 172.18.0.3...
Connected to readsb.
Escape character is '^]'.
,2(XL1}c01}1d2}>  3},
               ` *2}
j("YS1}
v#Q43}V| M$
           mЀ2}{>

/var/log/fr24feed.log has these kind of messages:

2024-07-16 15:39:26 | [reader][i]Connecting to unknown receiver via (tcp://readsb:30005)
2024-07-16 15:39:26 | BeastBase::connectTcp(): Unable go connect, error: Network is unreachable[reader][e]Could not connect to tcp://readsb:30005
2024-07-16 15:39:26 | [time][i]Synchronizing time via NTP
2024-07-16 15:39:27 | [time][e]Failed to synchronize time

Cheers

Torsten

JMTK commented 1 month ago

I had a similar issue... 2 things helped: It turned out the hostname was wrong on mine, but yours looks correct (readsb). Mine was ultrafeeder in this case.

Have you tried rebuilding the entire virtual network via docker compose down?

Try adding - VERBOSE_LOGGING=true to the fr24 container env variables

wiedehopf commented 1 month ago

First off this is an outdated container version: image: mikenye/fr24feed:latest

Overall possibly just re-do your stack following this guide: https://sdr-enthusiasts.gitbook.io/ads-b/

Now the changed fr24feed version isn't guaranteed to work but it might. Leading theory to fr24 issues like this is that it can't handle certain DNS replies when it looks up the ntp servers. Not sure though.

Really it's just very lackluster software and fr24 provides bad support.

harenber commented 1 month ago

Thansk @JMTK for the suggestions. Yes, I completely docker compose down before re-starting. Didn't help either.

Never mind, I installed the stuff now bare-metal. Seems fr24feed is really not designed in a way that it could be easily moved into a container.

wiedehopf commented 1 month ago

It works just fine for most people in a container. When it doesn't work it's very hard and frustrating to track down programming errors in a program that's closed source.

Did you try the current version?

    image: ghcr.io/sdr-enthusiasts/docker-flightradar24:latest

Your yml indicated you were using a very old version from dockerhub.

0tofu commented 1 month ago

I encountered the same issue.

I am using the image ghcr.io/sdr-enthusiasts/docker-flightradar24:latest. Adding network_mode: host to fr24feed in compose.yaml resolved the problem. However, since I don't understand the cause, if there is a way to solve it without using network_mode: host, please let me know.