SNAP removed Ubuntu's snap directories, rollback possible?

Hi,

I just installed SNAP from ESA taking care to set the install dir to another location than the ubuntu’s /home//snap.

However, after the install I loose part of my ubuntu snap applications (including my zotero bibliography with my notes, which contains days of work, not synchronized of course…).

By inspecting the installation logs I found this part:

[INFO] com.install4j.runtime.beans.actions.files.DeleteFileAction [ID 3549]: Execute action
   Property directoryFilter: null
   Property fileFilter: null
   Property files: [/home/mercier/snap]
   Property filesRoot: null
   Property backupForRollback: true
   Property recursive: true
   Property rollbackSupported: true
   Property showFileNames: true
   Property showProgress: false
   Backing up /home/mercier/snap/keepassxc/common/org.keepassxc.KeePassXC.BrowserServer
   Backing up /home/mercier/snap/keepassxc/common/.cache/keepassxc/keepassxc.ini
...

so it looks like my ubuntu snap was deleted, but there is this line “Property backupForRollback: true” and the following lines “Backing up…” for every files in the directory.

Is there a way to rollback the installation and recover my files?

I think this is not possible. Rollback here means, that in case of an error the installation can be rolled back. But since it succeeded, I think it is not possible to get it back.

Maybe you are lucky and they are still in a temp directory.
Check the installation.log file you have already found and look for the property exe4j.tempDir.
Maybe in the specified directory you can still find the data.

1 Like

Thank you very much for the answer.

No luck, there is no exe4j.tempDir property in the installation.log.

I guess it’s time for me to learn how to create Ubuntu sandboxed snap packages, so that this kind of software behavior never happens again.

1 Like

You shouldn’t use the application data directory for your important personal data. This directory belongs to the application.

Actually now that I learn the hard way, snap is now the standard way to install applications in Ubuntu (at least for Ubuntu 20.04). The applications data directories are located in /snap/ (actually they are compressed filesystem contained in /var/lib/snap mounted in /snap). The directory ~/snap is meant to store personal data, it has several functions including data containment for each app and data snapshots (automatic during app upgrade, can be manual too, now I know).

This problem is likely to be reproduced for all future Ubuntu users.

1 Like

Is there a way to help push forward a fix for this?

The key issue is that ESA snap currently makes it very easy for Ubuntu users to accidentally delete their application data. I found this forum thread when trying to figure out why I lost all my browser tabs and bookmarks.

To reiterate what florent mentioned, every Ubuntu user has a ~/snap directory which is already in use, and when the ESA snap installer tries to helpfully erase old data, it also erases data which is completely unrelated to it, due to the namespace conflict. Setting the default install directory for Ubuntu users to something like ~/esa_snap would fix this.

3 Likes

Sounds like an annoying issue @TomBlock @diana_harosa

Jira ticket SNAP-3591 created.

1 Like

Dear cbdavis,

we are working on solutions for this, expect it to be resolved with SNAP 10.

Cheers,
Tom

1 Like