Can I restore my snap data for firefox after a failed `snap remove`?

Hi all!

I tried to uninstall my firefox snap by doing sudo snap remove firefox. This failed with:

error: cannot perform the following tasks:
- Remove data for snap "firefox" (2605) (failed to remove snap "firefox" base directory: remove /var/snap/firefox: directory not empty)

Although afterwards (I think) firefox wasn’t available in my $PATH.

I tried to make it available again with with sudo snap install firefox, which told me snap "firefox" is already installed, see 'snap help refresh'. I ran sudo snap enable firefox, which allowed me to start firefox, but it had a new profile, my original profile was gone. After some googling I realized I should try to restore a snapshot, that snap would hopefully have created while removing firefox. However sudo snap saved shows No snapshots found..

To debug this further I ran snap changes:

ID   Status  Spawn                   Ready                   Summary
293  Done    yesterday at 09:00 EDT  yesterday at 09:00 EDT  Refresh all snaps: no updates
294  Done    yesterday at 16:24 EDT  yesterday at 16:24 EDT  Refresh all snaps: no updates
295  Done    today at 10:35 EDT      today at 10:35 EDT      Auto-refresh snap "core22"
296  Error   today at 16:08 EDT      today at 16:10 EDT      Remove "firefox" snap
297  Done    today at 16:14 EDT      today at 16:14 EDT      Enable "firefox" snap

Running snap change 296 gives:

Status  Spawn               Ready               Summary
Undone  today at 16:08 EDT  today at 16:10 EDT  Stop snap "firefox" services
Undone  today at 16:08 EDT  today at 16:10 EDT  Run remove hook of "firefox" snap if present
Done    today at 16:08 EDT  today at 16:10 EDT  Disconnect interfaces of snap "firefox"
Undone  today at 16:08 EDT  today at 16:10 EDT  Save data of snap "firefox" in automatic snapshot set #4
Undone  today at 16:08 EDT  today at 16:10 EDT  Remove aliases for snap "firefox"
Undone  today at 16:08 EDT  today at 16:10 EDT  Make snap "firefox" unavailable to the system
Undone  today at 16:08 EDT  today at 16:10 EDT  Remove security profile for snap "firefox" (2605)
Done    today at 16:08 EDT  today at 16:10 EDT  Remove data for snap "firefox" (2579)
Done    today at 16:08 EDT  today at 16:10 EDT  Remove snap "firefox" (2579) from the system
Error   today at 16:08 EDT  today at 16:10 EDT  Remove data for snap "firefox" (2605)
Hold    today at 16:08 EDT  today at 16:10 EDT  Remove snap "firefox" (2605) from the system
Undone  today at 16:08 EDT  today at 16:10 EDT  Disconnect firefox:desktop-legacy from snapd:desktop-legacy
[...]

It says Save data of snap "firefox" in automatic snapshot set #4, but the status of that entry is Undone. I’m assuming this automatic snapshot was supposed to contain my firefox profile, but for some reason it wasn’t created.

Now here are my questions:

  • Is my understanding of what happened roughly correct?
  • Why was the automatic snapshot not created?
  • Is there any way to get my original firefox profile back?

Thanks a lot!

I’m running ubuntu 22.10 and snap 2.59.2.

have you actually checked with snap saved if it was really not created ?

Yes, as I wrote above:

1 Like

oops, sorry, blind me

1 Like