TriliumNext / Notes

Build your personal knowledge base with TriliumNext Notes
https://triliumnext.github.io/Docs/
GNU Affero General Public License v3.0
853 stars 46 forks source link

(Bug report) Initial sync doesn't finish #266

Closed meichthys closed 3 months ago

meichthys commented 3 months ago

Trilium Version

0.90.1-beta

What operating system are you using?

Windows

What is your setup?

Local + server sync

Operating System Version

Windows 11

Description

I'm not sure if this is a regression or a duplicate of https://github.com/TriliumNext/Notes/issues/236 which @eliandoran indicated would be fixed in the next release, but i thought i would report it anyway just in case.

After installing TrilumNext (using the new exe installer!), the sync reaches 0 Outstanding sync items: image

Then starts syncing again: image

This cycle seems to repeat indefinitely.

This may still be related to: https://github.com/TriliumNext/Notes/issues/236

If it matters, I was running TriliumNext in a windows sandbox.

Error logs

No response

eliandoran commented 3 months ago

Hi, @meichthys.

Thank you for the report. I have had a similar issue but I believe it might be solved in a commit after the delivery.

Can you please retest on the latest binaries for develop?

meichthys commented 3 months ago

I'm not too sure what happened, but I'm just getting a blank white screen after the initial sync starts (when running the latest binaries): image

Are there logs on the filesystem anywhere? or just in the TriliumNext database? The windows event-viewer doesn't show any OS-level logs.

eliandoran commented 3 months ago

@meichthys , I might have broken something on develop (oops?) I'll have a look, thanks for noticing.

meichthys commented 3 months ago

It seems like the sync actually finished:

13:54:31.313 Table counts: notes: 33759, revisions: 2499, attachments: 157, branches: 33798, attributes: 34840, etapi_tokens: 7, blobs: 34302
13:54:31.350 Slow query took 22ms: SELECT id, entityId FROM entity_changes LEFT JOIN notes ON entityId = notes.noteId WHERE entity_changes.isErased = 0 AND entity_changes.entityName = 'notes' AND notes.noteId IS NULL
13:54:31.406 Slow query took 22ms: SELECT id, entityId FROM entity_changes LEFT JOIN blobs ON entityId = blobs.blobId WHERE entity_changes.isErased = 0 AND entity_changes.entityName = 'blobs' AND blobs.blobId IS NULL
13:54:31.452 Slow query took 21ms: SELECT id, entityId FROM entity_changes LEFT JOIN branches ON entityId = branches.branchId WHERE entity_changes.isErased = 0 AND entity_changes.entityName = 'branches' AND branches.branchId IS NULL
13:54:31.477 Slow query took 25ms: SELECT id, entityId FROM entity_changes JOIN branches ON entityId = branches.branchId WHERE entity_changes.isErased = 1 AND entity_changes.entityName = 'branches'
13:54:31.529 Slow query took 37ms: SELECT id, entityId FROM entity_changes LEFT JOIN attributes ON entityId = attributes.attributeId WHERE entity_changes.isErased = 0 AND entity_changes.entityName = 'attributes' AND attributes.attributeId IS NULL
13:54:31.557 Slow query took 28ms: SELECT id, entityId FROM entity_changes JOIN attributes ON entityId = attributes.attributeId WHERE entity_changes.isErased = 1 AND entity_changes.entityName = 'attributes'
13:54:31.624 Slow query took 31ms: SELECT branchId, noteId FROM branches JOIN notes USING (noteId) WHERE notes.isDeleted = 1 AND branches.isDeleted = 0
13:54:31.657 Slow query took 25ms: SELECT DISTINCT notes.noteId FROM notes LEFT JOIN branches ON notes.noteId = branches.noteId AND branches.isDeleted = 0 WHERE notes.isDeleted = 0 AND branches.branchId IS NULL
13:54:31.756 Slow query took 58ms: SELECT notes.noteId, notes.type, notes.mime FROM notes JOIN blobs USING (blobId) WHERE isDeleted = 0 AND isProtected = 0 AND content IS NULL
13:54:31.813 Slow query took 29ms: SELECT noteId, parentNoteId FROM branches WHERE isDeleted = 0
13:54:31.899 All consistency checks passed with no errors detected (took 594ms)
13:54:32.918 Sending message to all clients: {"type":"sync-push-in-progress","lastSyncedPush":338583}
13:54:32.918 Sync e5k1yQvrnq: Pushing 1 sync changes in 110ms
13:54:32.921 Nothing to push
13:54:33.018 Finished pull
13:54:33.018 Nothing to push
13:54:34.528 Slow query took 24ms: SELECT blobs.blobId FROM blobs LEFT JOIN notes ON notes.blobId = blobs.blobId LEFT JOIN attachments ON attachments.blobId = blobs.blobId LEFT JOIN revisions ON revisions.blobId = blobs.blobId WHERE notes.noteId IS NULL AND attachments.attachmentId IS NULL AND revisions.revisionId IS NULL
13:54:35.113 Content hash computation took 585ms
13:54:35.113 Content hash checks PASSED
13:54:35.113 Sending message to all clients: {"type":"sync-finished","lastSyncedPush":338584}

Looks like maybe this (?):

13:50:56.234 Error: Router not found for request GET /assets/v0.90.1-beta/node_modules/i18next/i18next.min.js

eliandoran commented 3 months ago

@meichthys , that's exactly it. Apparently something in #248 broke the Electron build.

I'll fix it (hopefully) soon, so please be on stand-by.

eliandoran commented 3 months ago

@meichthys , new builds are available here: https://github.com/TriliumNext/Notes/actions/runs/10081728052

meichthys commented 3 months ago

Well.. almost :P image

eliandoran commented 3 months ago

@meichthys , the squirrel/installer one is always slower...

meichthys commented 3 months ago

Boom. Fixed!