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

webdriver-manager update command throws unhandled error. #239

Closed
AdityaDaksha opened this issue Apr 24, 2017 · 42 comments
Closed

webdriver-manager update command throws unhandled error. #239

AdityaDaksha opened this issue Apr 24, 2017 · 42 comments

Comments

@AdityaDaksha
Copy link

AdityaDaksha commented Apr 24, 2017

C:**>webdriver-manager update
events.js:160
throw er; // Unhandled 'error' event
^

Error: connect ETIMEDOUT 172.217.7.16:443
at Object.exports._errnoException (util.js:1022:11)
at exports._exceptionWithHostPort (util.js:1045:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1087:14)

C:**>webdriver-manager version
[19:52:31] I/version - webdriver-manager 12.0.4

C:**>protractor --version
Version 5.1.1

C:**>ng -v
@angular/cli: 1.0.0-rc.1
node: 6.10.0
os: win32 x64
@angular/common: 2.4.9
@angular/compiler: 2.4.9
@angular/core: 2.4.9
@angular/forms: 2.4.9
@angular/http: 2.4.9
@angular/platform-browser: 2.4.9
@angular/platform-browser-dynamic: 2.4.9
@angular/router: 3.4.9
@angular/cli: 1.0.0-rc.1
@angular/compiler-cli: 2.4.9

@cnishina
Copy link
Member

Are you behind a firewall? This looks like you are trying to do the https call to the selenium-release.storage.googleapis.com or chromedriver.storage.googleapis.com.

A good way to test this is browsing to:

https://chromedriver.storage.googleapis.com/
https://selenium-release.storage.googleapis.com/

If you are behind a proxy, then you should use the following flags:

  --ignore_ssl                Ignore SSL certificates
  --proxy                     Proxy to use for the install or update command

@AdityaDaksha
Copy link
Author

I am able to browse:
https://chromedriver.storage.googleapis.com/
https://selenium-release.storage.googleapis.com/

I can see XMLs on hitting above links.

C:**>webdriver-manager update --ignore_ssl
[12:10:51] I/http_utils - ignoring SSL certificate
[12:10:51] I/http_utils - ignoring SSL certificate
[12:10:51] I/http_utils - ignoring SSL certificate
events.js:160
throw er; // Unhandled 'error' event
^

Error: connect ETIMEDOUT 192.30.253.117:443
at Object.exports._errnoException (util.js:1022:11)
at exports._exceptionWithHostPort (util.js:1045:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1087:14)

Can you please let me know the exact command to ignore ssl and other proxy option you mentioned above.

@AdityaDaksha
Copy link
Author

Any comments?

@pyalam01
Copy link

pyalam01 commented May 9, 2017

Hi, I am also facing the same issue. I tried to execute "webriver-manager update" with corporate proxy and without proxy too and I am seeing the same unhandled error event. I tried tracert to the googleapis and the trace was completed without any issues.

Node : v6.10.3
npm : 3.10.10
protractor : 5.1.1
webdriver-manager : 12.0.5

PS C:\WINDOWS\system32> webdriver-manager update
webdriver-manager: using global installed version 12.0.5
[16:32:35] I/file_manager - creating folder C:\Users\A591572\AppData\Roaming\npm\node_modules\webdriver-manager\selenium

events.js:160
throw er; // Unhandled 'error' event
^

Error: connect ETIMEDOUT 192.30.253.116:443
at Object.exports._errnoException (util.js:1018:11)
at exports._exceptionWithHostPort (util.js:1041:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14)
PS C:\WINDOWS\system32>

Troubleshoot method 1 : I tried to debug the issue by manually installing selenium server jar and chromedriver exe through npm install (npm install -g seleniumxxxxxx.jar and chromedriver). selenium server jar download was successful and to my surprise, chromedriver was throwing the following error.

C:\Users\XXXXXXXX\AppData\Roaming\npm\chromedriver -> C:\Users\XXXXXXXX\AppData\Roaming\npm\node_modules\chromedriver\bin
chromedriver

chromedriver@2.29.0 install C:\Users\A591572\AppData\Roaming\npm\node_modules\chromedriver
node install.js

Downloading https://chromedriver.storage.googleapis.com/2.29/chromedriver_win32.zip
Saving to C:\Users\XXXXXXXX\AppData\Local\Temp\chromedriver\chromedriver_win32.zip
Receiving...
ChromeDriver installation failed Error with http request: { 'cache-control': 'no-cache',
pragma: 'no-cache',
'content-type': 'text/html; charset=utf-8',
'proxy-connection': 'close',
connection: 'close',
'content-length': '727',
'x-rbt-optimized-by': 'NEWGWS (RiOS 9.1.3a) IK' }
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "ins
tall" "-g" "chromedriver"
npm ERR! node v6.10.3
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! chromedriver@2.29.0 install: node install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the chromedriver@2.29.0 install script 'node install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the chromedriver package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs chromedriver
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls chromedriver
npm ERR! There is likely additional logging output above.

