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

Browser start fails with JRuby on Windows #400

Open
jemelyah opened this issue Sep 13, 2023 · 0 comments
Open

Browser start fails with JRuby on Windows #400

jemelyah opened this issue Sep 13, 2023 · 0 comments
Labels

Comments

@jemelyah
Copy link

jemelyah commented Sep 13, 2023

OS: Microsoft Windows Server 2019 Datacenter
JRuby version: 9.3.7.0
Ferrum version: 0.13
Chrome version: 116.0.5845.187

I am running Ferrum with JRuby on Windows, here is the console output:

irb(main):001:0> require 'ferrum'
=> true
irb(main):002:0> Ferrum::Browser.new

DevTools listening on ws://127.0.0.1:58272/devtools/browser/7398fe06-bb62-4914-babc-fcf395f9aba0
�[1mTraceback�[m (most recent call last):
       13: from C:/jruby-9.3.7.0/bin/jirb:13:in `<main>'
       12: from org/jruby/RubyKernel.java:1237:in `catch'
       11: from org/jruby/RubyKernel.java:1237:in `catch'
       10: from org/jruby/RubyKernel.java:1507:in `loop'
        9: from org/jruby/RubyKernel.java:1091:in `eval'
        8: from (irb):2:in `evaluate'
        7: from org/jruby/RubyClass.java:881:in `new'
        6: from C:/jruby-9.3.7.0/lib/ruby/gems/shared/gems/ferrum-0.13/lib/ferrum/browser.rb:131:in `initialize'
        5: from C:/jruby-9.3.7.0/lib/ruby/gems/shared/gems/ferrum-0.13/lib/ferrum/browser.rb:269:in `start'
        4: from C:/jruby-9.3.7.0/lib/ruby/gems/shared/gems/ferrum-0.13/lib/ferrum/browser/process.rb:27:in `start'
        3: from org/jruby/RubyKernel.java:1938:in `tap'
        2: from C:/jruby-9.3.7.0/lib/ruby/gems/shared/gems/ferrum-0.13/lib/ferrum/browser/process.rb:102:in `start'
        1: from C:/jruby-9.3.7.0/lib/ruby/gems/shared/gems/ferrum-0.13/lib/ferrum/browser/process.rb:157:in `parse_ws_url'
�[1mFerrum::ProcessTimeoutError (�[4mBrowser did not produce websocket url within 10 seconds, try to increase `:process_timeout`. See https://github.com/rubycdp/ferrum#customization�[0;1m)�[m

I see that Chrome process starts and outputs to the same output (JRuby console), soparse_ws_url cannot receive the output line.

I have rewritten the process startup to use Java ProcessBuilder and write to a specific output file instead of a standard output device, which solves this particular issue. I will open a PR with a potential solution.

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

No branches or pull requests

2 participants