electrum icon indicating copy to clipboard operation
electrum copied to clipboard

Corrupt wallet file after macOS specific shutdown crash

Open pricklypierre opened this issue 2 months ago • 0 comments

Description

After experiencing this crash, one of the wallet files that was open in Electrum (v4.5.8) became corrupt and unreadable by Electrum. After some inspection I just reverted to a backup copy of the file, but next time I'll save the file for more detailed analysis. This happened a while ago, but here is what I can remember:

  • Wallet was not encrypted
  • I believe it likely became corrupt because of the shutdown crash but of course it could be a coincidence.
  • No changes were made to the wallet from the time it was opened to the time it became corrupt. That is, no transactions were made, no labels changed, etc.
  • I don't recall the specific verbiage, but upon opening the wallet I received an error message that the wallet file was either corrupt or unreadable. I think it gave a line number for the corruption.
  • Inspecting the wallet JSON in a text editor showed the line in question was corrupt. I don't recall if it was truncated, but the syntax looked incorrect on that line. The lines before and after that line looked okay.
  • I think I tried just deleting that line to see if it would load and I got another error, so at that point I just reverted to a backup of the file.
  • I only experienced the problem once, but after it happened I added logic to my scripts to specifically close all the wallet files before electrum stop is called which would avoid the corruption if it is related to the shutdown crash causing a corruption.

pricklypierre avatar Nov 06 '25 18:11 pricklypierre