Crashes when importing large JSON files (>= 3.5MB) from backup

[ x ] 私はトラブルシューティングを確認しました

バグ報告

I’ve just reinstalled the Inkdrop desktop app. I took a backup of all my files and tried restoring them from the backup files by following the instructions, but the app crashes a few seconds after I started the restoration. I reinstalled the app again, but the same thing happens.

利用環境

  • Platform: macOS (MacBook Pro 2023)
  • Platform version: Ventura 13.5
  • App Version: Ver 5.5.3

再現方法

Follow the restoration steps according to the official instructions as below.
Preferences → Backup → click “Restore…” button → Select the backup folder → Click the “Restore” button in the popup box.

Hi Daisuke,

Thanks for the report. That’s weird. Can you elaborate on the backup?

  • When did you take the backup?
  • Why did you try to restore the backup? Have you lost a password, set up a new account, and trying to restore the backup to it?
  • How many notes approximately do you have in the backup?

Can you please try enabling debug logging by following the steps in the docs?

And check if you get any errors in the console?

Hi Takuya,

Thank you for your support.

The answers for your questions are as below:

  • I took the backup on Aug. 13, and the next day, I tried to restore my data from the backup.
  • As you mentioned, I needed restoration because I lost my password and had to recreate my account.
  • I guess the number of my notes is around 600 - 700.
  • I enabled debug logging and checked what’s in the console. Here’s what I got.

I hope it helps.

Daisuke

Thanks for the information. Okay, got it.

I enabled debug logging and checked what’s in the console. Here’s what I got.

No, I mean please tell me what you get in the terminal, not the developer console.

  1. Launch the app with --enable-logging option from the terminal
  2. Restore the backup
  3. Check if there are any errors in the terminal (not the developer console)

Tatsuya-san,

I’m sorry. I didn’t understand what you exactly needed.

Here’s what appears in the terminal when I try restoration.

============
<— Last few GCs —>

[71032:0x128040000] 15924 ms: Mark-sweep (reduce) 3761.2 (3808.0) → 3760.8 (3806.2) MB, 5.1 / 0.0 ms (+ 0.5 ms in 10 steps since start of marking, biggest step 0.2 ms, walltime since start of marking 24 ms) (average mu = 0.993, current mu = 0.978) la[71032:0x128040000] 15943 ms: Mark-sweep (reduce) 3760.8 (3806.2) → 3760.8 (3806.2) MB, 19.4 / 0.0 ms (average mu = 0.960, current mu = 0.000) last resort; GC in old space requested

<— JS stacktrace —>

[71032:0818/145458.010352:ERROR:node_bindings.cc(146)] Fatal error in V8: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
zsh: segmentation fault /Applications/Inkdrop.app/Contents/MacOS/Inkdrop --enable-logging

==========

I hope I provided the right thing this time.

Daisuke

That’s interesting. It means that you got out-of-memory errors.

How many notes have you successfully imported? Zero notes?
Do you have huge notes in the backup? They are just plain JSON files so you can look into them.
Parsing huge JSON files could cause heap out of memory like this issue:

Please try moving huge ones (like >= 5MB) to somewhere else.

Takuya-san

Thanks for your suggestion.
I found that the maximum size of my files was 12 MB, which was in the ‘file’ folder.
As you suggested I moved large files and tried restoration again.
Although I failed when I moved files bigger than 5 MB, I could restore my notes successfully when I moved files bigger than 3.5 MB!

I’m happy now!
Now I have to keep it in mind not to attach big files on my notes, though I have no idea what the huge files were.

Thank you very much for your support.

Daisuke

1 Like

Great to know that you’ve got it to work by removing the large JSON files.
I guess it should be considered a bug.
I’ll find a memory-efficient way to import large JSON files safely.

Thanks again for reporting this.