7
33
Fork
You've already forked sentryshot
7

Restarting the docker container loses some logs #90

Open
opened 2025年09月18日 15:50:44 +02:00 by timtjtim · 10 comments

Before restarting the docker container, I could see these logs:

[DEBUG] 2025年09月18日_14:33:01 recdb: 24.8% disk usage
[DEBUG] 2025年09月18日_14:23:01 recdb: 24.7% disk usage
[DEBUG] 2025年09月18日_14:13:01 recdb: 24.6% disk usage
[DEBUG] 2025年09月18日_14:03:00 recdb: 24.4% disk usage
[DEBUG] 2025年09月18日_13:53:00 recdb: 24.3% disk usage

after restart (docker compose restart) at 14:37, the timestamps jump from 13:53 to 14:37

[INFO] 2025年09月18日_14:37:48 monitor: Alleyway: starting
[INFO] 2025年09月18日_14:37:48 app: Serving app on port 2020
[DEBUG] 2025年09月18日_14:37:48 app: TZ=Europe/London
[INFO] 2025年09月18日_14:37:46 app: loading plugin motion
[INFO] 2025年09月18日_14:37:46 app: loading plugin auth_none
 (jumps here)
[DEBUG] 2025年09月18日_13:53:00 recdb: 24.3% disk usage
[DEBUG] 2025年09月18日_13:52:11 motion: Front: detection: zone:0 score:3.01
[DEBUG] 2025年09月18日_13:52:03 motion: Front: detection: zone:0 score:3.00
[DEBUG] 2025年09月18日_13:51:55 motion: Front: detection: zone:0 score:3.07

and those logs above are no longer shown

files:

# ls -lh /mnt/video/sentryshot/logs/
total 91K
-rwxrwx--- 1 root 1001 79K Sep 17 10:11 17580.data
-rwxrwx--- 1 root 1001 98K Sep 17 10:11 17580.msg
-rwxrwx--- 1 root 1001 119K Sep 18 13:53 17581.data
-rwxrwx--- 1 root 1001 77K Sep 18 13:53 17581.msg
-rwxrwx--- 1 root 1001 1 Sep 18 13:53 17582.data
-rwxrwx--- 1 root 1001 0 Sep 18 13:53 17582.msg

looks like 13:53 is the last time it flushed the logs to disk?

Before restarting the docker container, I could see these logs: ``` [DEBUG] 2025年09月18日_14:33:01 recdb: 24.8% disk usage [DEBUG] 2025年09月18日_14:23:01 recdb: 24.7% disk usage [DEBUG] 2025年09月18日_14:13:01 recdb: 24.6% disk usage [DEBUG] 2025年09月18日_14:03:00 recdb: 24.4% disk usage [DEBUG] 2025年09月18日_13:53:00 recdb: 24.3% disk usage ``` after restart (`docker compose restart`) at 14:37, the timestamps jump from 13:53 to 14:37 ``` [INFO] 2025年09月18日_14:37:48 monitor: Alleyway: starting [INFO] 2025年09月18日_14:37:48 app: Serving app on port 2020 [DEBUG] 2025年09月18日_14:37:48 app: TZ=Europe/London [INFO] 2025年09月18日_14:37:46 app: loading plugin motion [INFO] 2025年09月18日_14:37:46 app: loading plugin auth_none (jumps here) [DEBUG] 2025年09月18日_13:53:00 recdb: 24.3% disk usage [DEBUG] 2025年09月18日_13:52:11 motion: Front: detection: zone:0 score:3.01 [DEBUG] 2025年09月18日_13:52:03 motion: Front: detection: zone:0 score:3.00 [DEBUG] 2025年09月18日_13:51:55 motion: Front: detection: zone:0 score:3.07 ``` and those logs above are no longer shown files: ``` # ls -lh /mnt/video/sentryshot/logs/ total 91K -rwxrwx--- 1 root 1001 79K Sep 17 10:11 17580.data -rwxrwx--- 1 root 1001 98K Sep 17 10:11 17580.msg -rwxrwx--- 1 root 1001 119K Sep 18 13:53 17581.data -rwxrwx--- 1 root 1001 77K Sep 18 13:53 17581.msg -rwxrwx--- 1 root 1001 1 Sep 18 13:53 17582.data -rwxrwx--- 1 root 1001 0 Sep 18 13:53 17582.msg ``` looks like 13:53 is the last time it flushed the logs to disk?
Owner
Copy link

Does it print received terminate, stopping.. to stderr?

Try docker stop --signal SIGINT https://docs.docker.com/reference/cli/docker/container/stop/

Does it print `received terminate, stopping..` to stderr? Try `docker stop --signal SIGINT` https://docs.docker.com/reference/cli/docker/container/stop/

No - neither with docker stop --signal SIGINT or docker compose restart do I see that - at least not in the logs when connected via docker compose up. This might not include all messages though - I have debug_log_stdout = false

All I get is a jump to the docker message that the container is exiting

