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

Gecko driver is downloaded everytime I run update #127

Closed
julbra opened this issue Nov 2, 2016 · 5 comments · Fixed by #133
Closed

Gecko driver is downloaded everytime I run update #127

julbra opened this issue Nov 2, 2016 · 5 comments · Fixed by #133

Comments

@julbra
Copy link

julbra commented Nov 2, 2016

Every time I run webdriver-manager update the Gecko driver is refetched:

webdriver-manager: using local installed version 10.2.6
[11:50:26] I/update - chromedriver: file exists /home/julien/workspace/stratos-ui/tools/node_modules/webdriver-manager/selenium/chromedriver_2.25linux64.zip
[11:50:26] I/update - chromedriver: unzipping chromedriver_2.25linux64.zip
[11:50:26] I/update - chromedriver: setting permissions to 0755 for /home/julien/workspace/stratos-ui/tools/node_modules/webdriver-manager/selenium/chromedriver_2.25
[11:50:26] I/update - chromedriver: v2.25 up to date
[11:50:26] I/update - selenium standalone: file exists /home/julien/workspace/stratos-ui/tools/node_modules/webdriver-manager/selenium/selenium-server-standalone-2.53.1.jar
[11:50:26] I/update - selenium standalone: v2.53.1 up to date
[11:50:27] W/file_manager - geckodriver-v0.9.0-linux64.tar.gz expected length undefined, found 1237128
[11:50:27] W/file_manager - removing file: /home/julien/workspace/stratos-ui/tools/node_modules/webdriver-manager/selenium/geckodriver-v0.9.0-linux64.tar.gz
[11:50:27] I/downloader - geckodriver: downloading version v0.9.0
[11:50:27] I/downloader - curl -o /home/julien/workspace/stratos-ui/tools/node_modules/webdriver-manager/selenium/geckodriver-v0.9.0-linux64.tar.gz https://github.com/mozilla/geckodriver/releases/download/v0.9.0/geckodriver-v0.9.0-linux64.tar.gz

Further debugging indicates this is because the gecko driver CDN doesn't seem to contain a Content-Length in the response to a HEAD request.

For example I see the following (no Content-Length response header):

curl -I https://github.com/mozilla/geckodriver/releases/download/v0.9.0/geckodriver-v0.9.0-linux64.tar.gz
HTTP/1.1 302 Found
Server: GitHub.com
Date: Wed, 02 Nov 2016 11:46:48 GMT
Content-Type: text/html; charset=utf-8
Status: 302 Found
Cache-Control: no-cache
Vary: X-PJAX
Location: https://github-cloud.s3.amazonaws.com/releases/25354393/5fc2adc2-3ee7-11e6-83df-3052357e1e27.gz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F20161102%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20161102T114648Z&X-Amz-Expires=300&X-Amz-Signature=0c6404be7412e303067226ccfff8c7503c5da606bf2c0c7a7cf1cd1ee24fb2ac&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dgeckodriver-v0.9.0-linux64.tar.gz&response-content-type=application%2Foctet-stream
X-UA-Compatible: IE=Edge,chrome=1
Set-Cookie: logged_in=no; domain=.github.com; path=/; expires=Sun, 02 Nov 2036 11:46:48 -0000; secure; HttpOnly
Set-Cookie: _gh_sess=eyJzZXNzaW9uX2lkIjoiNWZiNmJkMDk0YTNhOTRlMjJlNmU0OTNkOWVjY2U4M2EiLCJzcHlfcmVwbyI6Im1vemlsbGEvZ2Vja29kcml2ZXIiLCJzcHlfcmVwb19hdCI6MTQ3ODA4NzIwOH0%3D--1ceca64e0eade147902b429bc66aed663032a0d4; path=/; secure; HttpOnly
X-Request-Id: 8e3468f80351edd567fea178d5203808
X-Runtime: 0.019918
Content-Security-Policy: default-src 'none'; base-uri 'self'; block-all-mixed-content; child-src render.githubusercontent.com; connect-src 'self' uploads.github.com status.github.com api.github.com www.google-analytics.com github-cloud.s3.amazonaws.com wss://live.github.com; font-src assets-cdn.github.com; form-action 'self' github.com gist.github.com; frame-ancestors 'none'; frame-src render.githubusercontent.com; img-src 'self' data: assets-cdn.github.com identicons.github.com collector.githubapp.com github-cloud.s3.amazonaws.com *.githubusercontent.com; media-src 'none'; script-src assets-cdn.github.com; style-src 'unsafe-inline' assets-cdn.github.com
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
Public-Key-Pins: max-age=5184000; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; pin-sha256="RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho="; pin-sha256="k2v657xBsOVe1PQRwOsHsw3bsGT2VzIqz5K+59sNQws="; pin-sha256="K87oWBWM9UZfyddvDfoxL+8lpNyoUB2ptGtn0fv6G2Q="; pin-sha256="IQBnNBEiFuhj+8x6X8XLgh01V9Ic5/V3IRQLNFFc7v4="; pin-sha256="iie1VXtL7HzAMF+/PVPR9xzT80kQxdZeJ+zduCB3uj0="; pin-sha256="LvRiGEjRqfzurezaWuj8Wie2gyHMrW5Q06LspMnox7A="; includeSubDomains
X-Content-Type-Options: nosniff
X-Frame-Options: deny
X-XSS-Protection: 1; mode=block
Vary: Accept-Encoding
X-Served-By: a128136e4734a9f74c013356c773ece7
X-GitHub-Request-Id: 0FCBA96A:5E07:791FF81:5819D228

