Hello,
I am reporting a recurring issue with Nextcloud Desktop Client on macOS.
The client can appear completely frozen during startup while opening/checking the sync journal SQLite database.
The process is not crashed. It remains alive, but the main thread blocks during account/folder setup while opening the sync journal database.
The issue is reproducible when the local sync folder is on an external volume and the storage has high latency for small random reads. In this state, the tray icon does not appear and the application looks stuck.
Reading the sync journal database sequentially with dd immediately unblocks the client.
Environment:
- Nextcloud Desktop Client: 34.0.4
- OS: macOS 15.8.1
- Local sync folder: /Volumes/Nextcloud
- Sync journal database: /Volumes/Nextcloud/.sync_2f4a44904d04.db
- Storage: external USB DAS / QNAP TR-004
- Filesystem currently tested: HFS+ Journaled
- The same general pattern was also observed previously before migrating the volume from APFS to HFS+.
- FinderSyncBroker process is present but not blocked. The blocked process is the main Nextcloud application.
Observed behavior:
On startup, the main Nextcloud process remains in state U.
Example:
/Applications/Nextcloud.app/Contents/MacOS/Nextcloud U
The FinderSyncBroker process remains normal/sleeping, so this does not appear to be a Finder extension issue.
sample output:
A 5 second sample of the main Nextcloud process shows the main thread blocked in:
OCC::Application::setupAccountsAndFolders
OCC::FolderMan::setupFolders
OCC::Folder::startVfs
OCC::SyncJournalDb::open
OCC::SyncJournalDb::checkConnect
OCC::SqlDatabase::openOrCreateReadWrite
OCC::SqlDatabase::checkDb
OCC::SqlQuery::next
sqlite3_step
pread
In one sample, almost all collected samples were in pread:
4390 samples total
4389 in pread
This has now been observed with multiple client versions, including:
34.0.1
34.0.3
34.0.4
fs_usage evidence:
Running:
sudo fs_usage -w -f filesys -t 10 <nextcloud_pid>
shows repeated 4 KiB reads against the sync journal database:
RdData[A] B=0x1000 /dev/disk4s2 /Volumes/Nextcloud/.sync_2f4a44904d04.db
pread F=16 B=0x1000 O=…
B=0x1000 means 4096 bytes.
Some observed latencies for single 4 KiB reads:
0.147 s
0.227 s
0.293 s
0.235 s
So the apparent freeze is not one single permanently blocked syscall, but many small SQLite page reads accumulating into a very long startup delay.
Workaround:
While the Nextcloud client is stuck, running:
dd if=/Volumes/Nextcloud/.sync_2f4a44904d04.db of=/dev/null bs=4m
causes the client to finish startup immediately.
This has happened repeatedly. After the sequential read, the client continues startup right away.
This suggests that sequentially warming the OS page cache for the sync journal database allows the SQLite reads to complete quickly.
Expected behavior:
The desktop client should not appear dead during startup while checking/opening the sync journal database.
Possible improvements could include one or more of:
- avoid doing this blocking database check on the main thread;
- show a visible startup/progress state while the sync journal is being opened;
- avoid or reduce the expensive startup access pattern;
- detect unusually slow sync journal reads and log a clear diagnostic message;
- consider a more sequential/cache-friendly startup path for the journal check;
- avoid leaving the user with no tray icon and no feedback while the journal is being checked.
Actual behavior:
The UI/tray startup appears frozen until the SQLite journal reads complete.
On slow small random reads, this can take long enough that the application looks hung. The user has no useful indication of what is happening.
Additional context:
This is especially visible when the local sync folder is on an external disk and another process, such as a backup task, has recently stressed the same volume.
However, the core pattern is consistent:
Nextcloud startup
- SyncJournalDb::open
- SqlDatabase::checkDb
- sqlite3_step
- many 4 KiB pread calls
- very slow startup / apparent freeze
The database does not appear corrupt. Manual SQLite queries can complete, and warming the database file with a sequential read immediately allows the client to continue.
The issue seems less like “SQLite is broken” and more like the client startup path is vulnerable to slow small random reads from the sync journal database, while the main thread gives no feedback and the application looks dead.