Troubleshoot method 2 : I downloaded the jar and chromedriver exe (3.4.0 jar and 2.29) from cdn urls to selenium folder manually and exceuted "webdriver-manager status" command and got the below output.

PS C:\WINDOWS\system32> webdriver-manager status
webdriver-manager: using global installed version 12.0.5
[16:33:46] I/status - selenium standalone version available: 3.4.0
[16:33:46] I/status - chromedriver version available: 2.29
[16:33:46] I/status - geckodriver is not present
[16:33:46] I/status - IEDriverServer is not present
[16:33:46] I/status - android-sdk is not present
[16:33:46] I/status - appium is not present

Now I executed "webdriver-manager start" command and getting the same unhandled event error.

PS C:\WINDOWS\system32> webdriver-manager start
webdriver-manager: using global installed version 12.0.5
events.js:160
throw er; // Unhandled 'error' event
^

Error: connect ETIMEDOUT 216.58.216.208:443
at Object.exports._errnoException (util.js:1018:11)
at exports._exceptionWithHostPort (util.js:1041:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14)

Could someone look into this issue.

@cnishina
Copy link
Member

cnishina commented May 9, 2017

@AdityaDaksha This is a network environment issue. I cannot reproduce your error on my end just with the ignore_ssl flag.

webdriver-manager update --ignore_ssl
webdriver-manager: using project version 12.0.5
[09:29:32] I/file_manager - creating folder /Users/cnishina/src/webdriver-manager/selenium
[09:29:32] I/http_utils - ignoring SSL certificate
[09:29:32] I/http_utils - ignoring SSL certificate
[09:29:32] I/http_utils - ignoring SSL certificate
[09:29:33] I/http_utils - ignoring SSL certificate
[09:29:33] I/http_utils - ignoring SSL certificate
[09:29:33] I/http_utils - ignoring SSL certificate
[09:29:35] I/update - chromedriver: unzipping chromedriver_2.29.zip
[09:29:35] I/update - chromedriver: setting permissions to 0755 for /Users/cnishina/src/webdriver-manager/selenium/chromedriver_2.29
[09:29:37] I/update - geckodriver: unzipping geckodriver-v0.16.1.tar.gz
[09:29:37] I/update - geckodriver: setting permissions to 0755 for /Users/cnishina/src/webdriver-manager/selenium/geckodriver-v0.16.1

@pyalam01 I would ask about your network setup. I have not tried the chromedriver node module. If both are having issues, I would see if you need to pass additional flags if you are behind a corporate proxy.

@pyalam01
Copy link

@cnishina : Yes, I am behind a corporate proxy, so I tried with and without proxy too but no luck. By passing --ignore_ssl flag, here is what I see.
PS C:\WINDOWS\system32> webdriver-manager update --ignore_ssl
webdriver-manager: using global installed version 12.0.5
[09:35:26] I/http_utils - ignoring SSL certificate
[09:35:26] I/http_utils - ignoring SSL certificate
[09:35:26] I/http_utils - ignoring SSL certificate
events.js:160
throw er; // Unhandled 'error' event
^
Error: connect ETIMEDOUT 172.217.0.16:443
at Object.exports._errnoException (util.js:1018:11)
at exports._exceptionWithHostPort (util.js:1041:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14)

@jnal
Copy link

jnal commented May 10, 2017

I get the same problem as pyalam01. I am behind corporate proxy and I took the same route of downloading chromedriver_2.29.exe and selenium-server-standalone-3.4.0.jar manually and place them on the selenium folder of protractor\node_modules\webdriver-manager\selenium

when trying to update..

