-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
0.94.0: error getting day node with ETAPI #5763
Description
Description
I have an integration, which gets the current day note with this URL: http://192.168.2.2:2000/etapi/calendar/days/2025-06-02
It worked with 0.93.0 but with 0.94.0 I get an 500 response. See below for the error printed in Trilium log.
TriliumNext Version
0.94.0
What operating system are you using?
Other Linux
What is your setup?
Server access only
Operating System Version
Container
Error logs
Got error TypeError: Transaction function cannot return a promise
at Function.sqliteTransaction (/usr/src/app/node_modules/better-sqlite3/lib/methods/transaction.js:67:10)
at Object.GBi [as transactional] (/usr/src/app/main.cjs:712:1970)
at /usr/src/app/main.cjs:1978:3821
at /usr/src/app/main.cjs:1:66388
at gw.run (/usr/src/app/main.cjs:1:66012)
at gw.runAndReturn (/usr/src/app/main.cjs:1:66370)
at Object.v5t [as init] (/usr/src/app/main.cjs:6:2431)
at Non (/usr/src/app/main.cjs:1978:3685)
at /usr/src/app/main.cjs:1978:4048
at Aj.handle_request (/usr/src/app/main.cjs:804:4132)
ERROR: get /etapi/calendar/days/:date threw exception Transaction function cannot return a promise with stacktrace: TypeError: Transaction function cannot return a promise
at Function.sqliteTransaction (/usr/src/app/node_modules/better-sqlite3/lib/methods/transaction.js:67:10)
at Object.GBi [as transactional] (/usr/src/app/main.cjs:712:1970)
at /usr/src/app/main.cjs:1978:3821
at /usr/src/app/main.cjs:1:66388
at gw.run (/usr/src/app/main.cjs:1:66012)
at gw.runAndReturn (/usr/src/app/main.cjs:1:66370)
at Object.v5t [as init] (/usr/src/app/main.cjs:6:2431)
at Non (/usr/src/app/main.cjs:1978:3685)
at /usr/src/app/main.cjs:1978:4048
at Aj.handle_request (/usr/src/app/main.cjs:804:4132)
Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
at ServerResponse.setHeader (node:_http_outgoing:699:11)
at Xl.set.Xl.header (/usr/src/app/main.cjs:815:25361)
at Xl.send (/usr/src/app/main.cjs:815:20878)
at Xl.json (/usr/src/app/main.cjs:815:22013)
at /usr/src/app/main.cjs:2814:21610
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
code: 'ERR_HTTP_HEADERS_SENT'
}
Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
at ServerResponse.setHeader (node:_http_outgoing:699:11)
at Xl.set.Xl.header (/usr/src/app/main.cjs:815:25361)
at Xl.send (/usr/src/app/main.cjs:815:20878)
at Xl.json (/usr/src/app/main.cjs:815:22013)
at /usr/src/app/main.cjs:2814:21610
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
code: 'ERR_HTTP_HEADERS_SENT'
}