Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

moonfire-nvr.toml file "dbDir" is not working #319

Open
issueser opened this issue Jun 16, 2024 · 3 comments
Open

moonfire-nvr.toml file "dbDir" is not working #319

issueser opened this issue Jun 16, 2024 · 3 comments
Labels
support Support requests

Comments

@issueser
Copy link

issueser commented Jun 16, 2024

Describe the bug
moonfire-nvr.toml file "dbDir" is not working

To Reproduce
1.Edit "/etc/moonfire-nvr.toml" according to the description in "config.md", first line is [dbDir = "/mnt/data/nvr/db"]
2.sudo -u moonfire-nvr moonfire-nvr config
2024-06-16T10:42:12.874057 ERROR main moonfire_nvr: exiting due to error err=NOT_FOUND: db dir /var/lib/moonfire-nvr/db not found; try running moonfire-nvr init
3.run command [sudo -u moonfire-nvr moonfire-nvr init] result:
2024-06-16T10:57:29.790579 INFO main moonfire_nvr::cmds: Opening /var/lib/moonfire-nvr/db/db in Create mode with SQLite version 3.44.0
2024-06-16T10:57:29.903563 INFO main moonfire_nvr::cmds::init: Database initialized.

Expected behavior
SQLite dir : /mnt/data/nvr/db
false "/var/lib/moonfire-nvr/db/db" x
true "/mnt/data/nvr/db/db" √

Screenshots
Not to that point

Server (please complete the following information):
sudo -u moonfire-nvr moonfire-nvr --version
Version: v0.7.16
filename: moonfire-nvr-v0.7.16-aarch64
OS:armbian

Camera (please complete the following information):
Not to that point

Desktop (please complete the following information):
Chromium 102.0.5005.167

Smartphone (please complete the following information):
Not to that point

Additional context
Sorry, I'm viewing the document through translation read. For "At the top level, before any [[bind]] lines, the following keys are understood", I understand it as the first line setting, or setting before pasting

[[binds]]
ipv4 = "0.0.0.0:8080"
allowUnauthenticatedPermissions = { viewVideo = true }

[[binds]]
unix = "/var/lib/moonfire-nvr/sock"
ownUidIsPrivileged = true

Is my understanding wrong?
Searching for "repo:scottlamb/moonfire-nvr dbDir" found that "dbDir" keyword is only mentioned in ref/config.md, or the documentation is missing updates? Please help me look into it, thank you.

( Manually copying db files after executing SQL init is also not available

@issueser
Copy link
Author

Sorry, I don't know why there was a problem with the layout

@scottlamb
Copy link
Owner

scottlamb commented Jun 16, 2024

first line is [dbDir = "/mnt/data/nvr/db"]

I think you just have to remove the [ and ], and it should work.

Sorry, I don't know why there was a problem with the layout

For some reason all the blank lines had a U+FEFF (zero width non-breaking space, aka byte order mark, mentioned in e.g. this article) in them. I edited your comment to remove those and switched from ================ to ``` around the config snippet at the bottom, and it looks a bit better now.

@scottlamb scottlamb added the support Support requests label Jun 16, 2024
@issueser
Copy link
Author

thank for you edited.
first line:dbDir = "/mnt/data/nvr/db" , [ and ] The original intention was to use it as a boundary.
full "/etc/moonfire-nvr.toml":

dbDir = "/mnt/data/alist/nvr/db"

[[binds]]
ipv4 = "0.0.0.0:8080"
allowUnauthenticatedPermissions = { viewVideo = true }

[[binds]]
unix = "/var/lib/moonfire-nvr/sock"
ownUidIsPrivileged = true

I tried again but it still didn't work.
init and config Still using /var/lib/moonfire-nvr/db/db.
INFO main moonfire_nvr::cmds: Opening /var/lib/moonfire-nvr/db/db in ReadWrite mode with SQLite version 3.44.0

# sudo -u moonfire-nvr moonfire-nvr config
2024-06-17T04:58:57.988461  INFO main moonfire_nvr::cmds: Opening /var/lib/moonfire-nvr/db/db in ReadWrite mode with SQLite version 3.44.0
2024-06-17T04:58:58.048116  INFO main moonfire_db::db: Loading video sample entries
2024-06-17T04:58:58.049107  INFO main moonfire_db::db: Loaded 0 video sample entries
2024-06-17T04:58:58.049209  INFO main moonfire_db::db: Loading sample file dirs
2024-06-17T04:58:58.049568  INFO main moonfire_db::db: Loaded 0 sample file dirs
2024-06-17T04:58:58.049676  INFO main moonfire_db::db: Loading cameras
2024-06-17T04:58:58.051311  INFO main moonfire_db::db: Loaded 0 cameras
2024-06-17T04:58:58.051410  INFO main moonfire_db::db: Loading streams
2024-06-17T04:58:58.051785  INFO main moonfire_db::db: Loaded 0 streams
2024-06-17T04:59:01.743079  INFO main flush{flush_count=0 reason="drop"}: moonfire_db::db: flush complete:  no recording changes

(After entering the configuration interface, I proactively terminated it.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Support requests
Projects
None yet
Development

No branches or pull requests

2 participants