node webdriver-manager update --ignore_ssl
[13:50:09] I/http_utils - ignoring SSL certificate
[13:50:09] I/http_utils - ignoring SSL certificate
[13:50:09] I/http_utils - ignoring SSL certificate
[13:50:09] I/http_utils - ignoring SSL certificate
(node:17736) UnhandledPromiseRejectionWarning: Unhandled promise rejection (reje
ction id: 1): Error: response status code is not 200
[13:50:11] I/update - geckodriver: file exists xxxxx\node_modules\protractor\node_modules\webdriver-manager
\selenium\geckodriver-v0.16.1.zip
[13:50:11] I/update - geckodriver: unzipping geckodriver-v0.16.1.zip
[13:50:12] I/update - geckodriver: geckodriver-v0.16.1.exe up to date
(node:17736) UnhandledPromiseRejectionWarning: Unhandled promise rejection (reje
ction id: 2): Error: response status code is not 200
node webdriver-manager status
[14:01:43] I/status - selenium standalone version available: 3.4.0
[14:01:43] I/status - chromedriver version available: 2.29
[14:01:43] I/status - geckodriver version available: v0.16.1
[14:01:43] I/status - IEDriverServer is not present
[14:01:43] I/status - android-sdk is not present
[14:01:43] I/status - appium is not present

Here's the error when I start webdriver-manager

node webdriver-manager start --ignore_ssl
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: unable to get local issuer certificate
    at Error (native)
    at TLSSocket.<anonymous> (_tls_wrap.js:1085:38)
    at emitNone (events.js:86:13)
    at TLSSocket.emit (events.js:185:7)
    at TLSSocket._finishInit (_tls_wrap.js:603:8)
    at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:433:38)

@stevegraygh
Copy link

stevegraygh commented May 29, 2017

@pyalam01 I had the same issue, but then when I used the proxy switch too, eg
webdriver-manager update --ignore_ssl --proxy http://xxx.xxx.xxx.xxx:xxxx
it got further

webdriver-manager: using global installed version 12.0.6
[15:15:04] I/http_utils - ignoring SSL certificate
[15:15:04] I/http_utils - ignoring SSL certificate
[15:15:04] I/http_utils - ignoring SSL certificate
[15:15:05] I/http_utils - ignoring SSL certificate
[15:15:05] I/http_utils - ignoring SSL certificate
[15:15:12] I/update - chromedriver: unzipping chromedriver_2.29.zip

@stevegraygh
Copy link

@AdityaDaksha see my comment above, replace with your proxy ip and port number

@stevegraygh
Copy link

stevegraygh commented May 29, 2017

now I'm getting similar to @jnal node:14044) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: response status code is not 200. It was 503

@clarkj
Copy link

clarkj commented Jun 7, 2017

I am also experiencing what @jnal and @stevegraygh are experiencing. Did either of you find workarounds?

After running
webdriver-manager update --proxy http://my-proxy.com:8000 --ignore_ssl

webdriver-manager: using global installed version 12.0.6
[12:02:55] I/http_utils - ignoring SSL certificate
[12:02:55] I/http_utils - ignoring SSL certificate
[12:02:55] I/http_utils - ignoring SSL certificate
[12:02:55] I/http_utils - ignoring SSL certificate
[12:02:55] I/http_utils - ignoring SSL certificate
[12:02:55] I/update - chromedriver: file exists C:\Users\clarkj1\AppData\Roaming\npm\node_modules\webdriver-manager\selenium\chromedriver_2.29.zip
[12:02:55] I/update - chromedriver: unzipping chromedriver_2.29.zip
[12:02:55] I/update - chromedriver: chromedriver_2.29.exe up to date
[12:02:55] I/update - selenium standalone: file exists C:\Users\clarkj1\AppData\Roaming\npm\node_modules\webdriver-manager\selenium\selenium-server-standalone-3.4.0.jar
[12:02:55] I/update - selenium standalone: selenium-server-standalone-3.4.0.jar up to date
(node:24612) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: response status code is not 200.  It was 503
(node:24612) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

It hangs for a few minutes after the final update before the rejected promise.

@cnishina
Copy link
Member

cnishina commented Jun 7, 2017

I believe this is related to an issue I'm working through on geckodriver. #257. I haven't had much time to debug this so for now:

webdriver-manager update --proxy http://my-proxy.com:8000 --ignore_ssl --gecko false

This is definitely something around GeckoDriver downloading from Github. I almost have a working test that can duplicate this set up.

@alastairtree
Copy link

I have the same issue, and is caused by our corporate proxy requiring a custom certificate be installed so monitoringcan man in the middle all https requests for "security".
Optimal solution would be for webdriver-manager to trust all certs in the local windows certificate store. Failing that providing an option to pass the certificate path on the CLI would be more secure than ignoring all SSL errors.

@deepen168
Copy link

I am facing the same issue as well, anyone found resolution yet?

@moinuddin14
Copy link

@stevegraygh Thanks. Both the webdriver-manager update && webdriver-manager start are working fine, when i use them as below.

webdriver-manager update --ignore-ssl --proxy http://XXX.XXX.XXX:80
webdriver-manager start --ignore-ssl --proxy http://XXX.XXX.XXX:80

