question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Linux: Snapshot not extracting in the right place

See original GitHub issue

What happened:

The app downloaded the snapshot in ~/snapshot, a little weird and unclean, also not necessarily the same partition as the defichain folder but that worked. Then the app extracted the 7z file to ~, so it created ~/blocks, ~/chainstate and ~/enhancedcs. The app then said it was going to use it, and instead just restarted the network sync.

What you expected to happen:

1- The app should extract the files in the correct folder. 2- If 1- fails, the app should be somehow aware of it and say that something went wrong not just silently ignore the error. At least it’s able to continue the download, or stop if it’s already full, and not restart it from scratch which is already that. With a clear message, the user can easily fix the issue by moving the folders to the correct place (as I did).

How to reproduce it (as minimally and precisely as possible):

Use the sync from snapshot functionality on a Linux box.

What are your environment parameters?

  • DeFi Wallet Version: 2.3.3
  • Operating System (OS): Arch Linux

Anything else we need to know?:

By a quick look at the code, this is what I’m thinking:

const snapshotPath = path.join(getBaseFolder(), ‘…/’, SNAPSHOT_FOLDER);

So it depends on what getBaseFolder is, if it returns ~/.defi as I guess it would indeed download to ~/.defi/snapshot… ie ~/snapshot.

Let’s take a look:

getBaseFolder returns MAINNET_BASE_FOLDER, which on Linux is BASE_FILE_PATH, which is getCustomDebugLogFilePath(CONFIG_FILE_PATH), that in turn is either the empty string or config.datadir but I don’t know where to find the ini functions. I do not have any datadir in my conf file, the only dir is walletdir, maybe that’s the problem?

Then:

try { log.info(‘Starting extraction…’); const blocksPath = path.join(getBaseFolder(), ‘…’); const child = spawn(UNZIP_FILE_PATH, [ x, ${fileSizes.downloadPath}, -o${blocksPath}, -aoa, ]);

explains why I see the blocks folder in ~/, but when it syncs that’s not where it puts the blocks folder it goes to ~/.defi/ (I didn’t check it in the code, but in my FS during network sync).

I’m glad to dig more if needed, but I’m guessing something here would be obvious to people with knowledge of this app or even just electron. Maybe @thedoublejay .

Thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
John-Geecommented, Apr 9, 2021

Yeah no worries, as I wrote I was able to easy workaround that problem myself so there is no rush on my end, just trying to get it better for people that don’t have the skills/time to fix things. Thank you!

0reactions
diegorodriguezvcommented, May 28, 2021

Congratulations on fixing this issue and the engineering work to reduce download size and synchronization time. My only suggestion would be to download the snapshot file to ~/.defi/snapshot instead of ~/snapshot to decrease pollution of the home directory. Well done!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Restoring snapshots to get the system back to working state
To get back to working state we will boot into a snapshot created by Snapper: Reboot; In GRUB (bootloader) select "Garuda snapshots" instead...
Read more >
HELP: MX Save system to ISO (Snapshot)
Best procedure is to make the snapshot with all the programs closed — your machine will need memory and CPU to create the...
Read more >
Best practices for persistent disk snapshots - Google Cloud
If you do create snapshots of your boot disks, store swap partitions, pagefiles, cache files, and non-critical logs on a separate persistent disk....
Read more >
Creating snapshots in a different location than default virtual ...
This article provides steps to change the default virtual machine working directory location used for snapshots on ESX/ESXi 3.x and later.
Read more >
ZFS: Removing files from snapshots? - Server Fault
Snapshots are read-only. If you need those folders gone then you have to delete the whole snapshot. You can make a backup (with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found