frigate: Can't start docker container: disk I/O error
Describe the bug A clear and concise description of what your issue is.
* Starting nginx nginx
...done.
Starting migrations
peewee_migrate INFO : Starting migrations
peewee DEBUG : ('CREATE TABLE IF NOT EXISTS "migratehistory" ("id" INTEGER NOT NULL PRIMARY KEY, "name" VARCHAR(255) NOT NULL, "migrated_at" DATETIME NOT NULL)', [])
disk I/O error
** docker script **
docker run -d \
--privileged \
--name frigate \
--restart=unless-stopped \
--mount type=tmpfs,target=/tmp/cache,tmpfs-size=1000000000 \
-v $CONF/media:/media/frigate \
-v $CONF/config:/config \
-v /etc/localtime:/etc/localtime:ro \
-e FRIGATE_RTSP_PASSWORD='password' \
-p 5000:5000 \
-p 1935:1935 \
blakeblackshear/frigate:stable-amd64
Version of frigate
Output from /api/version
blakeblackshear/frigate:stable-amd64
Config file Include your full config file wrapped in triple back ticks.
logger:
default: debug
detectors:
cpu1:
type: cpu
cpu2:
type: cpu
mqtt:
host: duboce
cameras:
back:
ffmpeg:
inputs:
- path: rtsp://viewer:{FRIGATE_RTSP_PASSWORD}@10.0.10.10:554/cam/realmonitor?channel=1&subtype=2
roles:
- detect
- rtmp
width: 1280
height: 720
fps: 5
Frigate container logs
Include relevant log output here
Frigate stats
Output from frigate's /api/stats endpoint
FFprobe from your camera
Run the following command and paste output below
ffprobe <stream_url>
Screenshots If applicable, add screenshots to help explain your problem.
Computer Hardware
- OS: MacOs
- Install method: Docker Command
- Virtualization:Virtualbox
- Coral Version: None
- Network Setup: Wifi
Additional context Add any other context about the problem here.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 2
- Comments: 19 (4 by maintainers)
The folders are writable (as you can see) as there are some files in it.
I have ran into the same issue after I moved all Frigate data from the super-constrained storage of the VM where it runs, to my storage array thats accessible through a virtiofs mount.
It seems the problem is that sqlite does not like when you want to use a WAL-mode database through network, or such virtual filesystems: https://sqlite.org/forum/forumpost/6a0e396a2b8aa8e56001ddc1c618b90bee37465b7f47dc978f456b71d9525949 I havent found whats the reason for it, maybe its that virtiofs does not provide full support for file locking (1, 2), but thats not important.
Whats important is that such databases must stay local, meaning inside the VM/original system, and not be used through a network or virtiofs mount. As the above forum post suggests, Jellyfin docs also mention at the very beginning that the database file must stay local.
@blakeblackshear considering the traffic under this issue, would you please consider to mention this limitation of the database file somewhere here? It may be useful to have the database path override config option be mentioned too.
Finally, my solution was to keep the volume that stores
/configstay in the VM. It does not take that much space anyway. Just dont forget when making backups that not everything is stored on your main storage array…I am having the same issue when using a
9pvirtio filesystem in a VM (underlying filesystem being shared is BTRFS). Directory is fully writable, and every file is 777 permissions (for testing) but still no. I’ve used frigate in the past on the same exact underlying filesystem and directory, with a bind mount to LXC container (using proxmox).By creating a new directory on the 9p filesystem and using that one instead, frigate will work exactly once for a little bit longer with the below error, then after a reboot of the container or VM leads to the same error again.