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

(Bug report) Error when calling GET note-map/7hWkHZuBOID5/backlink-count #3289

Open
yingjialong opened this issue Nov 4, 2022 · 8 comments

Comments

@yingjialong
Copy link

Trilium Version

0.56

What operating system are you using?

Other Linux

What is your setup?

Server access only

Operating System Version

mac os 13.0 (22A380)

Description

I had a note A, linked to note B, then I deleted note A and when I opened note B I got the error .
I tried to open it in a different browser, but it still reports the error

Error when calling GET note-map/7hWkHZuBOID5/backlink-count: error - Cannot read properties of undefined (reading 'type')

@zadam
Copy link
Owner

zadam commented Nov 5, 2022

Hello, could you please send (either here or to zadam.apps@gmail.com) the log file from the server (in trilium-data/log). That would help me debug this issue. Thanks!

@Ronchi1997
Copy link

I encountered the same issue, here is the log
BTW: my OS is Windows11 22H2

17:09:00.634 200 GET /api/attributes/values/tag with 6 bytes took 0ms
17:09:00.634 ERROR: get /api/note-map/:noteId/backlink-count threw exception: TypeError: Cannot read properties of undefined (reading 'type')
    at C:\Program Files (x86)\trilium-windows-x64\resources\app.asar\src\routes\api\note_map.js:293:39
    at Array.filter (<anonymous>)
    at getFilteredBacklinks (C:\Program Files (x86)\trilium-windows-x64\resources\app.asar\src\routes\api\note_map.js:293:10)
    at getBacklinkCount (C:\Program Files (x86)\trilium-windows-x64\resources\app.asar\src\routes\api\note_map.js:306:20)
    at Function.cb (C:\Program Files (x86)\trilium-windows-x64\resources\app.asar\src\routes\routes.js:159:34)
    at Function.sqliteTransaction (C:\Program Files (x86)\trilium-windows-x64\resources\app.asar\node_modules\better-sqlite3\lib\methods\transaction.js:65:24)
    at Object.transactional (C:\Program Files (x86)\trilium-windows-x64\resources\app.asar\src\services\sql.js:236:52)
    at C:\Program Files (x86)\trilium-windows-x64\resources\app.asar\src\routes\routes.js:161:44
    at C:\Program Files (x86)\trilium-windows-x64\resources\app.asar\node_modules\cls-hooked\context.js:118:13
    at Namespace.run (C:\Program Files (x86)\trilium-windows-x64\resources\app.asar\node_modules\cls-hooked\context.js:97:5)
17:09:00.635 200 GET /api/notes/dgPQ01l8xCcq with 438 bytes took 1ms
17:09:00.648 JS Error: Error when calling GET /api/note-map/dgPQ01l8xCcq/backlink-count: 500 - Cannot read properties of undefined (reading 'type')
Stack: Error
    at Object.C [as logError] (http://127.0.0.1:37840/app-dist/desktop.js:2:102688)
    at Object.throwError (http://127.0.0.1:37840/app-dist/desktop.js:2:87904)
    at c (http://127.0.0.1:37840/app-dist/desktop.js:2:84559)
    at async EventEmitter.<anonymous> (http://127.0.0.1:37840/app-dist/desktop.js:2:85411)
17:09:01.123 204 PUT /api/options with 0 bytes took 0ms

zadam added a commit that referenced this issue Nov 14, 2022
@zadam
Copy link
Owner

zadam commented Nov 14, 2022

Hi, thank you for more details. I wasn't able to reproduce it, but I "strengthened" the relevant code to not crash like this.

@DWorld15
Copy link

DWorld15 commented Nov 21, 2022

I have the same problem. What can I do to get better?I use docker
I go into docker and change note_map.js. Invalid after restart

@Ronchi1997
Copy link

@DuanShiwu try to restart local trilium client, that works for me. Even though I didn't change the code.
This bug seems to happen occasionally

@WPum
Copy link
Contributor

WPum commented Dec 1, 2022

Video here:

test.mp4

@zadam
Copy link
Owner

zadam commented Dec 1, 2022

Thanks @WPum , I will release 0.57.2 stable soon, hopefully it will fix the issue.

@WPum
Copy link
Contributor

WPum commented Dec 2, 2022

This was fixed in 0.57.2

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

5 participants