gerbera / gerbera

UPnP Media Server for 2024: Stream your digital media through your home network and consume it on all kinds of UPnP supporting devices 📱💻📺
https://gerbera.io
Other
1.2k stars 213 forks source link

Lost database #3222

Open DJ-Key opened 2 months ago

DJ-Key commented 2 months ago

Describe the bug I assume the Bug is cause by the proxmox backup. I have mounted my NAS NFS share to /media/NAS. Every day my proxmox makes a backup at 1am when I want to watch a movie on the dlna server at 9am the entire database is empty. After a restart of the vm and a rescan(3-5h) all works fine I'm using sqlite.

Expected behavior It should not lose the connection to the database/loose the content.

Server (please complete the following information):

KarlStraussberger commented 2 months ago

Sqlite is not meant for mutual access. Whatever your backup does, it breaks the file which is beyond our reach.

There are two options to avoid this problem

DJ-Key commented 2 months ago

The proxmox backup creates a snapshot of the running vm hard drive.

udippel commented 2 months ago

(Read this as a comment to the topic in general, as in seizing the opportunity:) Despite of the backup database gerbera.db.backup, some of us had problems due to a loss of database, requiring a start from scratch. It would look a great enhancement, if the user could do a controlled backup, before specific changes, tests, whatnot. Combined with a roll-back option as counterpart, some hassle could be easily prevented.

There is always the work-around, with shutdown, cp, startup, shutdown, cp/rm ... . Though a controlled stop of the database for a backup could be a step ahead. My experience playing with this is mixed: debug shows the database being in use in principle constantly, even without any active user interaction.

@KarlStraussberger: Knowing the details, are you sure that throwing in a *backup file (I guess in between stop-start) will always result in a functional system? Even if, AFAIK, I cannot initiate a backup at a moment of time under my control as of now.?

DJ-Key commented 2 months ago

syslog.txt

KarlStraussberger commented 2 months ago

The proxmox backup creates a snapshot of the running vm hard drive.

So you should go for option 1. Somehow the backup seems to interfere with the open database file. Using the backup can save you from the full rescan.

KarlStraussberger commented 2 months ago

syslog.txt

What am I supposed to look for. One server message because of failing upnp init was interesting.