Open Bug 1907184 Opened 2 months ago Updated 4 days ago

profile not migrating to snap if profile dir is too large

Categories

(Thunderbird :: OS Integration, defect)

Thunderbird 115
Desktop
Linux
defect

Tracking

(thunderbird_esr115 affected, thunderbird_esr128 affected, thunderbird128 affected, thunderbird129 affected)

ASSIGNED
Tracking Status
thunderbird_esr115 --- affected
thunderbird_esr128 --- affected
thunderbird128 --- affected
thunderbird129 --- affected

People

(Reporter: heather, Assigned: heather)

References

(Blocks 1 open bug)

Details

(Keywords: snap)

We have seen reports of folks updating their Ubuntu to the latest 24.04 release and then not having access to their profile.

This only happens in cases where the user's profile directory is sufficiently large enough to not be able to copy (because their filesystem doesn't have enough space).

The reason this happens is because Ubuntu 24.04 is the first release that installs the Thunderbird snap, instead of Thunderbird traditionally packaged as a deb and provided in the Ubuntu archive like has been the case. (There is still a Thunderbird deb, but it is a transition package that installs the snap).

When the snap is installed, the install scripts look for an existing ~/.thunderbird profile directory. If one is found and if there is enough space on the filesystem to copy it, then the ~/.thunderbird dir is copied to ~/snap/thunderbird/$SNAP_ID/.thunderbird (the location within the snap where the snap looks for the profile dir) [0]. If however there is an existing ~/.thunerbird dir but not enough space to copy it, then it doesn't get copied and when the user launches Thunderbird, it looks like they need to re-create their profile from scratch.

The flatpak does not seem to have this problem so I looked into what it does to access the profile dir and it bind mounts ~/.thunderbird to ~/.var/app/$FLATPAK_ID/.thunderbird [1]

This could be solved by the snap doing something similar: bind mounting ~/.thunderbird to ~/snap/thunderbird/$SNAP_ID/.thunderbird using a layout. Unfortunately this is not possible because the snap user data is readonly.

Another option would be to simply move ~/.thunderbird to the location within the snap. The problem here is that the original profile directory is at risk of being corrupted and left in a funky state and possibly unrecoverable, if say the user's system crashes while the move is occurring.

[0] https://github.com/ubuntu/thunderbird/blob/stable/thunderbird.launcher
[1] https://searchfox.org/comm-central/source/taskcluster/docker/tb-flatpak/repack.sh#169

I've started a discussion with the snap store folks to try and find a solution: https://forum.snapcraft.io/t/thunderbird-want-snap-user-common-to-be-rewriteable-instead-of-readonly/40959

@heather - I do not believe this to be the case as I migrated to 24.04 yesterday and my /home partition has plenty of space:

$ > df -h /home
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/4tb-home  503G   81G  398G  17% /home

My ~/.thunderbird directory is using up 16GB:

$ > du -hs ~/.thunderbird/
16G	/home/akk/.thunderbird/

Installing Thunderbird either via snap or via apt did not result in my profile being migrated. An attempt to copy the .thunderbird directory from my home folder to ~/snap/thunderbird/common did not help either - see my post below:
https://bugs.launchpad.net/ubuntu/+source/thunderbird/+bug/2056434/comments/17

What eventually worked for me was using the tarball from:
https://www.thunderbird.net/en-US/.

Something else is definitely causing grief to us all...

My ~/snap/thunderbird looks like this

drwxr-xr-x 4 kfc kfc 4096 Sep  2 00:25 507
drwxr-xr-x 5 kfc kfc 4096 Sep  2 00:26 common
lrwxrwxrwx 1 kfc kfc    3 Sep  2 00:25 current -> 507

507 is empty, while a copy of my old .thunderbird lies in common!

This makes the profile load again.

mv ~/snap/thunderbird/common/.thunderbird/ ~/snap/thunderbird/507
You need to log in before you can comment on or make changes to this bug.