zadam / trilium

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

Error - Sync failed: AgentClass is not a constructor #4453

Closed r-nd-m closed 11 months ago

r-nd-m commented 11 months ago

Trilium Version

0.61.14

What operating system are you using?

Other Linux

What is your setup?

Local + server sync

Operating System Version

Manajaro KDE current

Description

After local app update to 0.61.14 I've started getting errors for sync: "Sync failed: AgentClass is not a constructor" Nothing else has been done on the desktop side.

On server side - I had a pretty old trilium version (~0.57 or something) - I thought an update might help. During the update I ran into error "App db version is 227, while db version is 213. Migration needed." - so I updated first to 0.60.4 and then to 0.61.14 - but it didn't help with the original error.

I'm able to get the access via browser normally. Windows version I'm using on a laptop works normally (I had to update the app after the server and database update) - but it syncs normally.

Error logs

11:24:07.691 DB size: 505606 KB 11:24:08.824 { "appVersion": "0.61.14", "dbVersion": 227, "syncVersion": 31, "buildDate": "2023-11-16T00:21:34+01:00", "buildRevision": "0afc41060a935a46642a082128bea5002c2410e1", "dataDirectory": "/home/r4nd0m/.local/share/trilium-data", "clipperProtocolVersion": "1.0", "utcDateTime": "2023-11-18T10:24:07.687Z" } 11:24:08.824 CPU model: AMD Athlon(tm) X4 880K Quad Core Processor, logical cores: 4 freq: 4491 Mhz 11:24:08.824 Trusted reverse proxy: false 11:24:08.825 App HTTP server starting up at port 37840 11:24:08.830 Listening on port 37840 11:24:08.865 Becca (note cache) load took 35ms 11:24:09.125 Keyboard action showNoteInfo found in database, but not in action definition. 11:24:09.127 Keyboard action showLinkMap found in database, but not in action definition. 11:24:09.127 Keyboard action showNoteRevisions found in database, but not in action definition. 11:24:09.128 Keyboard action focusOnAttributes found in database, but not in action definition. 11:24:09.129 Keyboard action toggleZenMode found in database, but not in action definition. 11:24:09.130 Keyboard action forceSaveNoteRevision found in database, but not in action definition. 11:24:09.134 Registered global shortcut Ctrl+Alt+P for action createNoteIntoInbox 11:24:09.194 Generated CSRF token FHM57Tnv-qixPfHYz4Zm-8dpsRRiYjgwp9lA with secret _csrf=xlhl4jDgG5nBky0RBeKs59gC; Path=/ 11:24:09.546 200 GET /api/options with 7786 bytes took 0ms 11:24:09.549 200 GET /api/tree with 121081 bytes took 3ms 11:24:09.552 Keyboard action showNoteInfo found in database, but not in action definition. 11:24:09.552 Keyboard action showLinkMap found in database, but not in action definition. 11:24:09.552 Keyboard action showNoteRevisions found in database, but not in action definition. 11:24:09.552 Keyboard action focusOnAttributes found in database, but not in action definition. 11:24:09.552 Keyboard action toggleZenMode found in database, but not in action definition. 11:24:09.553 Keyboard action forceSaveNoteRevision found in database, but not in action definition. 11:24:09.553 200 GET /api/keyboard-actions with 12145 bytes took 1ms 11:24:09.555 200 GET /api/script/widgets with 2 bytes took 1ms 11:24:09.613 200 GET /api/keyboard-shortcuts-for-notes with 2 bytes took 1ms 11:24:09.649 200 POST /api/tree/load with 35314 bytes took 2ms 11:24:09.670 200 POST /api/tree/load with 11695 bytes took 1ms 11:24:10.835 200 GET /api/notes/U08jNDZA2mWe/blob with 161 bytes took 2ms 11:24:10.837 200 GET /api/note-map/U08jNDZA2mWe/backlink-count with 11 bytes took 1ms 11:24:11.615 200 GET /api/script/startup with 1065 bytes took 2ms 11:24:11.618 200 POST /api/tree/load with 2850 bytes took 1ms 11:24:11.625 200 PUT /api/special-notes/api-script-launcher with 356 bytes took 4ms 11:24:11.628 200 PUT /api/special-notes/api-script-launcher with 348 bytes took 2ms 11:24:11.631 200 PUT /api/special-notes/api-script-launcher with 366 bytes took 2ms 11:24:12.869 Table counts: notes: 1773, revisions: 1375, attachments: 271, branches: 1840, attributes: 1718, etapi_tokens: 1, blobs: 2531 11:24:12.935 All consistency checks passed with no errors detected (took 68ms) 11:24:13.884 Sync failed: 'AgentClass is not a constructor', stack: TypeError: AgentClass is not a constructor at getProxyAgent (/opt/trilium-bin/resources/app.asar/src/services/request.js:174:16) at Object.exec (/opt/trilium-bin/resources/app.asar/src/services/request.js:27:24) at requestToSyncServer (/opt/trilium-bin/resources/app.asar/src/services/setup.js:49:42) at Object.hasSyncServerSchemaAndSeed (/opt/trilium-bin/resources/app.asar/src/services/setup.js:12:28) at login (/opt/trilium-bin/resources/app.asar/src/services/sync.js:89:29) at /opt/trilium-bin/resources/app.asar/src/services/sync.js:35:43 at Object.doExclusively (/opt/trilium-bin/resources/app.asar/src/services/sync_mutex.js:13:22) at async sync (/opt/trilium-bin/resources/app.asar/src/services/sync.js:27:16)

zadam commented 11 months ago

Hi, looks like this was a bug, should be fixed in the next version.

Thanks for reporting.

BTW, this error happens only when you have set up HTTP proxy.