On Thu, Mar 04, 2021 at 07:30:18AM +0000, RJ Johnson wrote:
> When creating a new profile (on first launch or with "firefox -P"),
> Firefox fails to create the
> "~/.mozilla/firefox/<profile>/storage/permanent" folder.
> 
> I have observed this behavior with Firefox 85, 86, and 78esr, although
> more versions are likely affected. This behavior was observed on a
> machine running -current.
> 
> The two most obvious symptoms of this failure are the browser's Web
> Developer tools showing no page source in the Inspector tab (non-esr)
> and various error messages in the Browser Console relating to IndexedDB.
> 
> This failure is caused by unveil. When creating a profile, Firefox
> begins checking each directory in the path
> "/home/<user>/.mozilla/firefox/<profile>/storage/permanent" for
> existence (i.e., "/home" then "/home/<user>" then ...). If any directory
> in this chain does not exist, Firefox gives up on creating the
> "permanent" folder. This is easily observed in a ktrace. (I did
> "ktrace -id firefox -P". Search for "permanent".) Since Firefox has no
> access to "/home" (despite having access to the profile folder), the
> "permanent" folder is never created.
> 
> The easiest way to fix this issue, for profiles both new and old, is to
> manually create the "permanent" folder after Firefox creates the profile
> for you. Once this folder exists, Firefox seems to have no more issues.
> It only has trouble creating this folder initially.

That's a good finding. Someone (tm) (not me) with enough motivation
should look into fixing that in the code. Looking for 'PERMANENT' on
searchfox.org, the corresponding codepath seems to be around
https://searchfox.org/mozilla-central/source/dom/quota/ActorsParent.cpp#3548

im not 100% sure at all, but *maybe* the method creating the dir
hierarchy is
https://searchfox.org/mozilla-central/source/xpcom/io/nsLocalFileUnix.cpp#360 .

Or somewhere else. That's a 'nice' maze.. Good luck !

Landry

Reply via email to