Whereas for Chrome driver I do see the Content-Length response header:

curl -I https://chromedriver.storage.googleapis.com/2.25/chromedriver_linux64.zip
HTTP/1.1 200 OK
X-GUploader-UploadID: AEnB2UpQpgl8YDLoR7hwvYHkJZyXPL5YWR7soni3MQwjoYtlp6vOe2KMQ9X625UYaTTAXicEdZgwrAZZ6XKZBAGAUzqziTDBNA
Expires: Wed, 02 Nov 2016 12:23:46 GMT
Date: Wed, 02 Nov 2016 11:23:46 GMT
Last-Modified: Sat, 22 Oct 2016 02:16:44 GMT
ETag: "16673c4a4262d0f4c01836b5b3b2b110"
x-goog-generation: 1477102604586000
x-goog-metageneration: 1
x-goog-stored-content-encoding: identity
x-goog-stored-content-length: 3141794
Content-Type: application/zip
Content-Language: en
x-goog-hash: crc32c=c9GwdQ==
x-goog-hash: md5=Fmc8SkJi0PTAGDa1s7KxEA==
x-goog-storage-class: STANDARD
Accept-Ranges: bytes
Content-Length: 3141794
Server: UploadServer
Age: 1566
Cache-Control: public, max-age=3600
Alt-Svc: quic=":443"; ma=2592000; v="36,35,34"
@julbra
Copy link
Author

julbra commented Nov 2, 2016

Seems like for Gecko driver the initial response is a redirect!

@julbra
Copy link
Author

julbra commented Nov 2, 2016

Possibly a dupe of #117 but we have more info here.

@heathkit
Copy link
Contributor

heathkit commented Nov 4, 2016

Geckodriver is hosted on GitHub, which redirects to an s3 bucket. I don't think there's a url we could use for geckodriver that wouldn't redirect like that. So, Downloader.httpHeadContentLength needs to be extended to handle redirects to fix this.

@julbra
Copy link
Author

julbra commented Nov 14, 2016

Awesome, fix confirmed in 10.2.8, cheers

@kenhuang
Copy link

kenhuang commented Jun 23, 2017

10.3.0 seems have the same issue

[INFO] $ webdriver-manager update --versions.chrome 2.29
[INFO] [14:52:51] I/file_manager - creating folder .../node_modules/webdriver-manager/selenium
[INFO] [14:52:51] I/downloader - selenium standalone: downloading version 2.53.1
[INFO] [14:52:51] I/downloader - curl -o .../node_modules/webdriver-manager/selenium/selenium-server-standalone-2.53.1.jar https://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar
[INFO] [14:52:51] I/downloader - chromedriver: downloading version 2.29
[INFO] [14:52:51] I/downloader - curl -o .../node_modules/webdriver-manager/selenium/chromedriver_2.29mac64.zip https://chromedriver.storage.googleapis.com/2.29/chromedriver_mac64.zip
[INFO] [14:52:51] I/downloader - geckodriver: downloading version v0.11.1
[INFO] [14:52:51] I/downloader - curl -o .../node_modules/webdriver-manager/selenium/geckodriver-v0.11.1-macos.tar.gz https://github.com/mozilla/geckodriver/releases/download/v0.11.1/geckodriver-v0.11.1-macos.tar.gz
[INFO] [14:52:53] I/update - chromedriver: unzipping .../node_modules/webdriver-manager/selenium/chromedriver_2.29mac64.zip
[INFO] [14:52:53] I/update - chromedriver: setting permissions to 0755 for .../node_modules/webdriver-manager/selenium/chromedriver_2.29
[INFO] [14:52:58] I/update - geckodriver: unzipping .../node_modules/webdriver-manager/selenium/geckodriver-v0.11.1-macos.tar.gz
[INFO] [14:52:58] I/update - geckodriver: setting permissions to 0755 for .../node_modules/webdriver-manager/selenium/geckodriver-v0.11.1

10.2.8 and the latest 12.0.6 works

[INFO] $ webdriver-manager update --versions.chrome 2.29
[INFO] [14:58:57] I/update - chromedriver: file exists .../node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.29mac64.zip
[INFO] [14:58:57] I/update - chromedriver: unzipping chromedriver_2.29mac64.zip
[INFO] [14:58:58] I/update - chromedriver: setting permissions to 0755 for .../node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.29
[INFO] [14:58:58] I/update - chromedriver: v2.29 up to date
[INFO] [14:58:58] I/update - selenium standalone: file exists .../node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-2.53.1.jar
[INFO] [14:58:58] I/update - selenium standalone: v2.53.1 up to date
[INFO] [14:58:59] I/update - geckodriver: file exists .../node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.11.1-macos.tar.gz
[INFO] [14:58:59] I/update - geckodriver: unzipping geckodriver-v0.11.1-macos.tar.gz
[INFO] [14:58:59] I/update - geckodriver: setting permissions to 0755 for .../node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.11.1
[INFO] [14:58:59] I/update - geckodriver: vv0.11.1 up to date

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

Successfully merging a pull request may close this issue.

4 participants