Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot start Firefox (or FirefoxHeadless) 121 on macOS Sonoma 14.2.1 (23C71) #328

Closed
mgol opened this issue Jan 8, 2024 · 9 comments · Fixed by #330
Closed

Cannot start Firefox (or FirefoxHeadless) 121 on macOS Sonoma 14.2.1 (23C71) #328

mgol opened this issue Jan 8, 2024 · 9 comments · Fixed by #330

Comments

@mgol
Copy link
Contributor

mgol commented Jan 8, 2024

I cannot start Firefox (or FirefoxHeadless) 121 on macOS Sonoma 14.2.1 (23C71). It used to work on that very OS a few weeks ago, possibly with Firefox 120. EDIT: confirmed - this issue will affect everyone on recent macOS running Firefox 121 or newer.

A very simple test case doesn't work, just follow instructions from https://github.com/mgol/karma-test. When doing so, I am getting:

$ npm test 

> test
> karma start

09 01 2024 00:04:55.436:INFO [karma-server]: Karma v6.4.2 server started at http://localhost:9876/
09 01 2024 00:04:55.437:INFO [launcher]: Launching browsers ChromeHeadless, FirefoxHeadless with concurrency unlimited
09 01 2024 00:04:55.439:INFO [launcher]: Starting browser ChromeHeadless
09 01 2024 00:04:55.441:INFO [launcher]: Starting browser FirefoxHeadless
09 01 2024 00:04:55.446:ERROR [launcher]: Cannot start FirefoxHeadless
	
09 01 2024 00:04:55.446:ERROR [launcher]: FirefoxHeadless stdout: 
09 01 2024 00:04:55.446:ERROR [launcher]: FirefoxHeadless stderr: 
09 01 2024 00:04:55.447:INFO [launcher]: Trying to start FirefoxHeadless again (1/2).
09 01 2024 00:04:55.451:ERROR [launcher]: Cannot start FirefoxHeadless
	
09 01 2024 00:04:55.451:ERROR [launcher]: FirefoxHeadless stdout: 
09 01 2024 00:04:55.451:ERROR [launcher]: FirefoxHeadless stderr: 
09 01 2024 00:04:55.451:INFO [launcher]: Trying to start FirefoxHeadless again (2/2).
09 01 2024 00:04:55.455:ERROR [launcher]: Cannot start FirefoxHeadless
	
09 01 2024 00:04:55.455:ERROR [launcher]: FirefoxHeadless stdout: 
09 01 2024 00:04:55.455:ERROR [launcher]: FirefoxHeadless stderr: 
09 01 2024 00:04:55.455:ERROR [launcher]: FirefoxHeadless failed 2 times (cannot start). Giving up.
09 01 2024 00:04:55.606:INFO [Chrome Headless 120.0.6099.199 (Mac OS 10.15.7)]: Connected on socket kepyKrJsYaeTHzTRAAAB with id 45000797
Chrome Headless 120.0.6099.199 (Mac OS 10.15.7): Executed 1 of 1 SUCCESS (0.001 secs / 0 secs)
TOTAL: 1 SUCCESS

The error message is the same as in #93. However, I am running it directly on a normal OS, not behind Docker.

@Krinkle
Copy link
Contributor

Krinkle commented Jan 10, 2024

I can reproduce this after upgrading to the latest Firefox, Firefox 121.0.1 (64-bit), with macOS 13, and an Apple M1 processor.

If you enable logLevel: 'DEBUG' in karma.conf.js, there is a bit more detail:

