Closed cholcombe973 closed 3 years ago
Thanks for the clear bug report with stack trace. From these lines:
8: hyper::server::server::Server<hyper::server::tcp::AddrIncoming,()>::bind::{{closure}}
at .cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.7/src/server/server.rs:67:17
I believe the problem is that it can't bind the HTTP server because the address is unavailable. It defaults to 0.0.0.0:8080
, and if you run eg sudo netstat --listening --tcp --program
you'll find that some other program has claimed port 8080. You can stop the other thing or tell Moonfire NVR to use a different port via the --http-addr
argument.
Moonfire NVR is giving a terrible error message. First of all, hyper is panicking with an error message:
panic!("error binding to {}: {}", addr, e);
and we appear to be swallowing that text. But anyway panics are supposed to be just for bugs, so we should be using try_bind
instead of bind
.
I'm marking this as a usability bug.
Thanks for digging into this! Yes that makes sense. I have a few other docker containers running on here. I'll remap the port. I was planning on digging into the code but you beat me to it 🙂. I'm looking forward to getting this working. This is a really useful project!
Describe the bug Pulling from the latest docker image it looks like i'm stuck in a crash loop. I did the normal setup and test and the test to the rstp url works from both the UI configurator and VLC. However when I start the docker container it seems to crash as soon as it tries to access the url.
To Reproduce Steps to reproduce the behavior:
and gave the moonfire-nvr user ownership of that directory.
./nvr.sh run
and it crashes in a loop.Expected behavior I'm expecting it to connect to the camera.
Screenshots If applicable, add screenshots to help explain your problem.
Server (please complete the following information):
docker ps
+docker images
chris@Workstation:~$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE scottlamb/moonfire-nvr latest bb6a1bc80ab1 4 weeks ago 735MB
I20210802 17:13:02.907 main moonfire_nvr::cmds] Opening /var/lib/moonfire-nvr/db/db in ReadWrite mode with SQLite version 3.31.1 I20210802 17:13:02.910 main moonfire_db::db] Loading video sample entries I20210802 17:13:02.910 main moonfire_db::db] Loaded 0 video sample entries I20210802 17:13:02.910 main moonfire_db::db] Loading sample file dirs I20210802 17:13:02.910 main moonfire_db::db] Loaded 2 sample file dirs I20210802 17:13:02.910 main moonfire_db::db] Loading cameras I20210802 17:13:02.910 main moonfire_db::db] Loaded 1 cameras I20210802 17:13:02.910 main moonfire_db::db] Loading streams I20210802 17:13:02.910 main moonfire_db::db] Loaded 2 streams I20210802 17:13:02.911 main moonfire_db::db] Loading recordings for camera lorex_1 stream Main I20210802 17:13:02.911 main moonfire_db::db] Loaded 0 recordings for camera lorex_1 stream Main I20210802 17:13:02.911 main moonfire_db::db] Loading recordings for camera lorex_1 stream Sub I20210802 17:13:02.911 main moonfire_db::db] Loaded 0 recordings for camera lorex_1 stream Sub I20210802 17:13:02.911 main moonfire_nvr::cmds::run] Database is loaded. I20210802 17:13:03.268 main moonfire_nvr::cmds::run] Directories are opened. I20210802 17:13:03.268 main moonfire_nvr::cmds::run] Resolved timezone: America/Los_Angeles I20210802 17:13:03.268 main moonfire_nvr::cmds::run] Starting syncer for path /mnt/raid/nvr I20210802 17:13:03.270 main moonfire_db::db] Flush 1 (why: synchronous deletion): no recording changes I20210802 17:13:03.270 main moonfire_nvr::cmds::run] Starting streamer for lorex_1-main I20210802 17:13:03.270 main moonfire_nvr::cmds::run] Starting streamer for lorex_1-sub I20210802 17:13:03.270 s-lorex_1-main moonfire_nvr::streamer] lorex_1-main: Opening input: rtsp://192.168.1.115:554/cam/realmonitor?channel=1&subtype=0 I20210802 17:13:03.270 s-lorex_1-sub moonfire_nvr::streamer] lorex_1-sub: Opening input: rtsp://192.168.1.115:554/cam/realmonitor?channel=1&subtype=1 E20210802 17:13:03.331 main moonfire_nvr] panic at '/var/lib/moonfire-nvr/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.7/src/server/server.rs:67:17' Backtrace: 0: failure::backtrace::internal::InternalBacktrace::new at .cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.8/src/backtrace/internal.rs:46:44 1: failure::backtrace::Backtrace::new at .cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.8/src/backtrace/mod.rs:121:35