@LiaoYunheLuke
Copy link

I am using internal nexus repo and can not get it working.

I try to configure ".npmrc" to get it from local path but still face same unhandled error, did i missed anything?

chromedriver_filepath=D:\temp/chromedriver/chromedriver_win32.zip
geckodriver_filepath=D:\temp/chromedriver/geckodriver-v0.18.0-win64.zip

@trinadhsidda
Copy link

trinadhsidda commented Nov 11, 2017

I am running webdriver-manager start under corporate proxy (no internet) and we don't have a proxy provided, we are geeting the same error as below. Is there way to start webdriver-manager without proxy to test an intranet application ?

events.js:160
throw er; // Unhandled 'error' event
^

@cnishina
Copy link
Member

cnishina commented Nov 11, 2017

The command update downloads files. It then creates an update-config.json that has the binaries downloaded. The information from that file is used to start the selenium standalone server and also for direct connect for Protractor. If you are behind a corporate proxy, not using the update feature, and using a selenium-standalone server, I suggest to start it up with a java command.

@tbuffry
Copy link

tbuffry commented Nov 29, 2017

run your command as administrator may also help :)

@amir-khademi
Copy link

in my case, it was because Google has been blocked its web server for my region (Iran). using a proxy fixed it.

@kedziorm
Copy link

I'm also facing the same issue - the proxy blocks access to the resource. I copied appropriate files (web drivers and selenium-server) from the machine that is in different proxy. However it is not resolving my issue.
I receive the error not only in case of webdriver-manager update, but also in case of webdriver-manager start. This makes webdriver-manager start useless for me, since there's no possibility to switch off checking for the latest version of chromedrivers and selenium (according to https://stackoverflow.com/questions/50128987/protractor-installed-in-offline-mode-error-for-webdriver-manager-start-what)

Will it be possible to either:

  1. Change error to warning, so that it will be still possible (although not with the latest version) to start webdriver-manager on the machines without Internet access?
  2. Add parameter to switch off checking for the latest version.
  3. Provide improved error message, information that it was not possible to connect to: {url}

@ghost
Copy link

ghost commented Aug 28, 2018

Anyone has been able to use webdriver-manager behind a firewall without proxy?

@cnishina
Copy link
Member

@kedziorm Please try out https://github.com/cnishina/webdriver-manager-replacement. A lot more testing went around how update and start works. Previously I had the start command refresh to update just in case it wasn't fresh. My replacement does not make web calls at all during start. It is currently a work in progress and limited to running webdriver-manager start to launch the selenium server standalone. It does not work with Protractor's direct (directConnect) or local or if you are running Appium tests.

@cnishina
Copy link
Member

cnishina commented Aug 28, 2018

@MichelleGuoFRB I am not sure about your firewall. Wouldn't you just add an exception for trusted URLs? If you try to download one by one (download just ChromDriver webdriver-manager update --gecko false --standalone false) you can find the hosts they are downloading from. Geckodriver request goes to github then has a redirect to aws. If you need sample URLs / curl commands, let me know.

@ghost
Copy link

ghost commented Aug 28, 2018

@cnishina Thank you! My bowser can access those URLs, so I will addthose URLs in and try it.

Another question is: I tried it from a public computer, it worked all fine without issue, just following Protractor page worked. However, when I put that computer in airplane mode, webdriver-manager doesn't start any more does it need to stay with internet connection in order to start webdriver-manager?

@cnishina
Copy link
Member

Oh no! I think this is a known bug. Please try out this one instead: https://github.com/cnishina/webdriver-manager-replacement. See the above notes on limitations. I am looking for feedback. If it is broken, I want to fix the replacement.

@ghost
Copy link

ghost commented Aug 28, 2018

@cnishina I download the zip and ran install with 'npm i -D Webdriver-manager-replacement' and it finished install. When I tried to run 'webdriver-manager start', I got this error:

(node:14088) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory

@cnishina
Copy link
Member

@MichelleGuoFRB in your script for your project, make sure you are using webdriver-manager-replacement:

"scripts": {
  "webdriver-manager": "webdriver-manager"  // this works because the bin file has a 
                                            // webdriver-manager-replacement and 
                                            // webdriver-manager option.
}

Then you can do the following:

npm run webdriver-manager update
npm run webdriver-manager start

You will also need node 8.

@ghost
Copy link

ghost commented Aug 28, 2018

@cnishina thanks. Did you mean like below? Is this part of the conf.js?

"scripts": {
"webdriver-manager": "webdriver-manager-replacement”
}

Would modeJS 10 not good?

@cnishina
Copy link
Member

