zadam / trilium

Build your personal knowledge base with Trilium Notes
GNU Affero General Public License v3.0
27.37k stars 1.92k forks source link

(Bug report) #3925

Closed YouDontCare closed 1 year ago

YouDontCare commented 1 year ago

Trilium Version

0.59.4

What operating system are you using?

Other Linux

What is your setup?

Local + server sync

Operating System Version

EndeavourOS (Linux Kernel 6.3.1-arch2-1; KDE Plasma Desktop)

Description

It was working for some time, but last night as I was updating some notes on my laptop (my desktop PC is my homeserver), I noticed that the little symbol representing sync status was stuck in a spinning loop, which was odd. But I couldn't be fucked to troubleshoot cuz it was late, so I went to sleep.

Today when I went to check -- Indeed, the notes hadn't been updated on the server. No big deal, they weren't anything TOO important, but also at the same time, >what. So I went to check. And saw a few... Things I do not have the knowledge to understand, but which look like either errors to be reported, or misconfigurations that I need to address (and need help to do so due to my own incompetency--)

For one thing, the terminal log for the server keeps pushing these:

Slow 204 PUT /api/sync/update?logMarkerId=MZdCQy3off with 0 bytes took 14ms
Slow 204 PUT /api/sync/update?logMarkerId=Sp0qte24il with 0 bytes took 36ms
Slow 204 PUT /api/sync/update?logMarkerId=zhjVDPbnty with 0 bytes took 19ms
Slow 204 PUT /api/sync/update?logMarkerId=hjG9UcEgXF with 0 bytes took 19ms
Slow 204 PUT /api/sync/update?logMarkerId=Gy95ecVObe with 0 bytes took 25ms
Slow 204 PUT /api/sync/update?logMarkerId=TWubqTv1Hg with 0 bytes took 30ms
Slow 204 PUT /api/sync/update?logMarkerId=eKjyL9U643 with 0 bytes took 36ms
Slow 204 PUT /api/sync/update?logMarkerId=Xe8cGB2lmn with 0 bytes took 26ms
Slow 204 PUT /api/sync/update?logMarkerId=a8Bd2pJUYu with 0 bytes took 28ms
Slow 204 PUT /api/sync/update?logMarkerId=yXzSYLWtEj with 0 bytes took 20ms
Slow 204 PUT /api/sync/update?logMarkerId=SYsKEHmWoX with 0 bytes took 27ms

Just nonstop. 0 bytes seems. Odd? Also how it just keeps vomiting these messages with varying hashes.

Secondly, the terminal log for the desktop app, is also pushing these constant messages:

Sending message to all clients: {"type":"sync-push-in-progress","lastSyncedPush":511096790}
Sync jFpuKDEeDB: Pushing 841 sync changes in 139ms
Sending message to all clients: {"type":"sync-push-in-progress","lastSyncedPush":511097631}
Sync DvkNiskyXI: Pushing 841 sync changes in 118ms
Sending message to all clients: {"type":"sync-push-in-progress","lastSyncedPush":511098472}
Sync FNL8F1m6fb: Pushing 841 sync changes in 123ms

Like it is stuck in a loop, it repeats nonstop.

On the desktop application itself, sometimes when I write new stuff, it'll display an error saying. Not always, sometimes.

 500 PUT /api/notes/[This part Varies]
Database is Locked

Once again, any alteration to notes, no matter on which machine they are made, are not synched. And the icon for synchronisation status, just keeps spinning and spinning and spinning. The clients all claim they can handshake with the server just fine.

What troubleshooting steps I tried:

What troubleshooting steps I didn't try:

Error logs

No response

sigaloid commented 1 year ago

That enormous number of sync changes (511 million seems excessive) seems like there's a bug with the server and client that makes neither acknowledge the sync, so it keeps on sending changes back and forth.

I would simply export your whole database (will not include protected notes!) and reset both ends. Start from a fresh db/sync state and import your exported zip.

YouDontCare commented 1 year ago

I would simply export your whole database (will not include protected notes!) and reset both ends. Start from a fresh db/sync state and import your exported zip.

Unironically, if no other idea comes up, then come saturday I'll do literally that :P

Take out a backup, purge everything, start fresh.

YouDontCare commented 1 year ago

I figured out the problem, and it was my own damn stupid fault. A misconfiguration basically, the desktop client on the PC (which is also my home server not just for Trilium but a dozen other things) had its sync settings pointing to... Itself. Which is wrong.

My understanding of what was causing the weird looping behaviour I was seeing is that the "server" application and the "client" application were both trying to read and write from the same db at the same time and "fighting", thus bogging down the whole system. Though that understanding might be wholly incorrect, I am just an amateur.

Either way, changing that and then restarting everything has fixed the synchronisation issues. Changes made on other computers now synch to the PC and vice-versa and I no longer get weird lightspeed dumps onto my terminal :P