graysky2 / profile-sync-daemon

Symlinks and syncs browser profile dirs to RAM thus reducing HDD/SDD calls and speeding-up browsers.
https://wiki.archlinux.org/index.php/Profile-sync-daemon
Other
902 stars 84 forks source link

Firefox extensions don't work if overlayfs is in use on top of btrfs #249

Closed jaro3 closed 4 years ago

jaro3 commented 4 years ago

both floccus and passman get resets and/or locked by passwords and their de novo setting gets lost on browser exit :-( same with adblock and perhaps more WTF?

graysky2 commented 4 years ago

Is it a permissions issue with the overlayfs?

graysky2 commented 4 years ago

@jaro3 - Can you confirm this is still an issue?

jaro3 commented 4 years ago

It's an issue with btrfs specifically, overlayfs is not compatible with btrfs.....

graysky2 commented 4 years ago

@jaro3 - Can you edit the title to include the btrfs observation? What kernel version are you running?

I am trying to get some concrete data as to btrfs and overlayfs support but am not 100% sure about it. BTRFS's changelog has a few entries:

v4.7 Add support for RENAME_EXCHANGE and RENAME_WHITEOUT to renameat2 syscall. This also means that overlayfs is now supported on top of btrfs.

v4.15 Overlayfs can now use btrfs as the lower filesystem.

graysky2 commented 4 years ago

@jaro3 - Ping

jaro3 commented 4 years ago

I have moved to new kernel meanwhile, will check again when time available, I am using it without the overlayfs since the trouble....

graysky2 commented 4 years ago

Please try it so we can close this or verify that it is in fact a bug.

jaro3 commented 4 years ago

It's still there. I turn on overlayfs and all is gone, bookmarks, extensions etc.... turn it off and it works. nextcloud-app-mozilla_sync 1.4-1 kernel 5.6.1 Screenshot from 2020-05-10 12-00-54

graysky2 commented 4 years ago

To test, I created a btrfs partition on a USB stick, mounted it to ~/.mozilla/ and setup firefox with an extension (some adblocker), made some bookmarks, and customized the theme. Then I set psd to manage the browser with overlayfs and started psd. I saw no differences, adblock was there, theme was there, bookmarks and history were all there.

% mount | grep btrf
/dev/sdc1 on /home/facade/.mozilla type btrfs (rw,relatime,space_cache,subvolid=5,subvol=/)
% psd p
Profile-sync-daemon v6.40

 systemd service: active
 resync-timer:    active
 sync on sleep:   disabled
 use overlayfs:   enabled

Psd will manage the following per /home/facade/.config/psd/.psd.conf:

 browser/psname:  firefox/firefox
 owner/group id:  facade/100
 sync target:     /home/facade/.mozilla/firefox/1d8emup6.default
 tmpfs dir:       /run/user/1000/facade-firefox-1d8emup6.default
 profile size:    4.0K
 overlayfs size:  0
 recovery dirs:   none

 browser/psname:  firefox/firefox
 owner/group id:  facade/100
 sync target:     /home/facade/.mozilla/firefox/xcq83irn.default-release
 tmpfs dir:       /run/user/1000/facade-firefox-xcq83irn.default-release
 profile size:    24M
 overlayfs size:  15M
 recovery dirs:   none
% ustatus psd ; ustatus psd-resync ; systemctl --user list-timers
● psd.service - Profile-sync-daemon
     Loaded: loaded (/usr/lib/systemd/user/psd.service; enabled; vendor preset: enabled)
     Active: active (exited) since Sun 2020-05-10 08:24:08 EDT; 1s ago
       Docs: man:psd(1)
             man:profile-sync-daemon(1)
             https://wiki.archlinux.org/index.php/Profile-sync-daemon
    Process: 13114 ExecStart=/usr/bin/profile-sync-daemon startup (code=exited, status=0/SUCCESS)
   Main PID: 13114 (code=exited, status=0/SUCCESS)

May 10 08:24:08 ease systemd[940]: Starting Profile-sync-daemon...
May 10 08:24:08 ease profile-sync-daemon[13114]: psd startup check successful
May 10 08:24:08 ease systemd[940]: Finished Profile-sync-daemon.
● psd-resync.service - Timed resync
     Loaded: loaded (/usr/lib/systemd/user/psd-resync.service; disabled; vendor preset: enabled)
     Active: inactive (dead) since Sun 2020-05-10 08:24:08 EDT; 1s ago
TriggeredBy: ● psd-resync.timer
    Process: 13177 ExecStart=/usr/bin/profile-sync-daemon resync (code=exited, status=0/SUCCESS)
   Main PID: 13177 (code=exited, status=0/SUCCESS)

May 10 08:24:08 ease systemd[940]: Starting Timed resync...
May 10 08:24:08 ease profile-sync-daemon[13177]: firefox sync successful
May 10 08:24:08 ease profile-sync-daemon[13177]: firefox sync successful
May 10 08:24:08 ease systemd[940]: psd-resync.service: Succeeded.
May 10 08:24:08 ease systemd[940]: Finished Timed resync.
NEXT                        LEFT       LAST PASSED UNIT             ACTIVATES         
Sun 2020-05-10 09:24:08 EDT 59min left n/a  n/a    psd-resync.timer psd-resync.service

1 timers listed.
Pass --all to see loaded but inactive timers, too.
jaro3 commented 4 years ago

uname -a Linux SERVER 5.6.1-pf #1 SMP PREEMPT Thu Apr 9 10:53:37 JST 2020 x86_64 GNU/Linux

can re-test with the stock but I don't see any difference in the btrfs and overlayfs modules I also use the floccus extension with nextcloud bookmarks on the same machine which doesn't work properly even if overlayfs is disabled but that may not be related to psd

graysky2 commented 4 years ago

I also use the floccus extension with nextcloud bookmarks on the same machine which doesn't work properly even if overlayfs is disabled but that may not be related to psd

If it's not working without psd running I would agree.

jaro3 commented 4 years ago

fixed the bookmarks issue, it was mbstring configuration and using multiple browsers with same bookmarks making duplicates....

BUT the overlayfs doesn't still work, everything fine and I turn it on and loose bookmarks and other settings, passman get locked etc.... firefox reporting this:

Screenshot from 2020-05-18 16-53-11

kernel 5.6.1-pf firefox 76.0-2 icecat 68.8.0-1

jaro3 commented 4 years ago

fixed the bookmarks issue, it was mbstring configuration and using multiple browsers with same bookmarks making duplicates....

BUT the overlayfs doesn't still work, everything fine and I turn it on and loose bookmarks and other settings, passman get locked etc.... firefox reporting this:

Screenshot from 2020-05-18 16-53-11

kernel 5.6.1-pf firefox 76.0-2 icecat 68.8.0-1

double confirmed with:

very stock kernel 5.6.10-arch1-1 and firefox 76.0-2

exactly same message

graysky2 commented 4 years ago

I cannot reproduce. Tried again. See above.

jaro3 commented 4 years ago

my btrfs is on top of dmcrypt if this could make a difference

jaro3 commented 4 years ago

well and compression + COW is on in btrfs

graysky2 commented 4 years ago

Can you simplify and verify that the condition I reported above works for you?

To test, I created a btrfs partition on a USB stick, mounted it to ~/.mozilla/ and setup firefox with an extension (some adblocker), made some bookmarks, and customized the theme. Then I set psd to manage the browser with overlayfs and started psd. I saw no differences, adblock was there, theme was there, bookmarks and history were all there.

b0o commented 4 years ago

Chiming in: I don't have any of these issues with psd w/ overlayfs on top of btrfs (on top of dm-crypt).

jaro3 commented 4 years ago

what are your btrfs mount options cat /etc/mtab?

graysky2 commented 4 years ago

@jaro3 - Based on my testing on btrfs and based on @b0o 's experience, I am wondering the issue is with something on your system not with the code here. Please try my USB stick suggestion and report back.

jaro3 commented 4 years ago

when I have time to play with it, I need a usable production system now and there were too many failures of the overlayfs for me.. isn't there any detailed debug log somewhere when it spewing those errors?

graysky2 commented 4 years ago

when I have time to play with it, I need a usable production system now and there were too many failures of the overlayfs for me.. isn't there any detailed debug log somewhere when it spewing those errors?

@jaro3 - Based on my test above, and based on @b0o's results, I am concluding that psd isn't to blame for the issues you are experiencing. The USB stick experiment I proposed is easy (you're just temporarily renaming your ~/.mozilla/ and replacing it simplified btrfs option) to do and shouldn't affect your system stability. It should help us directly test psd + btrfs + overlayfs on your system, but since you are unwilling to test it now, I am going to close this ticket. Feel free to request a reopen if you do the work and find that it is still an issue.