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

"A headless Firefox is already running" #59

Closed
olleharstedt opened this issue Jul 9, 2018 · 23 comments
Closed

"A headless Firefox is already running" #59

olleharstedt opened this issue Jul 9, 2018 · 23 comments

Comments

@olleharstedt
Copy link

olleharstedt commented Jul 9, 2018

I get

A headless Firefox is already running

after starting browsh, quitting with ctrl-q and then starting it again.

@tombh
Copy link
Member

tombh commented Jul 9, 2018

What OS is that on? It's probably the fact that after closing Browsh it didn't manage to correctly quit the accompanying headless Firefox process. So you can probably do something like: kill $(ps aux|grep headless|tr -s ' ' | cut -d ' ' -f2)

But of course I need to fix the fact that Firefox didn't get closed after your first CTRL+q. If it keeps happening can you run browsh with the -debug arg and paste the output of ./debug.log here. Thank you.

@olleharstedt
Copy link
Author

Xubuntu. Note that I'm also running selenium with headless Firefox in the background for my test suits. Will try the debug mode.

@olleharstedt
Copy link
Author

Hm, hard to reproduce the issue...

@tombh
Copy link
Member

tombh commented Jul 9, 2018

Ah! Ok, the test for a detecting an existing Firefox is actually very crude at the moment. It just detects any headless Firefox, so they'll definitely by a false positive with your selenium session. Ok, then I know how to fix that. Added a new issue for that #61.

@tombh tombh closed this as completed Jul 9, 2018
@olleharstedt
Copy link
Author

👍

@olleharstedt
Copy link
Author

Tip: Save the pid of the correct Firefox process. ;)

@tombh
Copy link
Member

tombh commented Jul 9, 2018

Haha, doh! Yes of course :D

@puthre
Copy link

puthre commented Nov 18, 2020

Same issue here, however I see that the headless firefox started by browsh is still running
1035612 ? Sl 0:02 /usr/lib/firefox/firefox --marionette --headless --profile /home/puthre/.config/browsh/firefox_profile 1035663 ? Sl 0:00 \_ /usr/lib/firefox/firefox -contentproc -childID 1 -isForBrowser -prefsLen 1 -prefMapSize 226319 -parentBuildID 20201108180448 -appdir /usr/lib/firefox/browser 1035612 true tab 1035723 ? Sl 0:00 \_ /usr/lib/firefox/firefox -contentproc -childID 2 -isForBrowser -prefsLen 6480 -prefMapSize 226319 -parentBuildID 20201108180448 -appdir /usr/lib/firefox/browser 1035612 true tab 1035772 ? Sl 0:00 \_ /usr/lib/firefox/firefox -contentproc -childID 3 -isForBrowser -prefsLen 8682 -prefMapSize 226319 -parentBuildID 20201108180448 -appdir /usr/lib/firefox/browser 1035612 true tab

It happened again a few times, after I received
"read tcp 127.0.0.1:3334->127.0.0.1:44356: read: connection reset by peer"

@buzzdan
Copy link

buzzdan commented Dec 17, 2020

happens to me as well...

@basbebe
Copy link

basbebe commented Jul 13, 2021

+1, macOS 11

@shmup
Copy link

shmup commented Jul 16, 2022

+1, Fedora 36

@profitrollgame
Copy link

+1, Debian 11

@hussam-qasem
Copy link

+1, CentOS 7.9

@martin-braun
Copy link

martin-braun commented Jan 27, 2023

@tombh Please re-open this issue. It happened to me when I got "read tcp 127.0.0.1:3334->127.0.0.1:60896: read: connection reset by peer". Now I cannot start browsh, because Firefox still runs. browsh should attempt to use the existing headless Firefox session if it's already running, please.

Just for the record, sure I killed Firefox so things work again, the error was unlucky coincidence, still a bummer that browsh can't pickup a headless client after it lost it.

@tombh
Copy link
Member

tombh commented Feb 2, 2023

#61 is a different problem?

@martin-braun
Copy link

@tombh Sorry, really missed that, thanks for linking it again.

@Kizuna-Meraki
Copy link

Kizuna-Meraki commented Feb 16, 2023

+1
browsh 1.8.0
Mozilla Firefox 109.0.1
macOS Ventura 13.2

if I wait long enough, I can use browsh again without getting the error message "A headless Firefox is already running"

@Kishlay-notabot
Copy link

+1 on termux

@Kishlay-notabot
Copy link

Kishlay-notabot commented Jan 10, 2024

@tombh
@olleharstedt
One thing to add, it happens with the curl installation of browsh but not the linux one i picked from the site. This might answer why is it hard to reproduce

@tombh
Copy link
Member

tombh commented Jan 10, 2024

If anybody's on Windows there's a fix in the main branch that should address this: #502

@Kishlay-notabot
Copy link

@tombh
Oh, I feel like I should implement this on the linux side only if I knew Android dev.. I want to work on this. Can you tell me some prerequisites to do it? As in programming languages needed or understanding of other topics and at how much depth? I already have some experience with python and many other langs or topics. (if I just mention my programming experience, it's diverse but surface level)
Thanks

@tombh
Copy link
Member

tombh commented Jan 10, 2024

I think termux is a different beast altogether. To be honest, I don't think Browsh should be run directly on Android, rather it should be connected to a remote server via SSH, or better yet, MoSH. That's how I designed Browsh.

@martin-braun
Copy link

@tombh Oh wow, thanks for bringing mosh onto my radar, I was looking for this some time ago without luck. Input lag on SSH is annoying.

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

No branches or pull requests