owncloud / client

🖥️ Desktop Syncing Client for ownCloud
GNU General Public License v2.0
1.4k stars 663 forks source link

[Linux] "Failed to open the database" randomly appears and permanently stops folder sync #11826

Closed ShadyMedic closed 1 month ago

ShadyMedic commented 2 months ago

Pre-submission Checks

Describe the bug

I use ownCloud client on my Linux Mint 21.3 (base: Ubuntu 22.04). It worked fine for like a year or so. Some time last month, three of my shared folders showed an error "/path/to/directory/ failed to open the database." and stopped syncing.

I waited for about two weeks, hoping that the error will somehow resolve itself, but it didn't. I had remove the folder sync link, delete the .owncloudsync.log, .sync_journal.db, .sync_journal.db-shm and .sync_journal.db-wal files and then create the folder sync link again.

The client worked fine again for another week or so, but yesterday, I got the same error again and all my linked directories this time (see picture).

I can easily just delete the four files again and recreate the links, but doing it multiple times every month is kinda annoying and also it probably wouldn't work well if I start modifying the files on other of my devices and thus creating conflicts.

Expected behavior

I expect this error to not appear randomly and the folders to keep syncing.

Steps to reproduce the issue

I know you hate to hear this, but this error seems to appear totally randomly. I'm not aware of any extraordinary processes that I was doing prior to the issue appearing.

Screenshots

image

Logs

See attachment: log-redacted.txt

Client version number

ownCloud 5.3.1.14018 f15fd5 Libraries Qt 6.4.3, OpenSSL 3.1.2 1 Aug 2023 Using virtual files plugin: suffix OS: linuxmint-5.15.0-119-generic QPA: xcb

Desktop environment (Linux only)

Linux Mint 21.3 Virginia base: Ubuntu 22.04 jammy; Desktop: Xfce 4.18.1

Client package version and origin (Linux only)

Installed using instructions on https://download.owncloud.com/desktop/ownCloud/stable/latest/linux/download/

Installation path (Windows only)

No response

Server information

No idea, my organization is managing the server, not me.

Additional context

No response

TheOneRing commented 2 months ago

Do the links point to an external drive that is mounted during login? Or removed from time to time?

ShadyMedic commented 2 months ago

They point to folders in my /home/ partition, which is different from my root partition, but is also being mounted during boot.

TheOneRing commented 2 months ago

Does the client recover if you restart it? If yes, its related to the way the other disk is loaded during startup, if not we need to check why the db can't be opened.


24-08-25 16:41:23:799 [ warning sync.database.sql ]:    Consistency check failed in readonly mode, giving up "/home/shady/.minecraft/.sync_journal.db"
24-08-25 16:41:23:799 [ info sync.plugins ]:    Created VFS instance from plugin "owncloudsync_vfs_off"
24-08-25 16:41:23:800 [ debug gui.folder ]  [ OCC::Folder::checkLocalPath ]:    Checked local path ok
24-08-25 16:41:23:800 [ debug sync.database.sql ]   [ OCC::SqlQuery::prepare ]: SQL prepare "PRAGMA quick_check;" Try: 0
24-08-25 16:41:23:800 [ warning sync.database.sql ]:    SQL prepare failed "PRAGMA quick_check;" "unable to open database file"
24-08-25 16:41:23:800 [ warning sync.database.sql ]:    Sqlite prepare statement error: 14 "unable to open database file" in "PRAGMA quick_check;"
24-08-25 16:41:23:800 [ warning sync.database.sql ]:    Error preparing quick_check on database
24-08-25 16:41:23:800 [ warning sync.database ]:    Error opening the db: "unable to open database file"
24-08-25 16:41:23:800 [ warning gui.folder ]:   "/home/shady/.minecraft/ failed to open the database."
24-08-25 16:41:23:800 [ info gui.folder.manager ]:  Adding folder to Folder Map  OCC::Folder(0x1fb5140) "/home/shady/.minecraft/"
TheOneRing commented 2 months ago

Are you able to open the db with https://sqlitebrowser.org/ ?

ShadyMedic commented 2 months ago

Does the client recover if you restart it?

I already deleted the hidden files again and re-created the links, so I can't check right now, but I think I tried this in the past and it didn't solve the issue.

Are you able to open the db with https://sqlitebrowser.org/ ?

Yes, the .sync_journal.db file opens just fine and I can browse all the tables (most of them are empty though).

TheOneRing commented 2 months ago

Please try to restart the client, when the issue occurs again.

ShadyMedic commented 2 months ago

Will do. I'll respond here when that happens. I'll also look at the DB file permissions at that point and let you know.

Bye for now. (hopefully for a long time :smiley: )

github-actions[bot] commented 1 month ago

This issue was marked stale because it has been open for 30 days with no activity. Remove the stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 1 month ago

The issue was marked as stale for 7 days and closed automatically.