I encountered a fatal error while using joplin api. I hope to recover the data first. What steps should I follow?

githu issue

It happened when I used api PUT /folder/:id to modify the parent_id of the directory

What I want to know the most is how to restore my data, because Joplin can’t be opened (as shown above)


Joplin version:
Platform: Windows
OS specifics: Windows 10

Steps to reproduce

  1. Use PUT /folder/:id and pass the parameter {id:'', parent_id:''}, where parent_id is the child of id
  2. The entire program is stuck, and exiting and re-entering will not help, it looks like it has encountered a fatal logic error (I guess Joplin did not deal with this edge situation)

Describe what you expected to happen

  1. When I call the API PUT /folder/:id for this illegal operation, an exception should be thrown for prompting!
  2. If possible, please package the beta version, one for daily use, and the other beta can be developed and tested, otherwise it is quite dangerous, such as the current situation



Hello @rxliuli

I don’t know what your screen shot is showing.

The best solution would be to wipe your Joplin installation and restore from backup!

However, if you don’t have a backup, your data might be recoverable in your Joplin database.

Note, the following is just a guess because I haven’t tried to recreate the problem, so I haven’t seen how the database is corrupted, or even if it is corrupted.

So assuming the folder id was actually set to empty string, you would need to fix the id for the folder in the folder table. If you don’t know what the id was, you might be able to find it by looking at the parent id of a note that was in the folder. Otherwise you could try entering a new random id, but then you would need to update the parent_id of all the children notes to match. Be careful about syncing after doing this. I wouldn’t sync with any other installations, instead remove them and set them all up again.

Also, if you are sure this happened as you describe, it is a bug, and it would be good to create an issue in github so it is fixed.

Encountered the following error. . .

FetchError: On file c54510445eaa4f6baf06ddad383c8461.md: invalid response body at: https://public.bn.files.1drv.com/y4mA4ndszhY2hOGVe955KafF98a3f5eg7jt37AeukV9LRQblbjlZ5DOImljGewf0IyOceMQVIMgDQiqysPITGtk1tp_CJL41gYayPE0SiB20sGkEHAuhakd01S4u_NDA5jh5NozpGk2snTgehMtfScRWEOqqBN8lj3Qlcd2jagUiopHC66vuILyf2ISDD3etGykn8OE3GvtJQfwbEql6rC3COnA5Mc72VT2q3wn37VEYgg/c54510445eaa4f6baf06ddad383c8461.md reason: unexpected end of file

It exploded and it was synchronized several times. . .

In the end, I solved this problem by directly editing the sqllite database, but to be honest, the synchronization feature did a terrible job (the first time I synced a large number of files…)