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
910 stars 88 forks source link

Losing things from Firefox all the time #117

Closed jurf closed 9 years ago

jurf commented 9 years ago

First I want to thank you for making PSD. It really helped this machine stay usable.

However there's this issue that keeps haunting me. Every once in a while content from Firefox is deleted. I just start Firefox to find out that I've lost a couple of extensions, or that my site previews have gone missing.

This happens quite frequently, usually ever 1-2 weeks.

Running Arch Linux, fully updated.

Thanks.

graysky2 commented 9 years ago

Not sure... do you see a corresponding crashrecover directory created? Post the output of psd p

jurf commented 9 years ago
$ psd p
Profile-sync-daemon v5.73 on Arch Linux

 Systemd service is currently active.
 Systemd resync service is currently active.
 Overlayfs v23 is currently active.

Psd will manage the following per /run/psd.conf settings:

 browser/psname:  firefox/firefox
 owner/group id:  juraj/1000
 sync target:     /home/juraj/.mozilla/firefox/2cbwa0lt.default
 tmpfs dir:       /tmp/juraj-firefox-2cbwa0lt.default
 profile size:    99M
 overlayfs size:  40M
 recovery dirs:   none

 browser/psname:  epiphany/epiphany
 owner/group id:  juraj/1000
 sync target:     /home/juraj/.config/epiphany
 tmpfs dir:       /tmp/juraj-epiphany
 profile size:    8,5M
 overlayfs size:  0
 recovery dirs:   5 <- delete with the c option
  dir path/size:  /home/juraj/.config/epiphany-backup-crashrecovery-20150502_212205 (15M)
  dir path/size:  /home/juraj/.config/epiphany-backup-crashrecovery-20150505_164342 (8,4M)
  dir path/size:  /home/juraj/.config/epiphany-backup-crashrecovery-20150507_072611 (8,3M)
  dir path/size:  /home/juraj/.config/epiphany-backup-crashrecovery-20150507_212645 (8,3M)
  dir path/size:  /home/juraj/.config/epiphany-backup-crashrecovery-20150509_170959 (8,3M)

However in ~./.mozilla/firefox there's this:

$ ls
profiles.ini
2cbwa0lt.default
2cbwa0lt.default-backup
2cbwa0lt.default-backup-crashrecovery-20150419_122353
2cbwa0lt.default-backup-crashrecovery-20150502_212106
2cbwa0lt.default-backup-crashrecovery-20150505_164240
2cbwa0lt.default-backup-crashrecovery-20150507_072507
2cbwa0lt.default-backup-crashrecovery-20150507_212542
2cbwa0lt.default-backup-crashrecovery-20150509_170858

What's funny is that some of the crash recovery folders are sometimes owned by root.

graysky2 commented 9 years ago

From the look of the output, the crash-recovery dirs indicate 5 crashes for epiphany but none for firefox. That is in contrast to what you've found in ~/.mozilla/firefox Not sure what to make of it. How about you verify that all of you crash recovery dirs (epiphany and firefox) are indeed not needed and delete them. Then restart psd and verify everything in each profile dir is as it should be. Again, not sure what would cause your crashes, or why one of the two browsers is getting the recovery dirs.

jurf commented 9 years ago

I delete the backups regularly, or they fill up my little drive.

But I found out an interesting thing today: looks like the owner of the folders is me, just with a capital name. I have no idea how that's possible. My normal user is juraj, but the owner was Juraj. It cannot be changed in Nautilus, not even in root Nautilus. I noticed this today because after the regular addon lost Firefox complained that it could not modify the files on installing the addons again.

jurf commented 9 years ago

Also, I forgot to mention that the lose happened after I closed the browser, and opened it about 15 minutes later.

Also, I have the sync interval set to 10 minutes.

graysky2 commented 9 years ago

I don't know what would cause that change in the owner... do you even have a user on the system by that name?

jurf commented 9 years ago

No, but my accounts "full name" is Juraj.

I just looked into the folder today and found about 15 crash-recovery folders, and one of them was owned by root.

I tried looking into the source, and the only line where where chown is used is here.

ghost commented 9 years ago

Hi, I have exactly the same problem. Output of psd p is:

Profile-sync-daemon v5.73 on Arch Linux

 Systemd service is currently active.
 Systemd resync service is currently active.
 Overlayfs v23 is currently active.

Psd will manage the following per /run/psd.conf settings:

 browser/psname:  firefox/firefox
 owner/group id:  me/100
 sync target:     /home/me/.mozilla/firefox/3vq8y9u.default
 tmpfs dir:       /tmp/me-firefox-3vq8y9u.default
 profile size:    40M
 overlayfs size:  39M
 recovery dirs:   11 <- delete with the c option
  dir path/size:  /home/me/.mozilla/firefox/3vq8y9u.default-backup-crashrecovery-20150322_212604 (188M)
  dir path/size:  /home/me/.mozilla/firefox/3vq8y9u.default-backup-crashrecovery-20150328_192301 (188M)
  dir path/size:  /home/me/.mozilla/firefox/3vq8y9u.default-backup-crashrecovery-20150330_135232 (35M)
  dir path/size:  /home/me/.mozilla/firefox/3vq8y9u.default-backup-crashrecovery-20150424_193823 (47M)
  dir path/size:  /home/me/.mozilla/firefox/3vq8y9u.default-backup-crashrecovery-20150425_024236 (42M)
  dir path/size:  /home/me/.mozilla/firefox/3vq8y9u.default-backup-crashrecovery-20150425_151909 (42M)
  dir path/size:  /home/me/.mozilla/firefox/3vq8y9u.default-backup-crashrecovery-20150427_144208 (42M)
  dir path/size:  /home/me/.mozilla/firefox/3vq8y9u.default-backup-crashrecovery-20150428_022835 (42M)
  dir path/size:  /home/me/.mozilla/firefox/3vq8y9u.default-backup-crashrecovery-20150528_141641 (36M)
  dir path/size:  /home/me/.mozilla/firefox/3vq8y9u.default-backup-crashrecovery-20150528_142003 (36M)
  dir path/size:  /home/me/.mozilla/firefox/3vq8y9u.default-backup-crashrecovery-20150528_165049 (36M)

 browser/psname:  chromium/chromium
 owner/group id:  me/100
 sync target:     /home/me/.config/chromium
 tmpfs dir:       /tmp/me-chromium
 profile size:    69M
 overlayfs size:  0
 recovery dirs:   3 <- delete with the c option
  dir path/size:  /home/me/.config/chromium-backup-crashrecovery-20150528_141641 (137M)
  dir path/size:  /home/me/.config/chromium-backup-crashrecovery-20150528_142003 (137M)
  dir path/size:  /home/me/.config/chromium-backup-crashrecovery-20150528_165049 (137M)
graysky2 commented 9 years ago

I'm not sure what is to blame for your high number of crash recovery dirs. If both the timer and service are active, and if you're cleanly shutting down your machine, it just worksTM.

ghost commented 9 years ago

Had a few crashes lately, but don't think there were so many... Just deleted the crash recoverys and will see next time ;)

Thanks for now...

graysky2 commented 9 years ago

Just to be clear, the crashes are unrelated to psd, yes? Also, psd is working as expected when you experience a crash (i.e recovering your profile), yes?

jurf commented 9 years ago

Depends. Sometimes I have to do a hard REISUB reset, and while psd behaves correctly I do lose some stuff/some stuff gets a different owner/permissions, but sometimes the problems occur when just closing the browser.

ghost commented 9 years ago

The crashes are probably unrelated, but the profiles are not recovered, or sometimes only partly (i.e. addons and cookies are gone, but history is recovered).

graysky2 commented 9 years ago

I think you need to identify the root cause of the crashes. The profile backups if you haven't disabled that feature should be 100 % functional since they are literally a copy of the profile before syncing. See the man page for how to recover one.

jurf commented 9 years ago

Yeah, but how come they are owned by root?

jurf commented 9 years ago

OK, just happened again. GNOME crashed, so I logged back in, wanted to launch firefox but it said that it was already running. Checked, and it surely was so, so I killed it, and launched it again. firefox launched, but half of my extensions were missing and I couldn't install them, because firefox didn't have permissions. This is on a completely new system, new laptop. No recovery dir was created.

graysky2 commented 9 years ago

They are owned by root because the script runs as root and sets the permissions after the move/rsync; this is required for the overlayfs mode unless the user has sudo rights for mount/unmount. I don't have any insights into the gnome crash. I'm guessing that when gnome went down, firefox kept running (had a pid). If you sudo chown user:group -R /path/to/profile it should restore it. Oh, no recovery dir was created because PSD didn't see a browser crash. That only happens if the symlink is bad (ie an ungraceful reboot).

jurf commented 9 years ago

Is there any way the script would set the file permissions to my user? It's kind of a bother doing this all the time.

jurf commented 9 years ago

Also, when the extensions got deleted, so did the new tab page thumbnails. I'm trying to figure out what folder it deleted.

graysky2 commented 9 years ago

Yes, it does set the permissions to your users... the rsync operation is called with the -a switch was does retain ownership. I'm not sure about the corruption introduced by the gnome crash. Please disable overlayfs mode and see if your problems with the extensions go away.