[macOS 27] geckodriver fails to start Firefox up to version 157 with error "Profile missing"
Categories
(Testing :: geckodriver, defect, P2)
Tracking
(Not tracked)
People
(Reporter: whimboo, Assigned: whimboo)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [webdriver:m22])
Attachments
(1 external file)
Bug 2060476 and bug 2069536 describe changes in the recently released macOS 27 (Golden Gate) that affect how Firefox application data is accessed.
As summarized by Haik in bug 2069536, unsigned Firefox builds or any build launched directly from the terminal via the executable (for example, /Applications/Firefox.app/Contents/MacOS/firefox) can no longer access ~/Library/Application Support/Firefox unless Terminal has been granted access to Firefox data in the macOS Privacy & Security settings.
As discussed with Haik, geckodriver should set both MOZ_APP_DATA and MOZ_LOCAL_APP_DATA to temporary directories under its control. A possible layout would be a single temporary root directory containing:
- the application data directory,
- the local application data directory, and
- the Firefox profile.
This would not only address the macOS 27 restrictions but also provide complete isolation between individual Firefox instances.
The fixes in bug 2069536 mean that this will no longer be an issue starting with Firefox 158 (currently in Beta, scheduled for release on October 13). Since macOS 27 was released on September 14, we should discuss whether geckodriver requires an immediate fix and release, or whether this can wait given that the issue primarily affects users running older Firefox versions. So far, we haven't received any reports from users, and most are likely testing against the current release rather than ESR or older builds.
Regardless of the release timing, setting MOZ_APP_DATA and MOZ_LOCAL_APP_DATA should work across all supported platforms and provides better isolation of Firefox instances. As such, it seems worthwhile to implement this change independent of the macOS-specific issue.
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 1•1 month ago
|
||
Proposed approach for geckodriver:
For each session that starts a local Firefox, geckodriver creates a single temporary root directory (inside --profile-root if given), laid out as:
geckodriver<random>/
├── AppData/ -> MOZ_APP_DATA
├── LocalAppData/ -> MOZ_LOCAL_APP_DATA
└── rust_mozprofile<random>/ -> Firefox profile
Details:
- Both temporary profiles and profiles passed in via the
moz:firefoxOptions.profilecapability are placed in this root. A profile given via--profile <path>inargsstays where it is; the root then only contains the app data directories. MOZ_APP_DATAandMOZ_LOCAL_APP_DATAare checked separately and only set if not already defined in geckodriver's environment. Firefox reads them independently (nsXREDirProvider::GetUserDataDirectory), so a user-provided value for either one is kept. Note that mozrunner and Marionette only checkMOZ_APP_DATA, so they overwrite a user-setMOZ_LOCAL_APP_DATA.- Named profiles (
-P name) are excluded: no root is created and neither variable is set. Firefox looks up the profile inprofiles.iniin the application data directory, which is either the system default or a custom one set viaMOZ_APP_DATAin geckodriver's environment, so the environment is passed through unchanged. - The whole root is removed when the browser instance is torn down.
- Android and connecting to an existing Firefox are unaffected.
This fixes startup of Firefox <= 157 on macOS 27 and also fully isolates the Firefox instances from each other and from the user's own Firefox data on all platforms.
| Assignee | ||
Comment 2•1 month ago
|
||
(In reply to Henrik Skupin [:whimboo][⌚️UTC+2] from comment #1)
MOZ_APP_DATAandMOZ_LOCAL_APP_DATAare checked separately and only set if not already defined in geckodriver's environment. Firefox reads them independently (nsXREDirProvider::GetUserDataDirectory), so a user-provided value for either one is kept. Note that mozrunner and Marionette only checkMOZ_APP_DATA, so they overwrite a user-setMOZ_LOCAL_APP_DATA.
Dave, I actually didn't notice that when reviewing your Marionette patch. What is the reason that we override user-set MOZ_LOCAL_APP_DATA? Should we behave the same in geckodriver?
Comment 3•1 month ago
|
||
(In reply to Henrik Skupin [:whimboo][⌚️UTC+2] from comment #2)
(In reply to Henrik Skupin [:whimboo][⌚️UTC+2] from comment #1)
MOZ_APP_DATAandMOZ_LOCAL_APP_DATAare checked separately and only set if not already defined in geckodriver's environment. Firefox reads them independently (nsXREDirProvider::GetUserDataDirectory), so a user-provided value for either one is kept. Note that mozrunner and Marionette only checkMOZ_APP_DATA, so they overwrite a user-setMOZ_LOCAL_APP_DATA.Dave, I actually didn't notice that when reviewing your Marionette patch. What is the reason that we override user-set
MOZ_LOCAL_APP_DATA? Should we behave the same in geckodriver?
I think I just didn't consider the case where someone sets MOZ_LOCAL_APP_DATA but not MOZ_APP_DATA. Seems fine to allow the user to override that by themselves if they want to.
| Assignee | ||
Comment 4•1 month ago
|
||
Updated•1 month ago
|
Description
•