Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trilium can't fill in the directory panel or the content of any notes. #4878

Open
LorenAmelang opened this issue Nov 3, 2024 · 14 comments
Open

Comments

@LorenAmelang
Copy link

Trilium Version

0.63.7

What operating system are you using?

Other Linux

What is your setup?

Local + server sync

Operating System Version

Linux Gazp9 6.10.10-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 12 Sep 2024 17:21:02 +0000 x86_64 GNU/Linux

Description

Suddenly today my local Trilium on Arch Linux can't fill in the directory panel or the content of any notes. Icons along the left are active, I can search and see note titles and summaries, but choosing any of those notes draws only the "New Tab" top label for each new window, no content.

My trilium.cc sync server works normally, and notes I enter there can be found locally in searches, but their full content can't be seen.

I reloaded the "0.63.7" code from the tar.xz and restarted from there, no difference.

I tried the "safe mode":

[loren@Gazp9 trilium-linux-x64]$ ls
anonymize-database.sql   icon.png              libvulkan.so.1          snapshot_blob.bin         version
chrome_100_percent.pak   icudtl.dat            LICENSE                 trilium                   vk_swiftshader_icd.json
chrome_200_percent.pak   libEGL.so             LICENSES.chromium.html  trilium-no-cert-check.sh
chrome_crashpad_handler  libffmpeg.so          locales                 trilium-portable.sh
chrome-sandbox           libGLESv2.so          resources               trilium-safe-mode.sh
dump-db                  libvk_swiftshader.so  resources.pak           v8_context_snapshot.bin
[loren@Gazp9 trilium-linux-x64]$ TRILIUM_SAFE_MODE=true ./trilium
DB size: 403587 KB
{
  "appVersion": "0.63.7",
  "dbVersion": 228,
  "nodeVersion": "v18.15.0",
  "syncVersion": 32,
  "buildDate": "2024-05-30T06:59:06+02:00",
  "buildRevision": "95d46b7ce7e0036eeb72b43e1815cc5c00dc214c",
  "dataDirectory": "/home/loren/.local/share/trilium-data",
  "clipperProtocolVersion": "1.0",
  "utcDateTime": "2024-11-03T20:18:41.250Z"
}
CPU model: Intel(R) Core(TM) i7-4710MQ CPU @ 2.50GHz, logical cores: 8 freq: 3374 Mhz
Trusted reverse proxy: false
App HTTP server starting up at port 37840
Listening on port 37840
Becca (note cache) load took 80ms
Keyboard action showNoteRevisions found in database, but not in action definition.
Keyboard action forceSaveNoteRevision found in database, but not in action definition.
Registered global shortcut Ctrl+Alt+P for action createNoteIntoInbox
Generated CSRF token 3iFBbLtu-uJpSSVMST5drII34hhrcBfDnAmE with secret _csrf=C4NbyvstLmumRaCg1kZ71ZQt; Path=/
200 GET /api/options with 6425 bytes took 0ms
200 GET /api/tree with 7452 bytes took 1ms
Keyboard action showNoteRevisions found in database, but not in action definition.
Keyboard action forceSaveNoteRevision found in database, but not in action definition.
200 GET /api/keyboard-actions with 14241 bytes took 1ms
200 GET /api/script/widgets with 2 bytes took 1ms
websocket client connected
200 GET /api/keyboard-shortcuts-for-notes with 2 bytes took 2ms
200 POST /api/tree/load with 5930 bytes took 1ms
200 POST /api/tree/load with 42 bytes took 1ms
200 POST /api/tree/load with 21216 bytes took 2ms
JS Error: Loading note contexts '[{"notePath":"root","active":true}]' failed: undefined undefined
Stack: Error
    at T (http://127.0.0.1:37840/assets/v0.63.7/app-dist/desktop.js:2:119144)
    at N.loadTabs (http://127.0.0.1:37840/assets/v0.63.7/app-dist/desktop.js:2:13731)
200 GET /api/script/startup with 2 bytes took 1ms
Table counts: notes: 3186, revisions: 1731, attachments: 7232, branches: 3293, attributes: 6229, etapi_tokens: 1, blobs: 7574
Slow query took 20ms: 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
All consistency checks passed with no errors detected (took 156ms)
Nothing to push
Finished pull
Nothing to push
Content hash computation took 171ms
Content hash checks PASSED
Sending message to all clients: {"type":"sync-finished","lastSyncedPush":10451366}
204 PUT /api/options with 0 bytes took 2ms
304 GET /api/clipper/handshake with 45 bytes took 1ms
Nothing to push
Finished pull
Nothing to push
Content hash computation took 189ms
Content hash checks PASSED
Sending message to all clients: {"type":"sync-finished","lastSyncedPush":10451366}

(Same view, no note panel or content...  clicked Close X)

Slow 200 GET /api/autocomplete?query=ClipperInbox&activeNoteId=null with 206 bytes took 34ms
[loren@Gazp9 trilium-linux-x64]$ 

Error logs

A bit of the local saved log, this repeats every time a note should be drawn:

12:31:11.200 Content hash computation took 165ms
12:31:11.200 Content hash checks PASSED
12:31:11.200 Sending message to all clients: {"type":"sync-finished","lastSyncedPush":10451337}
12:31:11.334 200 GET /api/notes/pKkjnVGPuJru/blob with 517 bytes took 1ms
12:31:14.609 304 GET /api/clipper/handshake with 45 bytes took 1ms
12:31:15.195 JS Error: Uncaught error: Message: Uncaught TypeError: Cannot read properties of null (reading 'setNote'), URL: http://127.0.0.1:37840/assets/v0.63.7/app-dist/desktop.js, Line: 2, Column: 74720, Error object: {}, Stack: TypeError: Cannot read properties of null (reading 'setNote')
    at p (http://127.0.0.1:37840/assets/v0.63.7/app-dist/desktop.js:2:74720)
    at HTMLAnchorElement.h (http://127.0.0.1:37840/assets/v0.63.7/app-dist/desktop.js:2:74223)
    at HTMLDocument.dispatch (http://127.0.0.1:37840/assets/v0.63.7/node_modules/jquery/dist/jquery.min.js:2:40035)
    at v.handle (http://127.0.0.1:37840/assets/v0.63.7/node_modules/jquery/dist/jquery.min.js:2:38006)
Stack: Error
    at Object.T [as logError] (http://127.0.0.1:37840/assets/v0.63.7/app-dist/desktop.js:2:119144)
    at Ei.window.onerror (http://127.0.0.1:37840/assets/v0.63.7/app-dist/desktop.js:2:667069)
12:31:38.663 200 GET /api/app-info with 308 bytes took 1ms
12:32:10.370 Nothing to push
12:32:10.602 Finished pull
12:32:10.602 Nothing to push

It draws a "New Tab" top tab label for each one, but the rest of the tab and the directory panel are blank.

I can't find any of the /assets/v0.63.7/ items on my drive. Guess they're only served over the web somehow?

What else can I try?

@perfectra1n
Copy link

If you have sync set up, it might be the easiest to scrap your local trilium-data and then resync (pull) from the server as if you were creating a new desktop Trilium client.

@LorenAmelang
Copy link
Author

@perfectra1n Well, that was "interesting". I moved the entire trilium-data folder to a backup location. Started Trilium, it asked what I wanted to do. Chose to load from the cc server. No errors, but it opened in a glaring white mode my lousy vision can't see, so I might have missed some details. After several tries which did nothing, I finally got to the Settings and chose dark mode.

Turns out it is random whether any feature works. Except it never shows any note content in a note tab. Usually it can redraw the note tree now, but sometimes it just goes blank, with no icons at the bottom. Usually Settings options are drawn, but sometimes I just get yet another New Note tab on the right, and sometimes nothing happens. Search in notes shows correct content, the attributes at the top of the note's tab are correct, but the content is just the "enter a search term" block.

Today's errors:

12:38:02.563 200 POST /api/tree/load with 21216 bytes took 1ms
12:38:02.645 JS Error: Loading note contexts '[{"notePath":"root","active":true}]' failed: undefined undefined
Stack: Error
    at T (http://127.0.0.1:37840/assets/v0.63.7/app-dist/desktop.js:2:119144)
    at N.loadTabs (http://127.0.0.1:37840/assets/v0.63.7/app-dist/desktop.js:2:13731)
12:38:04.552 200 GET /api/script/startup with 2 bytes took 8ms
12:38:05.673 Table counts: notes: 3186, revisions: 1731, attachments: 7232, branches: 3293, attributes: 6229, etapi_tokens: 1, blobs: 7574
12:38:05.841 All consistency checks passed with no errors detected (took 174ms)


12:54:49.569 Updating option 'theme' to 'dark'
12:54:49.570 204 PUT /api/options/theme/dark with 0 bytes took 1ms
12:54:49.579 JS Info: Frontend app reload: theme change
12:54:49.583 Generated CSRF token th3P0SLO-WaFr9z1QiUBah9zoNYXbJWXLnl8 with secret undefined
12:54:49.729 200 GET /api/options with 6499 bytes took 0ms
12:54:49.732 200 GET /api/tree with 133510 bytes took 2ms
12:54:49.734 200 GET /api/keyboard-actions with 14263 bytes took 1ms
12:54:49.738 200 GET /api/script/widgets with 2893 bytes took 4ms
12:54:49.751 200 POST /api/tree/load with 2096 bytes took 1ms
12:54:49.785 200 GET /api/keyboard-shortcuts-for-notes with 2 bytes took 1ms
12:54:49.801 200 POST /api/tree/load with 5929 bytes took 0ms
12:54:49.802 200 POST /api/tree/load with 4974 bytes took 1ms
12:54:49.810 200 POST /api/tree/load with 21215 bytes took 0ms
12:54:49.871 JS Error: Loading note contexts '[{"ntxId":"14Pbt8","mainNtxId":null,"notePath":"root/_hidden/_options/_optionsAppearance","hoistedNoteId":"_options","active":true,"viewScope":{"viewMode":"default"}}]' failed: undefined undefined
Stack: Error
    at T (http://127.0.0.1:37840/assets/v0.63.7/app-dist/desktop.js:2:119144)
    at N.loadTabs (http://127.0.0.1:37840/assets/v0.63.7/app-dist/desktop.js:2:13731)
12:54:51.787 200 GET /api/script/startup with 2 bytes took 2ms


12:56:04.578 JS Error: Uncaught error: Message: Uncaught TypeError: Cannot read properties of null (reading 'setNote'), URL: http://127.0.0.1:37840/assets/v0.63.7/app-dist/desktop.js, Line: 2, Column: 74720, Error object: {}, Stack: TypeError: Cannot read properties of null (reading 'setNote')
    at p (http://127.0.0.1:37840/assets/v0.63.7/app-dist/desktop.js:2:74720)
    at HTMLAnchorElement.h (http://127.0.0.1:37840/assets/v0.63.7/app-dist/desktop.js:2:74223)
    at HTMLDocument.dispatch (http://127.0.0.1:37840/assets/v0.63.7/node_modules/jquery/dist/jquery.min.js:2:40035)
    at v.handle (http://127.0.0.1:37840/assets/v0.63.7/node_modules/jquery/dist/jquery.min.js:2:38006)
Stack: Error
    at Object.T [as logError] (http://127.0.0.1:37840/assets/v0.63.7/app-dist/desktop.js:2:119144)
    at Ei.window.onerror (http://127.0.0.1:37840/assets/v0.63.7/app-dist/desktop.js:2:667069)
12:56:25.932 200 GET /api/search/%23workspace%20%23!template with 2 bytes took 2ms


13:04:29.384 304 GET /api/clipper/handshake with 45 bytes took 1ms
13:04:51.738 JS Error: Uncaught error: Message: ResizeObserver loop limit exceeded, URL: http://127.0.0.1:37840/#root/MEOxcpC1CAXa/EXqQAODFfbW8/cETsBSeIPvjm/aLtBa8TP45S2?ntxId=4iQ65E, Line: 0, Column: 0, Error object: null, Stack: null
Stack: Error
    at Object.T [as logError] (http://127.0.0.1:37840/assets/v0.63.7/app-dist/desktop.js:2:119144)
    at Ei.window.onerror (http://127.0.0.1:37840/assets/v0.63.7/app-dist/desktop.js:2:667069)
13:04:51.789 200 POST /api/note-map/aLtBa8TP45S2/link with 111 bytes took 5ms


13:14:50.796 200 POST /api/tree/load with 21219 bytes took 1ms
13:14:50.862 JS Error: Loading note contexts '[{"ntxId":"i2pxUF","mainNtxId":null,"notePath":"root/_hidden/_options/_optionsAppearance","hoistedNoteId":"_options","active":true,"viewScope":{"viewMode":"default"}}]' failed: undefined undefined
Stack: Error
    at T (http://127.0.0.1:37840/assets/v0.63.7/app-dist/desktop.js:2:119144)
    at N.loadTabs (http://127.0.0.1:37840/assets/v0.63.7/app-dist/desktop.js:2:13731)
13:14:52.789 200 GET /api/script/startup with 2 bytes took 5ms

Different from before... But I'm not sure the randomness is an improvement.

Maybe it is time to move to TriliumNext? But it says it is on sync 33, and my trilium.cc server is still 32. They are apparently considering moving, maybe I need to wait and see if they do?

@perfectra1n
Copy link

perfectra1n commented Nov 5, 2024

Yeah, you can give TriliumNext a shot. You can use up to v0.90.4 while still using your existing trilium.cc sync version of 32 from. We had to increment the sync version to 33 allow for mindmaps in newer versions in TriliumNext.

It might be worth reinstalling the Trilium desktop application as well (or try TriliumNext v0.90.4), because it appears that some JS files are missing from those errors above. Might be a permissions, space, corruption, or solar flare issue...

You can also try starting from scratch with exporting your entire root note, downloading a backup, wiping everything, and then reimporting to see if there was a weird frontend JS file causing the viewport to break.

@LorenAmelang
Copy link
Author

My install procedure on Arch is just to download the tar.xz, extract it, and start the trilium "program" from there. I've deleted the trilium-data folder it makes and done a fresh extraction of the tar.xz file for my previous report here.

The only .js files I can find are in:
/home/loren/builds/trilium/trilium-linux-x64/dump-db/dump-db.js
(several tiny .js files)

There is also this js folder, but the files are binary with numeric names, like:
/home/loren/.config/Trilium Notes/Code Cache/js/4cf48e20e0146862_0
All those mystery files must be the js it is having problems with...
Maybe I should delete that and see if it recreates a working version?

But before I do more experiments... I learned how to see the Frontend logs within Trilium, and even put them in dark mode. But I still can't figure out where these node and js files are. The "37840" address is where my web clipper lives... Maybe the Trilium app serves those numeric files as named js files?

From the Trilium Console, trying twice to display notes that only showed the New tab label, no content (see screenshot). And then another period of nothing on the screen responding:

ws.js:18 17:43:10 Uncaught error: Message: Uncaught TypeError: Cannot read properties of null (reading 'setNote'), URL: http://127.0.0.1:37840/assets/v0.63.7/app-dist/desktop.js, Line: 2, Column: 74720, Error object: {}, Stack: TypeError: Cannot read properties of null (reading 'setNote')
    at p (http://127.0.0.1:37840/assets/v0.63.7/app-dist/desktop.js:2:74720)
    at HTMLAnchorElement.h (http://127.0.0.1:37840/assets/v0.63.7/app-dist/desktop.js:2:74223)
    at HTMLDocument.dispatch (http://127.0.0.1:37840/assets/v0.63.7/node_modules/jquery/dist/jquery.min.js:2:40035)
    at v.handle (http://127.0.0.1:37840/assets/v0.63.7/node_modules/jquery/dist/jquery.min.js:2:38006)
T @ ws.js:18
Ei.window.onerror @ glob.js:62
link.js:239 Uncaught TypeError: Cannot read properties of null (reading 'setNote')
    at p (link.js:239:25)
    at HTMLAnchorElement.h (link.js:208:12)
    at HTMLDocument.dispatch (jquery.min.js:2:40035)
    at v.handle (jquery.min.js:2:38006)
p @ link.js:239
h @ link.js:208
dispatch @ jquery.min.js:2
v.handle @ jquery.min.js:2

ws.js:18 17:43:52 Uncaught error: Message: Uncaught TypeError: Cannot read properties of null (reading 'setNote'), URL: http://127.0.0.1:37840/assets/v0.63.7/app-dist/desktop.js, Line: 2, Column: 74720, Error object: {}, Stack: TypeError: Cannot read properties of null (reading 'setNote')
    at p (http://127.0.0.1:37840/assets/v0.63.7/app-dist/desktop.js:2:74720)
    at HTMLAnchorElement.h (http://127.0.0.1:37840/assets/v0.63.7/app-dist/desktop.js:2:74223)
    at HTMLDocument.dispatch (http://127.0.0.1:37840/assets/v0.63.7/node_modules/jquery/dist/jquery.min.js:2:40035)
    at v.handle (http://127.0.0.1:37840/assets/v0.63.7/node_modules/jquery/dist/jquery.min.js:2:38006)
T @ ws.js:18
Ei.window.onerror @ glob.js:62
link.js:239 Uncaught TypeError: Cannot read properties of null (reading 'setNote')
    at p (link.js:239:25)
    at HTMLAnchorElement.h (link.js:208:12)
    at HTMLDocument.dispatch (jquery.min.js:2:40035)
    at v.handle (jquery.min.js:2:38006)
p @ link.js:239
h @ link.js:208
dispatch @ jquery.min.js:2
v.handle @ jquery.min.js:2

ws.js:221 17:45:47 Lost websocket connection to the backend. If you keep having this issue repeatedly, you might want to check your reverse proxy (nginx, apache) configuration and allow/unblock WebSocket.
ws.js:221 17:45:48 Lost websocket connection to the backend. If you keep having this issue repeatedly, you might want to check your reverse proxy (nginx, apache) configuration and allow/unblock WebSocket.
...  (repeats every second)
ws.js:221 17:46:24 Lost websocket connection to the backend. If you keep having this issue repeatedly, you might want to check your reverse proxy (nginx, apache) configuration and allow/unblock WebSocket.
 17:48:32 Lost websocket connection to the backend. If you keep having this issue repeatedly, you might want to check your reverse proxy (nginx, apache) configuration and allow/unblock WebSocket.
...
17:49:13 Lost websocket connection to the backend. If you keep having this issue repeatedly, you might want to check your reverse proxy (nginx, apache) configuration and allow/unblock WebSocket.

Trilium console 2 errors 17-41-15

Beyond my knowledge! This is happening within Trilium, on its own DevTools Console. I'm not aware of any reverse proxy (nginx, apache) anywhere on the Arch machine. Maybe those messages are designed for server installations?

@perfectra1n
Copy link

perfectra1n commented Nov 5, 2024

Trilium still runs a server on port 37840 which serves the JS to the electron window you see, so I wonder if the server isn't working on your local machine. That's a very interesting issue, I haven't seen that myself even with a very similar setup.

Maybe stick to just using the webapp for now? It looks like all the JS files are failing to display to your electron window, which are served by the local server. When running the Desktop client, you should be able to do a curl localhost:37840 and get some HTML / JS back.

@eliandoran
Copy link
Collaborator

@LorenAmelang , from what I see in the logs it appears that the root cause for the errors you are seeing is that the communication between the server (which is started alongside Electron) and the Electron "browser" window is not working, since there are quite a few 404 errors.

The problem is that I haven't seen this kind of error before, it must be somehow tied in to your environment.

Like @perfectra1n , it might be worth making a manual backup of the database and trying TriliumNext to see if we have a different error there.

@LorenAmelang
Copy link
Author

@perfectra1n
Trilium still runs a server on port 37840 which serves the JS to the electron window you see, so I wonder if the server isn't working on your local machine.

Web clipper connected to 37840

If local Trilium is not running, the Web Clipper says "connected to server", presumably my trilium.cc server. If local is running, it shows 37840, and saving something draws another empty New Tab in local Trilium.
But note that the Help dialog says 37740! Is that just a static typo, or an actual data glitch? I tried for way too long to use DevTools on it, and can see every space and style detail, but not the actual dialog text...

When running the Desktop client, you should be able to do a curl localhost:37840 and get some HTML / JS back.

[loren@Gazp9 /]$ curl localhost:37840
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <link rel="shortcut icon" href="favicon.ico">
    <link rel="manifest" crossorigin="use-credentials" href="manifest.webmanifest">
    <title>Trilium Notes</title>
</head>
<body class="desktop heading-style-markdown">
<noscript>Trilium requires JavaScript to be enabled.</noscript>

<script>
    // hide body to reduce flickering on the startup. This is done through JS and not CSS to not hide <noscript>
    document.getElementsByTagName("body")[0].style.display = "none";
</script>

<div id="toast-container" class="d-flex flex-column justify-content-center align-items-center"></div>

<div class="dropdown-menu dropdown-menu-sm" id="context-menu-container"></div>

<script type="text/javascript">
    global = globalThis; /* fixes https://github.com/webpack/webpack/issues/10035 */

    window.glob = {
        device: "desktop",
        baseApiUrl: 'api/',
        activeDialog: null,
        maxEntityChangeIdAtLoad: 57133,
        maxEntityChangeSyncIdAtLoad: 57131,
        instanceName: '',
        csrfToken: 'rGiIuIGM-2l8DSL1hwzrBnEcFrozeUTTG4Y4',
        isDev: false,
        appCssNoteIds: ["R0vuGyzMxBMl"],
        isMainWindow: true,
        isProtectedSessionAvailable: false,
        triliumVersion: "0.63.7",
        assetPath: "assets/v0.63.7",
        appPath: "assets/v0.63.7/app-dist",
        TRILIUM_SAFE_MODE: false
    };
</script>

<style>
    .note-split {
        max-width: 1200px;
    }
</style>

<!-- Required for correct loading of scripts in Electron -->
<script>if (typeof module === 'object') {window.module = module; module = undefined;}</script>

<script src="assets/v0.63.7/node_modules/jquery/dist/jquery.min.js"></script>

<link href="assets/v0.63.7/libraries/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<script src="assets/v0.63.7/libraries/bootstrap/js/bootstrap.bundle.min.js"></script>

<!-- Include Fancytree library and skip -->
<link href="assets/v0.63.7/stylesheets/tree.css" rel="stylesheet">
<script src="assets/v0.63.7/libraries/fancytree/jquery.fancytree-all-deps.min.js"></script>

<script src="assets/v0.63.7/node_modules/jquery-hotkeys/jquery-hotkeys.js"></script>

<script src="assets/v0.63.7/libraries/autocomplete.jquery.min.js"></script>

<script src="assets/v0.63.7/node_modules/dayjs/dayjs.min.js"></script>

<script src="assets/v0.63.7/node_modules/split.js/dist/split.min.js"></script>

<link href="assets/v0.63.7/stylesheets/ckeditor-theme.css" rel="stylesheet">
<link href="api/fonts" rel="stylesheet">
<link href="assets/v0.63.7/stylesheets/theme-light.css" rel="stylesheet">


<link href="api/notes/download/wJilMcBKMoSv" rel="stylesheet">


<link href="assets/v0.63.7/stylesheets/style.css" rel="stylesheet">

<script>
    $("body").show();
</script>

<script src="assets/v0.63.7/app-dist/desktop.js" crossorigin type="module"></script>

<link rel="stylesheet" type="text/css" href="assets/v0.63.7/node_modules/boxicons/css/boxicons.min.css">

</body>
</html>
[loren@Gazp9 /]$ 

Does that mean by backend is working?

@eliandoran
it might be worth making a manual backup of the database and trying TriliumNext to see if we have a different error there.

I'm not clear exactly what needs to be saved and what needs to be deleted. I see
/run/media/loren/64GB/Backup Items/Trilium Backup/backup/backup-daily.db
so I presume there is a way to reload everything to a new instance from that.

Is that true even if I've deleted everything from these locations?
/home/loren/builds/trilium/trilium-linux-x64
/home/loren/.config/Trilium Notes/
/home/loren/.local/share/applications/trilium-notes.desktop
/home/loren/.local/share/trilium-data

I only deleted trilium-data before reloading the app and pulling my data from the cc server. Maybe there is some glitch saved in one of the other locations?

Is there any other place I need to clear out before trying a fresh install of TriliumNext v0.90.4 ?

Just for curiosity, when the 'X' icon won't close Trilium and I have to close it from the Linux tray icon, I checked if it was really closed:

[loren@Gazp9 /]$ date
Tue Nov  5 12:19:04 PM PST 2024
[loren@Gazp9 /]$ ps aux | grep trilium  <-- not runnng
loren     730552  0.0  0.0   6392  4008 pts/0    S+   13:00   0:00 grep trilium
[loren@Gazp9 /]$ 

[loren@Gazp9 /]$ ps aux | grep trilium  <-- started
loren     730574 21.2  2.0 1177760304 338536 ?   Sl   13:00   0:03 /home/loren/builds/trilium/trilium-linux-x64/trilium
loren     730578  0.3  0.9 33994156 152532 ?     S    13:00   0:00 /home/loren/builds/trilium/trilium-linux-x64/trilium --type=zygote --no-zygote-sandbox
loren     730579  0.3  0.9 33994144 152816 ?     S    13:00   0:00 /home/loren/builds/trilium/trilium-linux-x64/trilium --type=zygote
loren     730581  0.0  0.0 33994144 14344 ?      S    13:00   0:00 /home/loren/builds/trilium/trilium-linux-x64/trilium --type=zygote
loren     730615  1.8  0.7 34116708 118548 ?     Sl   13:00   0:00 /home/loren/builds/trilium/trilium-linux-x64/trilium --type=gpu-process --enable-crash-reporter=902dc809-bded-42cf-b78b-e8b6ae7219d2,no_channel --user-data-dir=/home/loren/.config/Trilium Notes --gpu-preferences=WAAAAAAAAAAgAAAEAAAAAAAAAAAAAAAAAABgAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAGAAAAAAAAAAYAAAAAAAAAAgAAAAAAAAACAAAAAAAAAAIAAAAAAAAAA== --shared-files --field-trial-handle=0,i,9468533117692899813,16093778975231128110,262144 --disable-features=SpareRendererForSitePerProcess
loren     730618  1.2  1.0 34061048 176724 ?     Sl   13:00   0:00 /home/loren/builds/trilium/trilium-linux-x64/trilium --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --enable-experimental-web-platform-features --enable-crash-reporter=902dc809-bded-42cf-b78b-e8b6ae7219d2,no_channel --user-data-dir=/home/loren/.config/Trilium Notes --shared-files=v8_context_snapshot_data:100 --field-trial-handle=0,i,9468533117692899813,16093778975231128110,262144 --disable-features=SpareRendererForSitePerProcess
loren     730651  5.1  1.6 1185977432 263380 ?   Sl   13:00   0:00 /home/loren/builds/trilium/trilium-linux-x64/trilium --type=renderer --enable-crash-reporter=902dc809-bded-42cf-b78b-e8b6ae7219d2,no_channel --user-data-dir=/home/loren/.config/Trilium Notes --app-path=/home/loren/builds/trilium/trilium-linux-x64/resources/app.asar --no-sandbox --no-zygote --enable-experimental-web-platform-features --lang=en-US --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=5 --time-ticks-at-unix-epoch=-1730321517114872 --launch-time-ticks=518914393924 --shared-files=v8_context_snapshot_data:100 --field-trial-handle=0,i,9468533117692899813,16093778975231128110,262144 --disable-features=SpareRendererForSitePerProcess
loren     730679  0.0  0.0   6392  4024 pts/0    S+   13:00   0:00 grep trilium
[loren@Gazp9 /]$ 

Are all those processes normal? Are all those detail parameters correct? That's a lot of info I haven't seen before!

@perfectra1n
Copy link

perfectra1n commented Nov 6, 2024

Yeah those processes are typical with Electron apps and Trilium - I wonder if you have ufw or something of the sorts that wouldn't allow the Electron frontend to reach the server backend on localhost?

@LorenAmelang
Copy link
Author

@perfectra1n
I wonder if you have ufw or something of the sorts that wouldn't allow the Electron frontend to reach the server backend on localhost?

Looks to me like they are connected. But I guess there could be a filter messing with the connection:

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode      PID/Program name    
tcp        0      0 0.0.0.0:37840           0.0.0.0:*               LISTEN      1000       7429974    741788/trilium      
tcp        0      0 127.0.0.1:37840         127.0.0.1:54550         ESTABLISHED 1000       7434066    741788/trilium      
tcp        0      0 127.0.0.1:54550         127.0.0.1:37840         ESTABLISHED 1000       7429988    741834/Trilium Note 
tcp        0      0 10.1.1.9:55524          140.82.116.5:443        ESTABLISHED 1000       7434073    741834/Trilium Note 
tcp        0      0 127.0.0.1:54566         127.0.0.1:37840         ESTABLISHED 1000       7429990    741834/Trilium Note 
tcp        0      0 127.0.0.1:37840         127.0.0.1:54566         ESTABLISHED 1000       7436719    741788/trilium      
tcp        0      0 127.0.0.1:54572         127.0.0.1:37840         ESTABLISHED 1000       7434072    741834/Trilium Note 
tcp        0      0 127.0.0.1:37840         127.0.0.1:49194         ESTABLISHED 1000       7434824    741788/trilium      
udp        0      0 10.1.1.9:42260          65.108.236.111:443      ESTABLISHED 1000       7434083    741834/Trilium Note 

NetRange: 140.82.112.0 - 140.82.127.255
Organization: GitHub, Inc. (GITHU)

inetnum: 65.108.0.0 - 65.109.255.255
netname: DE-HETZNER-20010209

[loren@Gazp9 ~]$ paping -c 3 -p 37840 -t 500 127.0.0.1
paping v1.5.5 - Copyright (c) 2023 Mike Lovell

Connecting to 127.0.0.1 on TCP 37840:

Connected to 127.0.0.1: time=0.06ms protocol=TCP port=37840
Connected to 127.0.0.1: time=0.08ms protocol=TCP port=37840
Connected to 127.0.0.1: time=0.06ms protocol=TCP port=37840

Connection statistics:
        Attempted = 3, Connected = 3, Failed = 0 (0.00%)
Approximate connection times:
        Minimum = 0.06ms, Maximum = 0.08ms, Average = 0.07ms

[loren@Gazp9 ~]$ 

[loren@Gazp9 ~]$ pacman -Qn | grep 'ufw'
[loren@Gazp9 ~]$
But there are icons...
/usr/share/icons/matefaenza/apps/scalable/ufw-frontends.svg
/usr/share/icons/matefaenza/apps/32/ufw-frontends.png
/usr/share/icons/matefaenza/apps/24/ufw-frontends.png
/usr/share/icons/Numix-Square/48/apps/ufw-frontends.svg

I'm not aware of any firewall apps, and certainly no recent changes.

@perfectra1n
Copy link

You've checked darn near everything I can think of, and reinstalled - but something just seems really really weird and off. Do you have flatpak available? I wonder if installing the Trilium desktop app via Flatpak would work for you 🤔

@LorenAmelang
Copy link
Author

I just backed up and deleted everything related to Trilium, including:
/home/loren/.config/Trilium Notes/
/home/loren/.local/share/applications/trilium-notes.desktop
/home/loren/.local/share/trilium-data

Downloaded https://github.com/TriliumNext/Notes/releases/download/v0.90.4/trilium-linux-x64-0.90.4.tar.xz
Extracted, ran Trilium, chose new user, and it looked good.
Quit the app, copied my /trilium-data/document.db over the new one it had made, and restarted it.
Not only are all my notes back, but it restored my Appearance choices and automatically set up my trilium.cc server!

The previous time I reloaded, I only deleted trilium-data. There must have been some glitch saved in /.config/Trilium Notes/...

So thankful!

@perfectra1n
Copy link

Awesome, glad to hear it! Yeah, it sounds like there was some JS or something else that had gone completely south in your install...glad you're back up and running though :)

@LorenAmelang
Copy link
Author

@perfectra1n
Cleaning up all the backups and notes I'd saved, I noticed this:
Screenshot from 2024-11-06 20-54-37

New install on the left, old backup on the right. Looks like the ".js" Code Cache just grows hugely over the years. If the new install can work with 18 items, maybe the 228 items I had before were a problem? Obsolete conflicting bits of code? Certainly a waste of disk space!

I have no idea what those cryptically named files are, but they have bits like:
http://127.0.0.1:37840/assets/v0.90.4/node_modules/jquery-hotkeys/jquery-hotkeys.js

The kinds of things that showed up in my old error messages. Maybe there needs to be some automated housekeeping?

Oh, I also noticed the ARM/V8 version. Would it be reasonable to move my server install to the Raspberry Pi 5 I just set up? Probably way less CPU than the trilium.cc server, but crossing my house instead of crossing the Atlantic might end up faster...

@perfectra1n
Copy link

Those files are Node.js libraries and dependencies used for both the Trilium client and server. Thankfully they should be quite small, as to not be a large waste of space. I'm not sure why the number of files in the folder has balooned, perhaps with updating the versions comes with newly-named files.

You'll find me firmly in the tiny PC camp (Dell Wyse, Lenovo ThinkStation Mini, etc.) over the Pi, but yes the Pi should work with Trilium, if you're up for dealing with the reverse proxy, storage, and TLS certs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants