titusfortner / webdrivers

Keep your Selenium WebDrivers updated automatically
MIT License
593 stars 111 forks source link

webdrivers downloaded and instantly removed #147

Closed masterkain closed 5 years ago

masterkain commented 5 years ago

Summary

Library downloads and instantly removes the binaries.

Debug Info

Expected Behavior

Binaries to persist for the CI to run.

Actual Behavior

I tried almost anything to get a Rails 5.2 app working with a chrome/chromium headless instance on docker. this is what happens, even if I run the update webdrivers task bin/rails webdrivers:chromedriver:update before the spec run:

 2019-07-27 21:49:14 INFO Webdrivers Updated to chromedriver

 21:49:15 - INFO - Guard::RSpec is running
 21:49:17 - INFO - Guard is now watching at '/usr/src/app'

 Run options: include {:focus=>true}

 Randomized with seed 37182
 2019-07-27 21:49:54 DEBUG Webdrivers Checking current version
 2019-07-27 21:49:54 DEBUG Webdrivers /usr/src/app/webdrivers/chromedriver is already downloaded
 2019-07-27 21:49:54 DEBUG Webdrivers making System call: ["/usr/src/app/webdrivers/chromedriver", "--version"]
 2019-07-27 21:49:54 DEBUG Webdrivers No Such File or Directory: /usr/src/app/webdrivers/chromedriver
 2019-07-27 21:49:54 DEBUG Webdrivers making System call: ["/usr/bin/chromium-browser", "--product-version"]
 2019-07-27 21:49:54 DEBUG Webdrivers System call returned: 73.0.3683.103

 2019-07-27 21:49:54 DEBUG Webdrivers Browser version: 73.0.3683.103
 2019-07-27 21:49:54 DEBUG Webdrivers Latest version available: 73.0.3683.68
 2019-07-27 21:49:54 DEBUG Webdrivers Deleting /usr/src/app/webdrivers/chromedriver.version
 2019-07-27 21:49:54 DEBUG Webdrivers Deleting /usr/src/app/webdrivers/chromedriver
 2019-07-27 21:49:54 DEBUG Webdrivers making System call: ["/usr/bin/chromium-browser", "--product-version"]
 2019-07-27 21:49:54 DEBUG Webdrivers System call returned: 73.0.3683.103

 2019-07-27 21:49:54 DEBUG Webdrivers Browser version: 73.0.3683.103
 2019-07-27 21:49:54 DEBUG Webdrivers making System call: ["/usr/bin/chromium-browser", "--product-version"]
 2019-07-27 21:49:54 DEBUG Webdrivers System call returned: 73.0.3683.103

 2019-07-27 21:49:54 DEBUG Webdrivers Browser version: 73.0.3683.103
 2019-07-27 21:49:54 DEBUG Webdrivers Making network call to https://chromedriver.storage.googleapis.com/LATEST_RELEASE_73.0.3683
 2019-07-27 21:49:54 DEBUG Webdrivers Get response: #<Net::HTTPOK 200 OK readbody=true>
 2019-07-27 21:49:54 DEBUG Webdrivers Latest version available: 73.0.3683.68
 2019-07-27 21:49:54 DEBUG Webdrivers chromedriver URL: https://chromedriver.storage.googleapis.com/73.0.3683.68/chromedriver_linux64.zip
 2019-07-27 21:49:54 DEBUG Webdrivers Making network call to https://chromedriver.storage.googleapis.com/73.0.3683.68/chromedriver_linux64.zip
 2019-07-27 21:49:57 DEBUG Webdrivers Get response: #<Net::HTTPOK 200 OK readbody=true>
 2019-07-27 21:49:57 DEBUG Webdrivers Successfully downloaded /tmp/20190727-74-opknb3chromedriver_linux64.zip
 2019-07-27 21:49:57 DEBUG Webdrivers Decompressing /tmp/20190727-74-opknb3chromedriver_linux64.zip
 2019-07-27 21:49:57 DEBUG Webdrivers Deleting /usr/src/app/webdrivers/chromedriver
 2019-07-27 21:49:57 DEBUG Webdrivers Completed download and processing of /usr/src/app/webdrivers/chromedriver
 2019-07-27 21:49:58 DEBUG Webdrivers Checking current version
 2019-07-27 21:49:58 DEBUG Webdrivers /usr/src/app/webdrivers/chromedriver is already downloaded
 2019-07-27 21:49:58 DEBUG Webdrivers making System call: ["/usr/src/app/webdrivers/chromedriver", "--version"]
 2019-07-27 21:49:58 DEBUG Webdrivers No Such File or Directory: /usr/src/app/webdrivers/chromedriver
 2019-07-27 21:49:58 DEBUG Webdrivers Deleting /usr/src/app/webdrivers/chromedriver.version
 2019-07-27 21:49:58 DEBUG Webdrivers Deleting /usr/src/app/webdrivers/chromedriver
 2019-07-27 21:49:58 DEBUG Webdrivers making System call: ["/usr/bin/chromium-browser", "--product-version"]
 2019-07-27 21:49:58 DEBUG Webdrivers System call returned: 73.0.3683.103

 2019-07-27 21:49:58 DEBUG Webdrivers Browser version: 73.0.3683.103
 2019-07-27 21:49:58 DEBUG Webdrivers making System call: ["/usr/bin/chromium-browser", "--product-version"]
 2019-07-27 21:49:58 DEBUG Webdrivers System call returned: 73.0.3683.103

 2019-07-27 21:49:58 DEBUG Webdrivers Browser version: 73.0.3683.103
 2019-07-27 21:49:58 DEBUG Webdrivers Making network call to https://chromedriver.storage.googleapis.com/LATEST_RELEASE_73.0.3683
 2019-07-27 21:49:58 DEBUG Webdrivers Get response: #<Net::HTTPOK 200 OK readbody=true>
 2019-07-27 21:49:58 DEBUG Webdrivers Latest version available: 73.0.3683.68
 2019-07-27 21:49:58 DEBUG Webdrivers chromedriver URL: https://chromedriver.storage.googleapis.com/73.0.3683.68/chromedriver_linux64.zip
 2019-07-27 21:49:58 DEBUG Webdrivers Making network call to https://chromedriver.storage.googleapis.com/73.0.3683.68/chromedriver_linux64.zip
 2019-07-27 21:50:01 DEBUG Webdrivers Get response: #<Net::HTTPOK 200 OK readbody=true>
 2019-07-27 21:50:01 DEBUG Webdrivers Successfully downloaded /tmp/20190727-74-b0hch5chromedriver_linux64.zip
 2019-07-27 21:50:01 DEBUG Webdrivers Decompressing /tmp/20190727-74-b0hch5chromedriver_linux64.zip
 2019-07-27 21:50:01 DEBUG Webdrivers Deleting /usr/src/app/webdrivers/chromedriver
 2019-07-27 21:50:01 DEBUG Webdrivers Completed download and processing of /usr/src/app/webdrivers/chromedriver

I have no parallel spec, disabled bootsnap, disabled spring, tested with a single spec, no guard etc.

the volume is mounted in docker as local named volume but behavior doesn't change with other volumes types or none at all.

 Failures:

   1) OmniAuth users links blabla test
      Got 0 failures and 2 other errors:

      1.1) Failure/Error: visit('/account')

           ChildProcess::LaunchError:
             No such file or directory - /usr/src/app/webdrivers/chromedriver

ENV WD_INSTALL_DIR=/usr/src/app/webdrivers

kapoorlakshya commented 5 years ago

@masterkain Does it work if you don't set WD_INSTALL_DIR to the mounted volume and use the default ~/.webdrivers instead?

tchia04 commented 5 years ago

I get the "Deleting .../chroemdriver" message in the log file even it's working. I am suspecting maybe it's a permission issue. Can you try setting WD_INSTALL_DIR to somewhere where you should have write permission such as /tmp/ or ~/ ? Are you able to run it on your own laptop?

kapoorlakshya commented 5 years ago

I also think it is a permissions issue based on this:

 2019-07-27 21:49:54 DEBUG Webdrivers /usr/src/app/webdrivers/chromedriver is already downloaded
 2019-07-27 21:49:54 DEBUG Webdrivers making System call: ["/usr/src/app/webdrivers/chromedriver", "--version"]
 2019-07-27 21:49:54 DEBUG Webdrivers No Such File or Directory: /usr/src/app/webdrivers/chromedriver

The file is found, but webdrivers isn't able to extract the version. Also, the file is not being deleted at the end as shown in the log (2019-07-27 21:50:01 DEBUG Webdrivers Deleting /usr/src/app/webdrivers/chromedriver). That line is being logged incorrectly and has been fixed under 1af4557db4a86d17e5a47ae0c774c99a14ddb812.

I recommend trying a different location where you have proper permissions (maybe your project root?) and see if you get the same error. I am closing this Issue for now, but I'd happy to debug this further when you respond.

masterkain commented 5 years ago

hello, sorry I had to move on quick and had not time to get back to this issue, I thank everyone for their continued support; I plan to test again soon, will report back any finding, your work is always appreciated. 🥇

Thomas-Nedap commented 4 years ago

seeing a similar issue with a similar env : Alpine Linux container, any call to update or run the Webdrivers endup with a file in the expected path but not ability to use it as calls to it will always endup with "No such file or directory". User is root so I don't know how permissions would matter here.

yanghoxom commented 1 year ago

Hello, I get a similar problem and I found the reason for me in the logic, I set to use chrome as the browser but I only install chromium on OS then, I install chrome and everything works well sorry for my panic English, hope this helps you.