voidsolutionsorg / ffmpegof

Go script that allows transparent load balancing of ffmpeg and ffprobe commands over SSH a.k.a. FFmpeg over Fabrics
GNU Affero General Public License v3.0
63 stars 5 forks source link

Getting "database is locked (5) (SQLITE_BUSY)" on fresh install #26

Open ppoloskov opened 10 months ago

ppoloskov commented 10 months ago

Kubernetes installation using ghcr.io/aleksasiriski/jellyfin-rffmpeg

When running "ffmpeg -version" from the command line I always get "database is locked (5) (SQLITE_BUSY)".

# Let's do a fresh run and remove databate
jellyfin@jellyfin-78667b8b4d-65g5z:~$ rm -rf  /config/rffmpeg/db/rffmpeg.db 
jellyfin@jellyfin-78667b8b4d-65g5z:~$ ls -lan /config/rffmpeg/db/
drwxrwsr-x 2 1001 1001 4096 Dec  7 00:22 .
drwxrwsr-x 3 1001 1001 4096 Dec  7 00:12 ..

# add host
jellyfin@jellyfin-78667b8b4d-65g5z:~$ rffmpeg add wombat
Dec  7 00:22:49 INF Database in use: sqlite
Dec  7 00:22:49 INF Succesfully added host
jellyfin@jellyfin-78667b8b4d-65g5z:~$ rffmpeg status
Dec  7 00:23:08 INF Database in use: sqlite
Dec  7 00:23:08 INF Outputting status of hosts
Servername  Hostname  ID  Weight  State  Active Commands
wombat      wombat    1   1       idle   N/A

# Run ffmpeg (reduced for brevity)
jellyfin@jellyfin-78667b8b4d-65g5z:~$ ffmpeg -version
Dec  7 00:23:18 INF Database in use: sqlite
Dec  7 00:23:18 INF Starting rffmpeg as ffmpeg with args: -version
Warning: Identity file /config/rffmpeg/.ssh/id_ed25519 not accessible: No such file or directory.
ffmpeg version 6.1 Copyright (c) 2000-2023 the FFmpeg developers
built with FreeBSD clang version 16.0.6 (https://github.com/llvm/llvm-project.git llvmorg-16.0.6-0-g7cbf1a259152)
configuration: .... 
Shared connection to wombat closed.
Dec  7 00:23:18 INF Running command on host wombat
Warning: Identity file /config/rffmpeg/.ssh/id_ed25519 not accessible: No such file or directory.
ffmpeg version 6.1 Copyright (c) 2000-2023 the FFmpeg developers
built with FreeBSD clang version 16.0.6 (https://github.com/llvm/llvm-project.git llvmorg-16.0.6-0-g7cbf1a259152)
configuration: ...
Dec  7 00:23:18 ERR Failed adding process: error="database is locked (5) (SQLITE_BUSY)"
Dec  7 00:23:18 INF Finished rffmpeg successfully
aleksasiriski commented 10 months ago

I don't have the time to maintain this script sadly, I suggest using Postgres to avoid this issue. Anyways, PRs are welcome.

aleksasiriski commented 9 months ago

Maybe there is an option to set the clients number to SQLite to 1 (locking is most likely happening due to multiple go routines using the same db connection). PRs are welcome.