cnishina commented Aug 28, 2018

That would work too (in the above script code snippet). Sorry I meant to say greater than node 8. Wow, are we on node 10 already?

@ghost
Copy link

ghost commented Aug 28, 2018

@cnishina yes the most recent node.js is version 10.

I am new to Protractor. I followed the instruction fro protractor page https://www.protractortest.org/#/. It is pretty straight forward to follow. The issue is that step 'webdriver-manager update' had errors since it is trying to access external IPs which my network doesn't allow.

I appreciate that you brought webdriver-manager-replacement, but the command 'npm run webdriver-manager-replacement update', it doesn't run. This is Windows environment. Could you provide the procedures for getting webdriver-manager launched on localhost:4444 using webdriver-manager-replacement, which is what the purpose for having webdriver-manager, so protractor can talk to it

@cnishina
Copy link
Member

In your above script: You should run: npm run webdriver-manager update. I also did half the development on Windows so it should work.

@trinadhsidda
Copy link

Yes, we can run webdriver-manager without proxy. When you run webdriver start, firstly it would try to update and start. When it tries updating it requires internet.
We can skip this activity by running selenium standalone server jar manually.

@BilalChughtai
Copy link

This worked for me based on above comments:

First run:
webdriver-manager --proxy http://XXX.XXX.XXX:80 update

Then:
webdriver-manager start

Strangely, it didn't work if I do: webdriver-manager --proxy http://XXX.XXX.XXX:80 start

@vishwanathshettyk
Copy link

If you are behind Corporate proxy then do below.

webdriver-manager update --proxy http://my-proxy.com:8000 --ignore_ssl

@Fieel
Copy link

Fieel commented Dec 18, 2018

I had the exact same problems, not being able to update, having ssl and proxy errors.
I ran the following command and was able to update:

webdriver-manager update --proxy=http://*myCompanyProxy*/ --ignore_ssl

@syedahaider97
Copy link

Make sure to check your HTTP_PROXY and HTTPS_PROXY as well. Mine was incorrectly configured, would override the local changes.

@cnishina
Copy link
Member

Closing this disucssion. webdriver-manager-replacement is now webdriver-manager 13. The original issue has been resolved.

@Dallasss7
Copy link

Closing this disucssion. webdriver-manager-replacement is now webdriver-manager 13. The original issue has been resolved.

is there any fix for this for 12.1.7? webdriver-manager 13 is not available yet as far as I can tell.

@solomon2530
Copy link

I was facing a similar issue with the update.

When I was scratching my head looking at all possible solutions on online forums, I was doing it sitting it at my office desk using the corporate WiFi.

I tried resuming doing it at home using personal WiFi.

It worked.

So, if you are in the same boat, my suggestion would be to connect it to a non-corporate network and try it.

@SidV7
Copy link

SidV7 commented Apr 10, 2020

I'm facing the same issue. I'm behind a corporate network and webdriver-manager update does not work. However when connected to home network it works fine. What needs to be done to get it working in corporate network??

@SidV7
Copy link

SidV7 commented Apr 10, 2020

@cnishina
ok, so i was able to run these commands in corporate network
webdriver-manager update --proxy=http://xxx.xxx.xxx:8080
webdriver-manager start --proxy=http://xxx.xxx.xxx:8080

The binaries got downloaded and the selenium server started on 4444. But now when i'm trying to run the test cases
npm run e2e - getting the TIMEOUT error but don't face this error outside VPN. Do i need to invoke npm run e2e differently?

C:\Users\xxx\Workspace\Angular\angular-with-cucumber>npm run e2e

angular-with-cucumber@0.0.0 e2e C:\Users\xxx\Workspace\Angular\angular-with-cucumber
ng e2e

[16:02:15] I/config_source - curl -oC:\Users\xxx\Workspace\Angular\angular-with-cucumber\node_modules\protractor\node_modules\webdriver-manager\selenium\chrome-response.xml https://chromedriver.storage.googleapis.com/
events.js:288
throw er; // Unhandled 'error' event
^

Error: connect ETIMEDOUT 172.217.9.16:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16)
Emitted 'error' event on Request instance at:
at Request.onRequestError (C:\Users\xxx\Workspace\Angular\angular-with-cucumber\node_modules\request\request.js:877:8)
at ClientRequest.emit (events.js:323:22)
at TLSSocket.socketErrorListener (_http_client.js:426:9)
at TLSSocket.emit (events.js:311:20)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ETIMEDOUT',
code: 'ETIMEDOUT',
syscall: 'connect',
address: '172.217.9.16',
port: 443
}

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

No branches or pull requests