0

I have a prod server with

sudo apt-get install libnss3-dev xvfb firefox-esr

get the last geckodriver on https://github.com/mozilla/geckodriver/releases => ~/.webdrivers/

If I try :

browser = Watir::Browser.new :firefox, headless: Rails.env.production?

on local I get

#<Watir::Browser:0x..fb8c41c0f25bde49e url="about:blank" title="">

on production :

Traceback (most recent call last):
        2: from (irb):1
        1: from (irb):1:in `new'
Net::ReadTimeout (Net::ReadTimeout)

I have no more log anywhere... how can I slove this?

CONFIG:

ruby -v
ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux]
rails -v
Rails 6.0.2.2

Gemfile.lock

GIT
  remote: https://github.com/Compass/compass-rails.git
  revision: be1f7516a8e781bedc6bd3cc34d5395c7c72b3f3
  specs:
    compass-rails (3.1.0)
      compass (~> 1.0.0)
      sass-rails (< 5.1)
      sprockets (< 4.0)

GEM
  remote: https://rubygems.org/
  specs:
    actioncable (6.0.0)
      actionpack (= 6.0.0)
      nio4r (~> 2.0)
      websocket-driver (>= 0.6.1)
    actionmailbox (6.0.0)
      actionpack (= 6.0.0)
      activejob (= 6.0.0)
      activerecord (= 6.0.0)
      activestorage (= 6.0.0)
      activesupport (= 6.0.0)
      mail (>= 2.7.1)
    actionmailer (6.0.0)
      actionpack (= 6.0.0)
      actionview (= 6.0.0)
      activejob (= 6.0.0)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 2.0)
    actionpack (6.0.0)
      actionview (= 6.0.0)
      activesupport (= 6.0.0)
      rack (~> 2.0)
      rack-test (>= 0.6.3)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.2.0)
    actiontext (6.0.0)
      actionpack (= 6.0.0)
      activerecord (= 6.0.0)
      activestorage (= 6.0.0)
      activesupport (= 6.0.0)
      nokogiri (>= 1.8.5)
    actionview (6.0.0)
      activesupport (= 6.0.0)
      builder (~> 3.1)
      erubi (~> 1.4)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.1, >= 1.2.0)
    activejob (6.0.0)
      activesupport (= 6.0.0)
      globalid (>= 0.3.6)
    activemodel (6.0.0)
      activesupport (= 6.0.0)
    activerecord (6.0.0)
      activemodel (= 6.0.0)
      activesupport (= 6.0.0)
    activestorage (6.0.0)
      actionpack (= 6.0.0)
      activejob (= 6.0.0)
      activerecord (= 6.0.0)
      marcel (~> 0.3.1)
    activesupport (6.0.0)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (>= 0.7, < 2)
      minitest (~> 5.1)
      tzinfo (~> 1.1)
      zeitwerk (~> 2.1, >= 2.1.8)
    addressable (2.7.0)
      public_suffix (>= 2.0.2, < 5.0)
    bcrypt (3.1.13)
    bindex (0.8.1)
    binding_of_caller (0.8.0)
      debug_inspector (>= 0.0.1)
    builder (3.2.3)
    byebug (11.0.1)
    childprocess (3.0.0)
    chunky_png (1.3.11)
    coderay (1.1.2)
    coffee-rails (5.0.0)
      coffee-script (>= 2.2.0)
      railties (>= 5.2.0)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.12.2)
    compass (1.0.3)
      chunky_png (~> 1.2)
      compass-core (~> 1.0.2)
      compass-import-once (~> 1.0.5)
      rb-fsevent (>= 0.9.3)
      rb-inotify (>= 0.9)
      sass (>= 3.3.13, < 3.5)
    compass-core (1.0.3)
      multi_json (~> 1.0)
      sass (>= 3.3.0, < 3.5)
    compass-import-once (1.0.5)
      sass (>= 3.2, < 3.5)
    concurrent-ruby (1.1.5)
    connection_pool (2.2.2)
    crass (1.0.5)
    debug_inspector (0.0.3)
    domain_name (0.5.20190701)
      unf (>= 0.0.5, < 1.0.0)
    eco (1.0.0)
      coffee-script
      eco-source
      execjs
    eco-source (1.1.0.rc.1)
    em-websocket (0.5.1)
      eventmachine (>= 0.12.9)
      http_parser.rb (~> 0.6.0)
    erubi (1.9.0)
    eventmachine (1.2.7)
    execjs (2.7.0)
    facets (3.1.0)
    faraday (0.17.0)
      multipart-post (>= 1.2, < 3)
    ffi (1.11.1)
    formatador (0.2.5)
    fullcalendar-rails (3.9.0.0)
      jquery-rails (>= 4.0.5, < 5.0.0)
      jquery-ui-rails (>= 5.0.2)
      momentjs-rails (>= 2.9.0)
    globalid (0.4.2)
      activesupport (>= 4.2.0)
    guard (2.16.1)
      formatador (>= 0.2.4)
      listen (>= 2.7, < 4.0)
      lumberjack (>= 1.0.12, < 2.0)
      nenv (~> 0.1)
      notiffany (~> 0.0)
      pry (>= 0.9.12)
      shellany (~> 0.0)
      thor (>= 0.18.1)
    guard-compat (1.2.1)
    guard-livereload (2.5.2)
      em-websocket (~> 0.5)
      guard (~> 2.8)
      guard-compat (~> 1.0)
      multi_json (~> 1.8)
    hashie (3.6.0)
    headless (2.3.1)
    http-cookie (1.0.3)
      domain_name (~> 0.5)
    http_parser.rb (0.6.0)
    i18n (1.7.0)
      concurrent-ruby (~> 1.0)
    image_size (2.0.2)
    jquery-rails (4.3.5)
      rails-dom-testing (>= 1, < 3)
      railties (>= 4.2.0)
      thor (>= 0.14, < 2.0)
    jquery-ui-rails (6.0.1)
      railties (>= 3.2.16)
    json (2.2.0)
    jwt (2.2.1)
    koala (3.0.0)
      addressable
      faraday
      json (>= 1.8)
    libv8 (3.16.14.19)
    listen (3.1.5)
      rb-fsevent (~> 0.9, >= 0.9.4)
      rb-inotify (~> 0.9, >= 0.9.7)
      ruby_dep (~> 1.2)
    loofah (2.3.1)
      crass (~> 1.0.2)
      nokogiri (>= 1.5.9)
    lumberjack (1.0.13)
    mail (2.7.1)
      mini_mime (>= 0.1.1)
    marcel (0.3.3)
      mimemagic (~> 0.3.2)
    mechanize (2.7.6)
      domain_name (~> 0.5, >= 0.5.1)
      http-cookie (~> 1.0)
      mime-types (>= 1.17.2)
      net-http-digest_auth (~> 1.1, >= 1.1.1)
      net-http-persistent (>= 2.5.2)
      nokogiri (~> 1.6)
      ntlm-http (~> 0.1, >= 0.1.1)
      webrobots (>= 0.0.9, < 0.2)
    method_source (0.9.2)
    mime-types (3.3)
      mime-types-data (~> 3.2015)
    mime-types-data (3.2019.1009)
    mimemagic (0.3.3)
    mini_magick (4.9.5)
    mini_mime (1.0.2)
    mini_portile2 (2.4.0)
    minitest (5.13.0)
    momentjs-rails (2.20.1)
      railties (>= 3.1)
    multi_json (1.14.1)
    multi_xml (0.6.0)
    multipart-post (2.1.1)
    mysql2 (0.5.2)
    nenv (0.3.0)
    net-http-digest_auth (1.4.1)
    net-http-persistent (3.1.0)
      connection_pool (~> 2.2)
    nio4r (2.5.2)
    nokogiri (1.10.5)
      mini_portile2 (~> 2.4.0)
    nokogumbo (2.0.1)
      nokogiri (~> 1.8, >= 1.8.4)
    notiffany (0.1.3)
      nenv (~> 0.1)
      shellany (~> 0.0)
    ntlm-http (0.1.1)
    oauth2 (1.4.2)
      faraday (>= 0.8, < 2.0)
      jwt (>= 1.0, < 3.0)
      multi_json (~> 1.3)
      multi_xml (~> 0.5)
      rack (>= 1.2, < 3)
    oily_png (1.2.1)
      chunky_png (~> 1.3.7)
    omniauth (1.9.0)
      hashie (>= 3.4.6, < 3.7.0)
      rack (>= 1.6.2, < 3)
    omniauth-facebook (5.0.0)
      omniauth-oauth2 (~> 1.2)
    omniauth-oauth2 (1.6.0)
      oauth2 (~> 1.1)
      omniauth (~> 1.9)
    os (1.0.1)
    pry (0.12.2)
      coderay (~> 1.1.0)
      method_source (~> 0.9.0)
    psych (3.1.0)
    public_suffix (4.0.1)
    puma (4.2.1)
      nio4r (~> 2.0)
    rack (2.0.7)
    rack-livereload (0.3.17)
      rack
    rack-protection (2.0.7)
      rack
    rack-test (1.1.0)
      rack (>= 1.0, < 3)
    rails (6.0.0)
      actioncable (= 6.0.0)
      actionmailbox (= 6.0.0)
      actionmailer (= 6.0.0)
      actionpack (= 6.0.0)
      actiontext (= 6.0.0)
      actionview (= 6.0.0)
      activejob (= 6.0.0)
      activemodel (= 6.0.0)
      activerecord (= 6.0.0)
      activestorage (= 6.0.0)
      activesupport (= 6.0.0)
      bundler (>= 1.3.0)
      railties (= 6.0.0)
      sprockets-rails (>= 2.0.0)
    rails-dom-testing (2.0.3)
      activesupport (>= 4.2.0)
      nokogiri (>= 1.6)
    rails-html-sanitizer (1.3.0)
      loofah (~> 2.3)
    rails-timeago (2.18.0)
      actionpack (>= 3.1)
      activesupport (>= 3.1)
    railties (6.0.0)
      actionpack (= 6.0.0)
      activesupport (= 6.0.0)
      method_source
      rake (>= 0.8.7)
      thor (>= 0.20.3, < 2.0)
    rake (13.0.0)
    rb-fsevent (0.10.3)
    rb-inotify (0.10.0)
      ffi (~> 1.0)
    redis (4.1.3)
    redis-namespace (1.6.0)
      redis (>= 3.0.4)
    ref (2.0.0)
    regexp_parser (1.6.0)
    ruby_dep (1.5.0)
    rubyzip (1.3.0)
    sanitize (5.1.0)
      crass (~> 1.0.2)
      nokogiri (>= 1.8.0)
      nokogumbo (~> 2.0)
    sass (3.4.25)
    sass-rails (5.0.8)
      railties (>= 5.2.0)
      sass (~> 3.1)
      sprockets (>= 2.8, < 4.0)
      sprockets-rails (>= 2.0, < 4.0)
      tilt (>= 1.1, < 3)
    selenium-webdriver (3.142.6)
      childprocess (>= 0.5, < 4.0)
      rubyzip (>= 1.2.2)
    shellany (0.0.1)
    sidekiq (5.2.7)
      connection_pool (~> 2.2, >= 2.2.2)
      rack (>= 1.5.0)
      rack-protection (>= 1.5.0)
      redis (>= 3.3.5, < 5)
    sidekiq-limit_fetch (3.4.0)
      sidekiq (>= 4)
    spring (2.1.0)
    spring-watcher-listen (2.0.1)
      listen (>= 2.7, < 4.0)
      spring (>= 1.2, < 3.0)
    sprockets (3.7.2)
      concurrent-ruby (~> 1.0)
      rack (> 1, < 3)
    sprockets-rails (3.2.1)
      actionpack (>= 4.0)
      activesupport (>= 4.0)
      sprockets (>= 3.0.0)
    therubyracer (0.12.3)
      libv8 (~> 3.16.14.15)
      ref
    thor (0.20.3)
    thread_safe (0.3.6)
    tilt (2.0.10)
    turbolinks (5.2.1)
      turbolinks-source (~> 5.2)
    turbolinks-source (5.2.0)
    tzinfo (1.2.5)
      thread_safe (~> 0.1)
    uglifier (3.2.0)
      execjs (>= 0.3.0, < 3)
    unf (0.1.4)
      unf_ext
    unf_ext (0.0.7.6)
    watir (6.16.5)
      regexp_parser (~> 1.2)
      selenium-webdriver (~> 3.6)
    watir-screenshot-stitch (0.7.1)
      binding_of_caller (~> 0.7)
      mini_magick (~> 4.0)
      os (~> 1.0)
      rubyzip (~> 1.2)
      watir (~> 6.12)
    watir-scroll (0.4.0)
      watir (>= 6.0)
    web-console (4.0.1)
      actionview (>= 6.0.0)
      activemodel (>= 6.0.0)
      bindex (>= 0.4.0)
      railties (>= 6.0.0)
    webdriver-user-agent (7.6)
      facets
      json
      os
      psych
      selenium-webdriver (>= 3.4.0)
    webdrivers (4.1.3)
      nokogiri (~> 1.6)
      rubyzip (>= 1.3.0)
      selenium-webdriver (>= 3.0, < 4.0)
    webrobots (0.1.2)
    websocket-driver (0.7.1)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.4)
    zeitwerk (2.2.1)

PLATFORMS
  ruby

DEPENDENCIES
  bcrypt (~> 3.1.7)
  byebug
  coffee-rails (>= 4.2.0)
  compass-rails!
  eco
  fullcalendar-rails
  guard (>= 2.1.0)
  guard-livereload
  headless
  image_size (~> 2.0)
  jquery-rails (>= 4.0.5)
  jquery-ui-rails (>= 4.2.1)
  koala
  listen (>= 3.0.5, < 3.2)
  mechanize
  momentjs-rails
  mysql2
  oily_png
  omniauth-facebook
  puma
  rack-livereload
  rails (>= 5.2)
  rails-timeago (~> 2.0)
  rb-fsevent
  redis
  redis-namespace
  sanitize
  sass-rails
  sidekiq (~> 5.2)
  sidekiq-limit_fetch
  spring
  spring-watcher-listen (~> 2.0.0)
  therubyracer
  turbolinks (~> 5)
  tzinfo-data
  uglifier (~> 3.2.0)
  watir
  watir-screenshot-stitch
  watir-scroll
  web-console (>= 3.3.0)
  webdriver-user-agent
  webdrivers

BUNDLED WITH
   2.0.2
Matrix
  • 3,458
  • 6
  • 40
  • 76
  • I have answered here https://stackoverflow.com/questions/59731079/ruby-watir-how-to-avoid-closing-browser-from-netreadtimeout/59731948#59731948 – Rajagopalan Apr 19 '20 at 03:11
  • I don't use `goto` at this time, it's not a problem with time to load page... the problem is elsewhere... in local, just open firefox take less thant 5 seconds... – Matrix Apr 19 '20 at 08:08
  • `(Net::ReadTimeout)` happens only when use goto or when you click next button but next page did not show up until 60 seconds. This 60 seconds can be increased via the code Imentioned. – Rajagopalan Apr 20 '20 at 05:05
  • ok I see, there is goto on my code, but I increase timeout and nothing change... – Matrix Apr 20 '20 at 13:59
  • How did you increase your time? Can you post that code? And which selenium version is yours? – Rajagopalan Apr 20 '20 at 14:42
  • 1
    set `$DEBUG = true` to get a full log of all the things Watir/Selenium. You get a `Net::ReadTimeout` error whenever a command is sent to a driver and never gets a response. The Ruby code gives up after a certain period of time. Often for things like `goto` this is an issue with the network and the page not loading and the browser never telling the driver that it is done. In your case, something seems to be wrong with the create session command, so you'll want to investigate the route/payload you are attempting to send to the driver. – titusfortner Apr 21 '20 at 22:00
  • where I put `$DEBUG = true` exactly? – Matrix Apr 22 '20 at 12:52
  • @Rajagopalan with `Selenium::WebDriver.logger.level = :error`, I find this : `JavaScript error: undefined, line 14: Error: An unexpected error occurred JavaScript error: moz-extension://3ca80d3f-2663-4d02-8137-d6a2bf0d8728/lib/picture_in_picture_overrides.js, line 15: Error: Incorrect argument types for pictureInPictureParent.setOverrides. JavaScript error: resource:///modules/sessionstore/SessionStore.jsm, line 1325: uncaught exception: 2147746065` an idea? – Matrix Apr 22 '20 at 14:15

0 Answers0