Container network issues - no route to host.

Post Reply
weaselq
New here
Posts: 4
Joined: Fri Jul 02, 2021 1:44 am

Container network issues - no route to host.

Post by weaselq »

Hi all,

This a bit a long shot/odd one!
I am trying run the Frigate NVR detection software in a container on my QNAP NAS.
I have many other containers running on it, of various types. No network issues at all!

I have tried to create the contain via the GUI Wizard and the Docker compose interface.
Tried bridge and NAT... same issue networking on this container fails

Code: Select all

docker run --privileged --net=qnet-static-eth0-adc76b  --ip=172.16.1.20   --name frigate   \
--restart=unless-stopped   --mount type=tmpfs,target=/tmp/cache,tmpfs-size=1000000000 \ 
-v /dev/bus/usb:/dev/bus/usb    -v /share/CACHEDEV1_DATA/Container/Frigate/media/:/media/frigate   -v \ /share/CACHEDEV1_DATA/Container/Frigate/config/config.yml:/config/config.yml:ro   \
-v /etc/localtime:/etc/localtime:ro   -e FRIGATE_RTSP_PASSWORD='password'   -p 5007:5000   -p 1935:1935  \ blakeblackshear/frigate:0.9.0-dada764-amd64
Normal run... fail

Code: Select all

[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] done.
[services.d] starting services
[services.d] done.
Starting migrations
[2021-06-23 16:44:32] peewee_migrate                 INFO    : Starting migrations
[2021-06-23 16:44:32] peewee                         DEBUG   : ('CREATE TABLE IF NOT EXISTS "migratehistory" ("id" INTEGER NOT NULL PRIMARY KEY, "name" VARCHAR(255) NOT NULL, "migrated_at" DATETIME NOT NULL)', [])
[2021-06-23 16:44:32] peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."name", "t1"."migrated_at" FROM "migratehistory" AS "t1" ORDER BY "t1"."id"', [])
There is nothing to migrate
[2021-06-23 16:44:32] peewee_migrate                 INFO    : There is nothing to migrate
[Errno 113] No route to host  ####### Cannot talk to the host ######
[cmd] python3 exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting
Now this same config works on other docker hosts I have. Just not the QNAP!

I found on the QNAP if I go interactive and do a "docker run ...... -it"
Initially it fails until I do some other network stuff

Hack to get it running

Now if I run the image interactively.. I get the same error. Until I run some other network command!??
... -it /bin/bash

Code: Select all

[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] done.
[services.d] starting services
[services.d] done.
root@3f95ae1c1193:/opt/frigate# python3 -u -m frigate
Starting migrations
[2021-06-23 14:25:59] peewee_migrate INFO : Starting migrations
[2021-06-23 14:25:59] peewee DEBUG : ('CREATE TABLE IF NOT EXISTS "migratehistory" ("id" INTEGER NOT NULL PRIMARY KEY, "name" VARCHAR(255) NOT NULL, "migrated_at" DATETIME NOT NULL)', [])
[2021-06-23 14:25:59] peewee DEBUG : ('SELECT "t1"."id", "t1"."name", "t1"."migrated_at" FROM "migratehistory" AS "t1" ORDER BY "t1"."id"', [])
There is nothing to migrate
[2021-06-23 14:25:59] peewee_migrate INFO : There is nothing to migrate
[Errno 113] No route to host
root@3f95ae1c1193:/opt/frigate# apt-get update ## Do some other network thing
Err:1 http://archive.ubuntu.com/ubuntu focal InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:2 https://packages.cloud.google.com/apt coral-edgetpu-stable InRelease
Temporary failure resolving 'packages.cloud.google.com'
Err:3 http://security.ubuntu.com/ubuntu focal-security InRelease
Temporary failure resolving 'security.ubuntu.com'
Get:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [1032 kB]
Get:7 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [395 kB]
Get:8 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1343 kB]
Fetched 2985 kB in 15s (204 kB/s)
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease Temporary failure resolving 'security.ubuntu.com'
W: Failed to fetch https://packages.cloud.google.com/apt/dists/coral-edgetpu-stable/InRelease Temporary failure resolving 'packages.cloud.google.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.

root@3f95ae1c1193:/opt/frigate# python3 -u -m frigate                         ####**** Run the command again ***** ####
Starting migrations
[2021-06-23 14:26:28] peewee_migrate INFO : Starting migrations
[2021-06-23 14:26:28] peewee DEBUG : ('CREATE TABLE IF NOT EXISTS "migratehistory" ("id" INTEGER NOT NULL PRIMARY KEY, "name" VARCHAR(255) NOT NULL, "migrated_at" DATETIME NOT NULL)', [])
[2021-06-23 14:26:28] peewee DEBUG : ('SELECT "t1"."id", "t1"."name", "t1"."migrated_at" FROM "migratehistory" AS "t1" ORDER BY "t1"."id"', [])
There is nothing to migrate
[2021-06-23 14:26:28] peewee_migrate INFO : There is nothing to migrate
[2021-06-23 14:26:28] frigate.mqtt INFO : MQTT connected                       ###### ****Works!!***** #######
[2021-06-23 14:26:28] frigate.app INFO : Output process started: 369
[2021-06-23 14:26:28] frigate.app INFO : Camera processor started for back: 371
[2021-06-23 14:26:28] frigate.app INFO : Capture process started for back: 372
[2021-06-23 14:26:28] ws4py INFO : Using epoll
[2021-06-23 14:26:28] detector.coral INFO : Starting detection process: 368
[2021-06-23 14:26:28] ws4py INFO : Using epoll
[2021-06-23 14:26:28] frigate.edgetpu INFO : Attempting to load TPU as usb
[2021-06-23 14:26:33] frigate.edgetpu INFO : TPU found
[2021-06-23 14:31:28] peewee DEBUG : ('SELECT DISTINCT "t1"."label" FROM "event" AS "t1" WHERE ("t1"."camera" NOT IN (?))', ['back'])
[2021-06-23 14:31:28] peewee DEBUG : ('SELECT DISTINCT "t1"."label" FROM "event" AS "t1" WHERE ("t1"."camera" = ?)', ['back'])
[2021-06-23 14:31:28] peewee DEBUG : ('SELECT DISTINCT "t1"."label" FROM "event" AS "t1" WHERE ("t1"."camera" NOT IN (?))', ['back'])
[2021-06-23 14:31:28] peewee DEBUG : ('SELECT DISTINCT "t1"."label" FROM "event" AS "t1" WHERE ("t1"."camera" = ?)', ['back'])
[2021-06-23 14:31:28] peewee.sqliteq DEBUG : received query with grouped_events as (

Any ideas?

Model: TS673
Firmware: 4.5.3.1697
Container Station: 2.3.5.1708
dizzy2604
New here
Posts: 3
Joined: Sun Nov 18, 2018 7:15 pm

Re: Container network issues - no route to host.

Post by dizzy2604 »

same problem here, can't make it running with bridged networking.
weaselq
New here
Posts: 4
Joined: Fri Jul 02, 2021 1:44 am

Re: Container network issues - no route to host.

Post by weaselq »

dizzy2604 wrote: Thu Jul 08, 2021 11:27 pm same problem here, can't make it running with bridged networking.
I managed to get it working with dirty hack! :)
*** As of 20 minutes ago! ***

I created a file on the image called "/start.sh"
add:
#!/usr/bin/bash sleep 20
python3 -u -m frigate
echo "trying again"
python3 -u -m frigate
Did a docker commit to create and new image.
Started the new image with the command "/start.sh"

And now it seems to work!!
Some kind of timing issue!?

$ docker logs frigate
[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] done.
[services.d] starting services
[services.d] done.
+ sleep 20
+ python3 -u -m frigate
Starting migrations
[2021-07-08 18:05:36] peewee_migrate INFO : Starting migrations
[2021-07-08 18:05:36] peewee DEBUG : ('CREATE TABLE IF NOT EXISTS "migratehistory" ("id" INTEGER NOT NULL PRIMARY KEY, "name" VARCHAR(255) NOT NULL, "migrated_at" DATETIME NOT NULL)', [])
[2021-07-08 18:05:36] peewee DEBUG : ('SELECT "t1"."id", "t1"."name", "t1"."migrated_at" FROM "migratehistory" AS "t1" ORDER BY "t1"."id"', [])
There is nothing to migrate
[2021-07-08 18:05:36] peewee_migrate INFO : There is nothing to migrate
[Errno 113] No route to host
+ sleep 20
+ echo 'try again...'
+ python3 -u -m frigate
try again...
Starting migrations
[2021-07-08 18:06:00] peewee_migrate INFO : Starting migrations
[2021-07-08 18:06:00] peewee DEBUG : ('CREATE TABLE IF NOT EXISTS "migratehistory" ("id" INTEGER NOT NULL PRIMARY KEY, "name" VARCHAR(255) NOT NULL, "migrated_at" DATETIME NOT NULL)', [])
[2021-07-08 18:06:00] peewee DEBUG : ('SELECT "t1"."id", "t1"."name", "t1"."migrated_at" FROM "migratehistory" AS "t1" ORDER BY "t1"."id"', [])
There is nothing to migrate
[2021-07-08 18:06:00] peewee_migrate INFO : There is nothing to migrate
[2021-07-08 18:06:00] frigate.mqtt INFO : MQTT connected
[2021-07-08 18:06:00] frigate.app INFO : Output process started: 238
[2021-07-08 18:06:00] frigate.app INFO : Camera processor started for back: 240
[2021-07-08 18:06:00] frigate.app INFO : Capture process started for back: 242
[2021-07-08 18:06:00] ws4py INFO : Using epoll
[2021-07-08 18:06:00] ws4py INFO : Using epoll
[2021-07-08 18:06:04] ws4py INFO : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:58514]
[2021-07-08 18:06:00] detector.coral INFO : Starting detection process: 237
[2021-07-08 18:06:00] frigate.edgetpu INFO : Attempting to load TPU as usb
[2021-07-08 18:06:05] frigate.edgetpu INFO : TPU found
dizzy2604
New here
Posts: 3
Joined: Sun Nov 18, 2018 7:15 pm

Re: Container network issues - no route to host.

Post by dizzy2604 »

Nice man! thank you.
I modified run.sh this way and container is running fine

Code: Select all

#!/usr/bin/env bash

printf "%s" "waiting for MQTT server ..."
while ! ping -c 1 -n -w 1 x.x.x.x &> /dev/null
do
    sleep 10
    printf "%c" "."
done
printf "\n%s\n"  "MQTT server is online"
service nginx start
exec python3 -u -m frigate
weaselq
New here
Posts: 4
Joined: Fri Jul 02, 2021 1:44 am

Re: Container network issues - no route to host.

Post by weaselq »

I have been bashing at this for weeks now! Glad we have a workaround.
I guess I could just map the script into the container at run time... Baby steps :DD

Now to get Home Assistant to receive notifications!
Balajeek
First post
Posts: 1
Joined: Sat Aug 21, 2021 1:22 am

Re: Container network issues - no route to host.

Post by Balajeek »

Hi guys,
Can't really find any thread really about frigate on qnap, luckily this one i found seem you guys solved the problem. Hope you can help me.

I setup frigate on an NUC with coral first, then looking at the cpu consumption i decided to move it to qnap (after i notices QuMagie could also use the coral)

So I created docker-compose directly from SSH to qnap and spun up the container, moved my config and made few adjustments for volumes and initially frigate complain it did not find EdgeTPU, but after restart of qnap and update to latest version frigate found TPU and all recording seem to work. At that time i also had QuMagie (enabled by default) added like 100 photos and QuMagie did the AI using coral and all was well, frigate was working, QuMagie was working.

2 days ago i added all my photos into the qnap photo folder so QuMagie should start processing, which it did and finished and Qumagie seem work well.
Then i noticed frigate log that it can't find EdgeTPU, tried restarting frigate and also qnap but no luck yet.

Any idea whats going on? I see from control panel-> hardware it shows the google coral and "Multimedia Console" app with priority (seem you can add other apps to set priority). The fact is frigate was able to see Edge TPU and was working.

Now after i that try and nothing worked I am wondering if i not use the docker-compose and directly create the container from qnap container app itself, to do that i am not sure whats the information i need to provide in the gui of container app while creating. anyone can help?

thank you.
weaselq
New here
Posts: 4
Joined: Fri Jul 02, 2021 1:44 am

Re: Container network issues - no route to host.

Post by weaselq »

Hi,

I'm not sure. :(
I have the same setup as you. Qumagie has the TPU, but Frigate still works.
How are you passing the TPU to Frigate in docker?

Balajeek wrote: Sat Aug 21, 2021 1:35 am Hi guys,
Can't really find any thread really about frigate on qnap, luckily this one i found seem you guys solved the problem. Hope you can help me.

I setup frigate on an NUC with coral first, then looking at the cpu consumption i decided to move it to qnap (after i notices QuMagie could also use the coral)

So I created docker-compose directly from SSH to qnap and spun up the container, moved my config and made few adjustments for volumes and initially frigate complain it did not find EdgeTPU, but after restart of qnap and update to latest version frigate found TPU and all recording seem to work. At that time i also had QuMagie (enabled by default) added like 100 photos and QuMagie did the AI using coral and all was well, frigate was working, QuMagie was working.

2 days ago i added all my photos into the qnap photo folder so QuMagie should start processing, which it did and finished and Qumagie seem work well.
Then i noticed frigate log that it can't find EdgeTPU, tried restarting frigate and also qnap but no luck yet.

Any idea whats going on? I see from control panel-> hardware it shows the google coral and "Multimedia Console" app with priority (seem you can add other apps to set priority). The fact is frigate was able to see Edge TPU and was working.

Now after i that try and nothing worked I am wondering if i not use the docker-compose and directly create the container from qnap container app itself, to do that i am not sure whats the information i need to provide in the gui of container app while creating. anyone can help?

thank you.
Post Reply

Return to “Container Station”