10 01 2024 15:30:03.664:DEBUG [plugin]: Loading karma-* from /Users/krinkle/Temp/karma-test/node_modules
10 01 2024 15:30:03.666:DEBUG [plugin]: Loading plugin /Users/krinkle/Temp/karma-test/node_modules/karma-chrome-launcher.
10 01 2024 15:30:03.668:DEBUG [plugin]: Loading plugin /Users/krinkle/Temp/karma-test/node_modules/karma-firefox-launcher.
10 01 2024 15:30:03.670:DEBUG [plugin]: Loading plugin /Users/krinkle/Temp/karma-test/node_modules/karma-qunit.
10 01 2024 15:30:03.672:DEBUG [web-server]: Instantiating middleware
10 01 2024 15:30:03.682:INFO [karma-server]: Karma v6.4.2 server started at http://localhost:9876/
10 01 2024 15:30:03.682:INFO [launcher]: Launching browsers FirefoxHeadless with concurrency unlimited
10 01 2024 15:30:03.684:INFO [launcher]: Starting browser FirefoxHeadless
10 01 2024 15:30:03.684:DEBUG [launcher]: null -> BEING_CAPTURED
10 01 2024 15:30:03.684:DEBUG [temp-dir]: Creating temp dir at /var/folders/_5/khc4z6kx4nbg4mn5wxyzbsn40000gn/T/karma-8869174
10 01 2024 15:30:03.685:DEBUG [launcher]: /Applications/Firefox.app/Contents/MacOS/firefox-bin http://localhost:9876/?id=8869174 -profile /var/folders/_5/khc4z6kx4nbg4mn5wxyzbsn40000gn/T/karma-8869174 -no-remote -wait-for-browser -headless --start-debugger-server 6000
10 01 2024 15:30:03.721:DEBUG [launcher]: Process FirefoxHeadless exited with code null and signal SIGKILL
10 01 2024 15:30:03.721:ERROR [launcher]: Cannot start FirefoxHeadless
	
10 01 2024 15:30:03.721:ERROR [launcher]: FirefoxHeadless stdout: 
10 01 2024 15:30:03.721:ERROR [launcher]: FirefoxHeadless stderr: 
10 01 2024 15:30:03.721:DEBUG [temp-dir]: Cleaning temp dir /var/folders/_5/khc4z6kx4nbg4mn5wxyzbsn40000gn/T/karma-8869174
10 01 2024 15:30:03.723:INFO [launcher]: Trying to start FirefoxHeadless again (1/2).
[…]

This is reproducible even without Karma:

$ /Applications/Firefox.app/Contents/MacOS/firefox-bin
Killed: 9

Hence this is more about Firefox generally no longer working from the command-line, and not something Karma can do anything about. I suspect it has something to do with the security mechanisms in macOS disallowing the process to run from the Terminal application. Perhaps Mozilla changed the way it signs the Firefox binary? Or perhaps Firefox changed the way it replaces the binary during an upgrade that makes macOS treat it as suspicious.

Possibly related:

@Krinkle
Copy link
Contributor

Krinkle commented Jan 10, 2024

@mgol
Copy link
Contributor Author

mgol commented Jan 12, 2024

This issue will affect everyone on recent macOS running Firefox 121 or newer.

@JoeWhetzel
Copy link

JoeWhetzel commented Jan 30, 2024

I've been able to patch a workaround by replacing the firefox-bin executable with a symlink that pointed to the firefox executable;

sudo mv /Applications/Firefox.app/Contents/MacOS/firefox-bin /Applications/Firefox.app/Contents/MacOS/firefox-bin.old
sudo ln -s /Applications/Firefox.app/Contents/MacOS/firefox /Applications/Firefox.app/Contents/MacOS/firefox-bin

So my guess would be that if in karma-firefox-launcher/index.js the line
const suffix = '.app/Contents/MacOS/firefox-bin'
were replaced with
const suffix = '.app/Contents/MacOS/firefox'
it may work.

@Finesse
Copy link

Finesse commented Jan 31, 2024

This issue will affect everyone on recent macOS

It also happens on macOS 11.7.10 on an Intel processor

ray-lee added a commit to collectionspace/.github that referenced this issue Feb 2, 2024
This attempts to avoid a bug starting Firefox on Mac:

karma-runner/karma-firefox-launcher#328
ray-lee added a commit to collectionspace/.github that referenced this issue Feb 2, 2024
This attempts to avoid a bug starting Firefox on Mac:

karma-runner/karma-firefox-launcher#328
ray-lee added a commit to collectionspace/cspace-ui.js that referenced this issue Feb 2, 2024
ray-lee added a commit to ray-lee/cspace-api.js that referenced this issue Feb 2, 2024
@mgol
Copy link
Contributor Author

mgol commented Feb 3, 2024

It also happens on macOS 11.7.10 on an Intel processor

Right; the issue is independent on the macOS version, it affects all Firefox versions from 121 on any macOS version. Basically, right now karma-firefox-launcher is completely broken for all macOS users.

