address `SQLITE_IOERR_GETTEMPPATH` from docker

This commit is contained in:
Scott Lamb 2023-12-29 16:23:38 -08:00
parent cca430b701
commit 2da459dae2
2 changed files with 22 additions and 0 deletions

View File

@ -58,6 +58,12 @@ services:
# Docker will "helpfully" create a directory by this name otherwise.
- "/etc/moonfire-nvr.toml:/etc/moonfire-nvr.toml:ro"
# Pass through `/var/tmp` from the host.
# SQLite expects to be able to create temporary files in this dir, which
# is not created in Moonfire's minimal Docker image.
# See: <https://www.sqlite.org/tempfiles.html>
- "/var/tmp:/var/tmp"
# Add additional mount lines here for each sample file directory
# outside of /var/lib/moonfire-nvr, e.g.:
# - "/media/nvr:/media/nvr"

View File

@ -228,6 +228,22 @@ clock_gettime failed: EPERM: Operation not permitted
This indicates a broken environment. See the troubleshooting guide.
```
#### `VFS is unable to determine a suitable directory for temporary files`
Moonfire NVR's database internally uses SQLite, which creates
[various temporary files](https://www.sqlite.org/tempfiles.html). If it can't
find a path that exists and is writable by the current user, it will produce
errors such as the following:
```
2023-12-29T16:16:47.795330 WARN sync-1 syncer{path=/media/nvr/sample}: moonfire_db::writer: flush failure on save for reason 120 sec after start of 59 seconds driveway-sub recording 10/1222348; will retry after PT60S: UNAVAILABLE
caused by: disk I/O error
caused by: Error code 6410: VFS is unable to determine a suitable directory for temporary files
```
The simplest solution is to pass `/var/tmp` through from the host to the Docker
container in your Docker compose file.
### Server errors
#### `Error: pts not monotonically increasing; got 26615520 then 26539470`