I think something has become corrupted in my sync data and is now causing Firefox to nuke my browsing sessions
Yesterday, I noticed after I closed and re-opened Firefox, my browsing session was completely gone - all my tabs and windows, my entire browsing history, website sign-in status, all completely gone. I've been troubleshooting since then.
I've noticed that the 'sessionstore-backups' folder in my profile folder is missing. When I open Firefox, this folder is created and Firefox writes some data to it, but Firefox seems to delete the folder as soon as I quit Firefox. Firefox should not be doing this. My Firefox is configured to open previous windows and tabs, and is NOT configured to wipe any browsing data of any kind when it closes.
As a sanity check, I spun up a Windows Sandbox (briefly, it's a clean, isolated Windows environment) and installed Firefox there. I also enabled the option 'Open previous windows and tabs'. Firefox behaves normally - it re-opens the tabs/windows I had open when I quit Firefox. Great, that's what I expect. The trouble starts as soon as I sign in to sync. After signing in to sync, and letting the initial sync process complete, I open a couple of windows and tabs, then quit Firefox. Firefox begins nuking my browsing session again - the 'sessionstore-backups' folder is erased, and next time I start Firefox, all my windows and tabs are missing, and my browsing history is missing.
So, at this point, I'm assuming something in my synced data has become corrupt. I haven't installed any new extensions lately. I haven't changed any of Firefox's settings that would cause this to happen. The only thing I have done differently lately was enable Firefox Sync in LibreWolf and sign in to sync there. It seems like this session-nuking trouble started after I signed in to sync in LibreWolf. I assumed, since LibreWolf is a fork of Firefox, and because there were no warnings or indications the feature was incomplete/unstable/experimental/etc., that it would just work, that it wouldn't cause any issues. But it seems like it has caused issues. I checked LibreWolf's issues tracker for anything related to 'sync', but I didn't see anything noteworthy.
I've been using Firefox and Sync for numerous years without issue. This session-nuking thing started yesterday.
I use Firefox in a few places, and based on what I saw happen in my Windows Sandbox, this session-nuking issue is going to happen in every Firefox I'm signed in to as soon as it has a chance to sync. Obviously, I do not want this to happen.
What can I do to determine what the issue is? What can I do to check if something in my synced data has become corrupted? What can I do to reverse it? I'm not opposed to completely wiping/resetting my synced data, but I'd rather not if I don't have to. The only thing I would lose sleep over is my bookmarks, but I know I can export them. Are there any debug logs I can enable/look at? Anything I should look for in Event Viewer?
Thanks.
தீர்வு தேர்ந்தெடுக்கப்பட்டது
Thank you for helping me troubleshoot this. Based on your username, I believe you were helping me troubleshoot over on Reddit, too. I appreciate your help.
In a sandbox, I installed a fresh copy of Firefox, signed in to sync, then installed that About Sync extension. I just had a look through the 'prefs' collection and one entry stood out to me: `privacy.sanitize.sanitizeOnShutdown: true`. What are the chances this is what's responsible for nuking my session? My gut tells me it is. It's the only one out of 30 non-null entries that stood out to me.
Investigating this a bit further, in the sandbox, I installed Firefox ESR (just something I could install alongside mainline Firefox with its own profile etc.) and LibreWolf. I did not sign in to sync in these two. I opened `about:config` in both and checked for the setting `privacy.sanitize.sanitizeOnShutdown`, and sure enough, it's set to `true` by default in LibreWolf, but not in FFESR. Some quick searching indicates this setting's default value is `false` everywhere except in LibreWolf. I guess when I signed in to sync in LibreWolf, the `true` value was synced and picked up everywhere else.
To test the theory, I went back to mainline Firefox, where I'm still signed in to sync, and checked `about:config` for that setting. Of course, it was set to `true`. So I set it to `false`, opened up some windows and tabs, then quit Firefox. Observing the profile folder, the `sessionstore-backups` folder was NOT nuked this time! I opened up Firefox again and my browsing session picked up where I had left off!
So it seems the cause has been identified. I'm really surprised I didn't find any reports on this. Maybe LibreWolf users just aren't signing in to sync in Firefox or other FF forks, and so this just hasn't presented as an issue until now?
Anyway, super huge thank you for helping me troubleshoot this. That extension you recommended was critical for identifying the culprit. I'm not sure how I would've identified it without it.
Read this answer in context 👍 0All Replies (5)
You can back up the bookmarkbackups folder, too. Those are the files used to rebuild places.sqlite if it gets nuked.
Could you install the About Sync extension? It creates a new about:sync page you can use to see what is on the server. There will be sections for each category that you sync, including preferences. My thought is that there is some history-killing preference that Firefox follows. Which doesn't make sense, but, I don't have any other leads.
தீர்வு தேர்ந்தெடுக்கப்பட்டது
Thank you for helping me troubleshoot this. Based on your username, I believe you were helping me troubleshoot over on Reddit, too. I appreciate your help.
In a sandbox, I installed a fresh copy of Firefox, signed in to sync, then installed that About Sync extension. I just had a look through the 'prefs' collection and one entry stood out to me: `privacy.sanitize.sanitizeOnShutdown: true`. What are the chances this is what's responsible for nuking my session? My gut tells me it is. It's the only one out of 30 non-null entries that stood out to me.
Investigating this a bit further, in the sandbox, I installed Firefox ESR (just something I could install alongside mainline Firefox with its own profile etc.) and LibreWolf. I did not sign in to sync in these two. I opened `about:config` in both and checked for the setting `privacy.sanitize.sanitizeOnShutdown`, and sure enough, it's set to `true` by default in LibreWolf, but not in FFESR. Some quick searching indicates this setting's default value is `false` everywhere except in LibreWolf. I guess when I signed in to sync in LibreWolf, the `true` value was synced and picked up everywhere else.
To test the theory, I went back to mainline Firefox, where I'm still signed in to sync, and checked `about:config` for that setting. Of course, it was set to `true`. So I set it to `false`, opened up some windows and tabs, then quit Firefox. Observing the profile folder, the `sessionstore-backups` folder was NOT nuked this time! I opened up Firefox again and my browsing session picked up where I had left off!
So it seems the cause has been identified. I'm really surprised I didn't find any reports on this. Maybe LibreWolf users just aren't signing in to sync in Firefox or other FF forks, and so this just hasn't presented as an issue until now?
Anyway, super huge thank you for helping me troubleshoot this. That extension you recommended was critical for identifying the culprit. I'm not sure how I would've identified it without it.
The privacy.sanitize.sanitizeOnShutdown pref controls the "Clear history when Firefox closes" feature. On its won this wouldn't cause issues with session restore, only when you also clear the history then you lose session data. Note that Firefox 128+ comes with a new clear history dialog that works differently than previous versions regarding cookies and site data.
Maybe you don't want history cleared in LibreWolf either, but in case you did want different preference values in different installations, there a way to block Sync for an individual preference:
(1) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button accepting the risk.
More info on about:config: Configuration Editor for Firefox. The moderators would like us to remind you that changes made through this back door aren't fully supported and aren't guaranteed to continue working in the future.
(2) In the search box in the page, type or paste sanitizeonshutdown and pause while the list is filtered
Firefox should display two preferences that contain this substring
(3) To prevent privacy.sanitize.sanitizeOnShutdown from sync'ing between your "desktop" installs of Firefox, double-click the services.sync.prefs.sync.privacy.sanitize.sanitizeOnShutdown preference to switch the value from true to false
(If you are running different Firefoxes on the same system and want different themes for each, repeat the above method with the filter activethemeid in step (2).)
cor-el said
The privacy.sanitize.sanitizeOnShutdown pref controls the "Clear history when Firefox closes" feature. On its won this wouldn't cause issues with session restore, only when you also clear the history then you lose session data. Note that Firefox 128+ comes with a new clear history dialog that works differently than previous versions regarding cookies and site data.
Well, changing nothing other than that pref seems to have been the solution.
Thinking about this some more, it's strange a `true` value for that pref synced and propagated. I've been using LibreWolf for some time before enabling sync. I'm confident that in my initial setup of LibreWolf, I would've unchecked the setting "Clear history when [LibreWolf] closes", thus, `privacy.sanitize.sanitizeOnShutdown` should have been `false` this whole time. The whole time I've been using it, my history and the rest of my browsing session has persisted between launches. It doesn't make sense that that pref was ever set to `true`.