@birtles @ewinslow I know this is not a security fix but considering that without PR #330 this package is not working at all on macOS and that the fix is a one-liner, is there any chance of merging it & releasing a new version?

@mgol
Copy link
Contributor Author

mgol commented Feb 5, 2024

@pmvald Thanks for merging #330. Any chance for a new release now so that we can use this fix?

ray-lee added a commit to ray-lee/cspace-refname.js that referenced this issue Feb 5, 2024
ray-lee added a commit to ray-lee/cspace-client.js that referenced this issue Feb 5, 2024
ray-lee added a commit to ray-lee/cspace-layout.js that referenced this issue Feb 5, 2024
ray-lee added a commit to ray-lee/cspace-input.js that referenced this issue Feb 5, 2024
ray-lee added a commit to ray-lee/cspace-ui-plugin-record-material.js that referenced this issue Feb 5, 2024
ray-lee added a commit to ray-lee/cspace-ui-plugin-record-osteology.js that referenced this issue Feb 5, 2024
ray-lee added a commit to ray-lee/cspace-ui-plugin-record-taxon.js that referenced this issue Feb 6, 2024
ray-lee added a commit to ray-lee/cspace-ui-plugin-ext-accessionattributes.js that referenced this issue Feb 6, 2024
ray-lee added a commit to ray-lee/cspace-ui-plugin-ext-accessionuse.js that referenced this issue Feb 6, 2024
ray-lee added a commit to ray-lee/cspace-ui-plugin-ext-annotation.js that referenced this issue Feb 6, 2024
ray-lee added a commit to ray-lee/cspace-ui-plugin-ext-culturalcare.js that referenced this issue Feb 6, 2024
ray-lee added a commit to ray-lee/cspace-ui-plugin-ext-livingplant.js that referenced this issue Feb 6, 2024
ray-lee added a commit to ray-lee/cspace-ui-plugin-ext-locality.js that referenced this issue Feb 6, 2024
ray-lee added a commit to ray-lee/cspace-ui-plugin-ext-nagpra.js that referenced this issue Feb 6, 2024
ray-lee added a commit to ray-lee/cspace-ui-plugin-ext-naturalhistory.js that referenced this issue Feb 6, 2024
ray-lee added a commit to ray-lee/cspace-ui-plugin-profile-anthro.js that referenced this issue Feb 6, 2024
ray-lee added a commit to ray-lee/cspace-ui-plugin-profile-bonsai.js that referenced this issue Feb 6, 2024
ray-lee added a commit to ray-lee/cspace-ui-plugin-profile-botgarden.js that referenced this issue Feb 6, 2024
ray-lee added a commit to ray-lee/cspace-ui-plugin-profile-fcart.js that referenced this issue Feb 6, 2024
ray-lee added a commit to ray-lee/cspace-ui-plugin-profile-herbarium.js that referenced this issue Feb 6, 2024
ray-lee added a commit to ray-lee/cspace-ui-plugin-profile-lhmc.js that referenced this issue Feb 6, 2024
ray-lee added a commit to ray-lee/cspace-ui-plugin-profile-materials.js that referenced this issue Feb 6, 2024
ray-lee added a commit to ray-lee/cspace-ui-plugin-profile-publicart.js that referenced this issue Feb 6, 2024
meel-io added a commit to Financial-Times/next-session-client that referenced this issue Feb 12, 2024
This issue has been raised on karma-firefox-launcher but it's yet
to be released
karma-runner/karma-firefox-launcher#328
ray-lee added a commit to ray-lee/cspace-public-browser.js that referenced this issue Feb 14, 2024
@Krinkle
Copy link
Contributor

Krinkle commented Mar 3, 2024

@XhmikosR @pmvald Would you be able to publish a release for the above? Alternatively, I'd be happy to help myself if you'd be comfortable with me having Git write and npm co-owner access for this package (ref karma-runner/karma-qunit#185).

Krinkle added a commit to qunitjs/qunit that referenced this issue Mar 3, 2024
Krinkle added a commit to qunitjs/qunit that referenced this issue Mar 3, 2024
@XhmikosR
Copy link

XhmikosR commented Mar 4, 2024

@Krinkle I don't even have rights myself 😛

IIRC I only had rights in karma-qunit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants