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.

There are two other possible "fixes" involving unveil which I include
for completeness only. Both of these changes can be reverted after
running Firefox once with them applied. The first is to disable
"unveil.main". The second is to add:

/home r
~ r

to "unveil.main". This allows the directory existence checks to pass,
and Firefox happily creates the "permanent" folder.

Reply via email to