sentryshot-1 | [INFO] alleyway: Monitor: recorder: starting recording: 2025年09月18日_16-39-27_alleyway
sentryshot-1 exited with code 137

And with docker stop --signal SIGINT I still see a jump in the logs. Stopped at 17:50:

# ls -lh /mnt/video/sentryshot/logs/
total 151K
-rwxrwx--- 1 root 1001 79K Sep 17 10:11 17580.data
-rwxrwx--- 1 root 1001 98K Sep 17 10:11 17580.msg
-rwxrwx--- 1 root 1001 119K Sep 18 13:53 17581.data
-rwxrwx--- 1 root 1001 77K Sep 18 13:53 17581.msg
-rwxrwx--- 1 root 1001 142K Sep 18 17:14 17582.data
-rwxrwx--- 1 root 1001 91K Sep 18 17:14 17582.msg
[DEBUG] 2025年09月18日_17:50:14 app: TZ=Europe/London
[INFO] 2025年09月18日_17:50:13 app: loading plugin motion
[INFO] 2025年09月18日_17:50:13 app: loading plugin auth_none
(jump)
[DEBUG] 2025年09月18日_17:14:15 motion: Front: detection: zone:0 score:6.05
[DEBUG] 2025年09月18日_17:14:11 motion: Front: detection: zone:0 score:6.06
[DEBUG] 2025年09月18日_17:14:07 motion: Front: detection: zone:0 score:6.02
No - neither with `docker stop --signal SIGINT` or `docker compose restart` do I see that - at least not in the logs when connected via `docker compose up`. This might not include all messages though - I have `debug_log_stdout = false` All I get is a jump to the docker message that the container is exiting ``` sentryshot-1 | [INFO] alleyway: Monitor: recorder: starting recording: 2025年09月18日_16-39-27_alleyway sentryshot-1 exited with code 137 ``` And with `docker stop --signal SIGINT` I still see a jump in the logs. Stopped at 17:50: ``` # ls -lh /mnt/video/sentryshot/logs/ total 151K -rwxrwx--- 1 root 1001 79K Sep 17 10:11 17580.data -rwxrwx--- 1 root 1001 98K Sep 17 10:11 17580.msg -rwxrwx--- 1 root 1001 119K Sep 18 13:53 17581.data -rwxrwx--- 1 root 1001 77K Sep 18 13:53 17581.msg -rwxrwx--- 1 root 1001 142K Sep 18 17:14 17582.data -rwxrwx--- 1 root 1001 91K Sep 18 17:14 17582.msg ``` ``` [DEBUG] 2025年09月18日_17:50:14 app: TZ=Europe/London [INFO] 2025年09月18日_17:50:13 app: loading plugin motion [INFO] 2025年09月18日_17:50:13 app: loading plugin auth_none (jump) [DEBUG] 2025年09月18日_17:14:15 motion: Front: detection: zone:0 score:6.05 [DEBUG] 2025年09月18日_17:14:11 motion: Front: detection: zone:0 score:6.06 [DEBUG] 2025年09月18日_17:14:07 motion: Front: detection: zone:0 score:6.02 ```

nothing in the docker terminal for either mode of stopping. Don't know if this include stderr at all though...

restart:

sentryshot-1 | [DEBUG] front: Motion: detection: zone:0 score:17.35
sentryshot-1 | [DEBUG] front: Motion: detection: zone:0 score:5.84
sentryshot-1 | [DEBUG] front: Motion: detection: zone:0 score:4.83
sentryshot-1 | [DEBUG] front: Motion: detection: zone:0 score:4.28
sentryshot-1 | [DEBUG] front: Motion: detection: zone:0 score:3.59
sentryshot-1 exited with code 137 (restarting)
sentryshot-1 | [INFO] App: loading plugin auth_none
sentryshot-1 | [INFO] App: loading plugin motion
sentryshot-1 | [DEBUG] App: TZ=Europe/London
sentryshot-1 | [INFO] App: Serving app on port 2020
sentryshot-1 | [INFO] front: Monitor: starting
sentryshot-1 | [DEBUG] front: Monitor: no sub stream
sentryshot-1 | [DEBUG] front: Monitor: recorder: alwaysRecord=true

stop:

sentryshot-1 | [DEBUG] front: Motion: detection: zone:0 score:5.00
sentryshot-1 | [DEBUG] front: Motion: detection: zone:0 score:4.28
sentryshot-1 exited with code 137
nothing in the docker terminal for either mode of stopping. Don't know if this include stderr at all though... restart: ``` sentryshot-1 | [DEBUG] front: Motion: detection: zone:0 score:17.35 sentryshot-1 | [DEBUG] front: Motion: detection: zone:0 score:5.84 sentryshot-1 | [DEBUG] front: Motion: detection: zone:0 score:4.83 sentryshot-1 | [DEBUG] front: Motion: detection: zone:0 score:4.28 sentryshot-1 | [DEBUG] front: Motion: detection: zone:0 score:3.59 sentryshot-1 exited with code 137 (restarting) sentryshot-1 | [INFO] App: loading plugin auth_none sentryshot-1 | [INFO] App: loading plugin motion sentryshot-1 | [DEBUG] App: TZ=Europe/London sentryshot-1 | [INFO] App: Serving app on port 2020 sentryshot-1 | [INFO] front: Monitor: starting sentryshot-1 | [DEBUG] front: Monitor: no sub stream sentryshot-1 | [DEBUG] front: Monitor: recorder: alwaysRecord=true ``` stop: ``` sentryshot-1 | [DEBUG] front: Motion: detection: zone:0 score:5.00 sentryshot-1 | [DEBUG] front: Motion: detection: zone:0 score:4.28 sentryshot-1 exited with code 137 ```

and nothing in the output with docker logs sentryshot-sentryshot-1 -f which I gather does include stderr. https://stackoverflow.com/a/56975147

and nothing in the output with `docker logs sentryshot-sentryshot-1 -f` which I gather does include stderr. https://stackoverflow.com/a/56975147
Owner
Copy link

So.. the "shell" form creates a shell and doesn't propagate the signal... https://docs.docker.com/reference/dockerfile/#shell-and-exec-form

--- a/misc/Dockerfile
+++ b/misc/Dockerfile
@@ -15,4 +15,4 @@ COPY libusb/aarch64-linux-gnu/libusb-1.0.so.0 /usr/lib/aarch64-linux-gnu/
 # common steps
 FROM build-${TARGETARCH} AS build
 WORKDIR /app
-ENTRYPOINT /app/sentryshot run --config /app/configs/sentryshot.toml
+ENTRYPOINT ["/app/sentryshot", "run", "--config", "/app/configs/sentryshot.toml"]

So.. the "shell" form creates a shell and doesn't propagate the signal... https://docs.docker.com/reference/dockerfile/#shell-and-exec-form ``` diff --- a/misc/Dockerfile +++ b/misc/Dockerfile @@ -15,4 +15,4 @@ COPY libusb/aarch64-linux-gnu/libusb-1.0.so.0 /usr/lib/aarch64-linux-gnu/ # common steps FROM build-${TARGETARCH} AS build WORKDIR /app -ENTRYPOINT /app/sentryshot run --config /app/configs/sentryshot.toml +ENTRYPOINT ["/app/sentryshot", "run", "--config", "/app/configs/sentryshot.toml"] ```

Welp, that's annoying! Thanks!

And aside, thanks for this project. I had ended up trying out about 15 different NVRs and all of them sucked in various ways. This one actually meets most my needs without adding a whole load of nonsense to it :)

Welp, that's annoying! Thanks! And aside, thanks for this project. I had ended up trying out about 15 different NVRs and all of them sucked in various ways. This one actually meets most my needs without adding a whole load of nonsense to it :)
timtjtim changed title from (削除) Restarting the docker container looses some logs (削除ここまで) to Restarting the docker container loses some logs 2025年09月19日 18:56:27 +02:00
Owner
Copy link

Is there anything else you want besides audio?

Is there anything else you want besides audio?

Audio is probably top of the wish list. I was also thinking about looking into adding a timeline plugin to show the videos rather than having to jump between 15 minute clips.

It’s been a while since I did any open source work, so I’m very happy to contribute in any way I can 🙂

Audio is probably top of the wish list. I was also thinking about looking into adding a timeline plugin to show the videos rather than having to jump between 15 minute clips. It’s been a while since I did any open source work, so I’m very happy to contribute in any way I can 🙂
Owner
Copy link

A timeline plugin is planned, but we first need to redesign the recording database to store both the main and sub stream.

A timeline plugin is planned, but we first need to redesign the recording database to store both the main and sub stream.
Owner
Copy link
https://codeberg.org/SentryShot/sentryshot/releases/tag/v0.3.7
Sign in to join this conversation.
No Branch/Tag specified
master
sub_rec
recdb_v2
vino
sidebar
temp
range-streamer
logdb
v0.3.11
v0.3.10
v0.3.9
v0.3.8
v0.3.7
v0.3.6
v0.3.5
v0.3.4
v0.3.3
v0.3.2
v0.3.1
v0.3.0
v0.2.26
v0.2.25
v0.2.24
v0.2.23
v0.2.22
v0.2.21
v0.2.20
v0.2.19
v0.2.18
v0.2.17
v0.2.16
v0.2.15
v0.2.14
v0.2.13
v0.2.12
v0.2.11
v0.2.10
v0.2.9
v0.2.8
v0.2.7
v0.2.6
v0.2.5
v0.2.4
v0.2.3
v0.2.2
v0.2.1
v0.2.0
v0.1.3
v0.1.2
v0.1.1
v0.1.0
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
SentryShot/sentryshot#90
Reference in a new issue
SentryShot/sentryshot
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?