-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Joplin terminal server crashes when deleting a notebok with note(s) inside, through data API #11322
Comments
@gri38 can you explain more about it |
Ok, I'll detail from scratch.
docker container run --rm -ti node:18-alpine /bin/sh
# install joplin
mkdir /app
NPM_CONFIG_PREFIX=/app/joplin npm install --production -g joplin
# start server in backgroud:
/app/joplin/bin/joplin server start &
# install curl
apk update && apk add curl
# get api token in TOKEN env var:
export TOKEN=$(grep '"api.token"' /root/.config/joplin/settings.json | cut -d '"' -f 4)
# now let's list the notebooks with curl:
curl http://localhost:41184/folders?token=$TOKEN
# ==> outputs: {"items":[],"has_more":false}
# let's create a notebook and a note inside
/app/joplin/bin/joplin mkbook NB_TO_DELETE
/app/joplin/bin/joplin mknote NOTE_TO_DELETE
/app/joplin/bin/joplin mv NOTE_TO_DELETE NB_TO_DELETE
# let's check we have a notebook NB_TO_DELETE with the note NOTE_TO_DELETE inside:
curl http://localhost:41184/folders?token=$TOKEN
# ==> {"items":[{"id":"699f07047ec54c96ad4441f0940e1cea","parent_id":"","title":"NB_TO_DELETE","deleted_time":0}],"has_more":false}
curl http://localhost:41184/notes?token=$TOKEN
# ==> {"items":[{"id":"5360244c5c064f378b11dd489f704793","parent_id":"699f07047ec54c96ad4441f0940e1cea","title":"NOTE_TO_DELETE","deleted_time":0}],"has_more":false} So we can now reproduce the bug by deleting the notebook NB_TO_DELETE of id 699f07047ec54c96ad4441f0940e1cea, which has a note inside (NOTE_TO_DELETE): curl -X DELETE http://localhost:41184/folders/699f07047ec54c96ad4441f0940e1cea?token=$TOKEN Woops it doesn't crash ;-) If I input again the curl delete, it will crash:
But I would say it's normal: the notebook doesn't exist anymore. It shouldn't crash, but the bug is less serious. When I reported the bug, I wasn't using curl directly, but python package joppy in version 0.0.5... I'll have to do some tests again ! |
I've just tested again with joppy python... and it works !! I don't understand, I'm sure I didn't delete several times when I opened the bug. Today my tests has been done with:
It seems it's the same as last time. Is there any chance I get a fix by installing joplin again ? |
OK !!! I produced the bug again ;-) You do exactly as explained above but the note should have some content. Then, the deletion makes joplin terminal server crash:
|
Operating system
Linux
Joplin version
Joplin CLI Client joplin 3.0.1 (prod, linux)
Desktop version info
No response
Current behaviour
I run Joplin terminal as a server
I create a notebook NB_TO_DELETE with a note inside: NOTE_TO_DELETE
Through data api, I can check that setup:
get request: path=/folders
=> [{'id': 'b43b6b4d544141f69db92376fb09da1a', 'parent_id': '', 'title': 'NB_TO_DELETE', 'deleted_time': 0}]
get request: path=/notes
=> [{'id': '3011bb46f3a140958ae13e4a1587e71f', 'parent_id': 'b43b6b4d544141f69db92376fb09da1a', 'title': 'NOTE_TO_DELETE', 'deleted_time': 0}]
Then, I delete the notebook:
delete request: path=/folders/b43b6b4d544141f69db92376fb09da1a
That makes the app crash with that error:
we can see we have an ORDER BY undefined... which causes the crashes.
Expected behaviour
Delete the notebook and all notebooks and notes inside.
Logs
No response
The text was updated successfully, but these errors were encountered: