unable to execute 'webdriver-manager update' for protractor - node.js

When i tried to installing protractor in my office PC, I am getting stuck at the step 'webdriver-manager update' in the command terminal.I did not face this obstacle when I tried the command in my personal laptop.The error thrown is as below,
C:\Users\616356>webdriver-manager update
[10:45:09] I/config_source - curl -o C:\Users\616356\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium\standalone-response.xml
https://selenium-release.storage.googleapis.com/
[10:45:09] I/config_source - curl -o C:\Users\616356\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium\chrome-response.xml
https://chromedriver.storage.googleapis.com/
[10:45:09] I/config_source - curl -o C:\Users\616356\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium\gecko-response.json
https://api.github.com/repos/mozilla/geckodriver/releases
events.js:165
throw er; // Unhandled 'error' event
^
Error: connect ECONNREFUSED 172.217.166.112:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1174:14)
Emitted 'error' event at:
at Request.onRequestError (C:\Users\616356\AppData\Roaming\npm\node_modules\protractor\node_modules\request\request.js:881:8)
at ClientRequest.emit (events.js:185:15)
at TLSSocket.socketErrorListener (_http_client.js:395:9)
at TLSSocket.emit (events.js:180:13)
at emitErrorNT (internal/streams/destroy.js:64:8)
at process._tickCallback (internal/process/next_tick.js:178:19)
I think the issue might be regarding some firewall or proxy problem.I tried adding 172.217.166.112 in the proxy exceptions, it didn't work.I just don't know how to resolve this issue.Any suggestions would be appreciated.

example like this
webdriver-manager update --proxy http://TPESproxy.galileo.corp.lcl:8980

Related

Node.js Error: Unexpected server response: 301 - Running a Node.js Websocket server on Namecheap Webhost

I'm trying to setup a Node.js Websocket server over at my webhost (Namecheap). However, I am getting this error:
events.js:292
throw er; // Unhandled 'error' event
^
Error: Unexpected server response: 301
at ClientRequest.<anonymous> (D:\****\node_modules\ws\lib\websocket.js:576:7)
at ClientRequest.emit (events.js:315:20)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:596:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:119:17)
at TLSSocket.socketOnData (_http_client.js:469:22)
at TLSSocket.emit (events.js:315:20)
at addChunk (_stream_readable.js:295:12)
at readableAddChunk (_stream_readable.js:271:9)
at TLSSocket.Readable.push (_stream_readable.js:212:10)
at TLSWrap.onStreamRead (internal/stream_base_commons.js:186:23)
Emitted 'error' event on WebSocket instance at:
at abortHandshake (D:\****\node_modules\ws\lib\websocket.js:694:15)
at ClientRequest.<anonymous> (D:\****\node_modules\ws\lib\websocket.js:576:7)
[... lines matching original stack trace ...]
at TLSSocket.Readable.push (_stream_readable.js:212:10)
The code for the client and server came from here:
https://github.com/websockets/ws#Simple server
https://github.com/websockets/ws#sending-and-receiving-text-data
with ws://www.host.com/path changed to ws://<mydomainname>/<dir1>/<dir2>
Both client and server code runs properly when run locally. Http related code runs properly when used on my webhost. I am trying to get the client code to run locally and connect via websockets to my server hosted at Namecheap.
I suspect something related to the server is preventing connection. I'd ask support but I doubt if they can resolve this. Maybe there's a locked feature or something? Is there something else I could have missed?
Websockets cannot work on Namecheap's hosted servers. Their incoming ports are blocked and cannot be opened for security reasons per their customer's support.
If anyone is looking for a solution just in case, try out a Heroku free account.

How to fix RequestError: Error: connect ETIMEDOUT while running Mocha JS/NodeJS test from behind proxy

I am getting the below error while trying to run Mocha JS test case which runs npm request-promise to call a REST service. I was able to connect to the REST URI endpoint through ARC client bur it failed with below error while running through organization's proxy-
RequestError: Error: connect ETIMEDOUT SERVER_IP:SERVER_PORT
at new RequestError (<Some_Path>\errors.js:14:15)
at Request.plumbing.callback (<Some_Path>\plumbing.js:87:29)
at Request.RP$callback [as _callback] (<Some_Path>\plumbing.js:46:31)
at self.callback (<Some_Path>\request.js:188:22)
at Request.onRequestError (<Some_Path>\request\request.js:884:8)
at TLSSocket.socketErrorListener (_http_client.js:309:9)
at emitErrorNT (net.js:1277:8)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
I fixed this issue with adding the following in the request-promise options-
proxy:'http://PROXY_SERVER_IP:PORT#'
I hope this helps.
Cheers,
Kunal
This worked for me
var request = require('request-promise').defaults({
proxy:'http://username:password#host:port',
strictSSL :false
});

Nodejs with Forever script will not accessible after sometime

I got a Nodejs project with was hosted in Digital Ocean and I keep it running using Forever script. But I realized that there will be some error after a period of time which causing the site down. It's not just happened once but few times already, below is the Forever log:
Error: Connection lost: The server closed the connection.
at Protocol.end (/var/www/menu/node_modules/mysql/lib/protocol/Protocol.js:109:13)
at Socket.<anonymous> (/var/www/menu/node_modules/mysql/lib/Connection.js:109:28)
at emitNone (events.js:72:20)
at Socket.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:905:12)
at nextTickCallbackWith2Args (node.js:441:9)
at process._tickCallback (node.js:355:17)
error: Forever detected script exited with code: 1
error: Script restart attempt #178
Listening on xxx.xxx.xxx.xxx, server_port 80
events.js:141
throw er; // Unhandled 'error' event
Error: connect ECONNREFUSED 127.0.0.1:3306
at Object.exports._errnoException (util.js:870:11)
at exports._exceptionWithHostPort (util.js:893:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1063:14)
--------------------
at Protocol._enqueue (/var/www/menu/node_modules/mysql/lib/protocol/Protocol.js:141:48)
at Protocol.handshake (/var/www/menu/node_modules/mysql/lib/protocol/Protocol.js:52:41)
at Connection.connect (/var/www/menu/node_modules/mysql/lib/Connection.js:130:18)
at Connection._implyConnect (/var/www/menu/node_modules/mysql/lib/Connection.js:461:10)
at Connection.query (/var/www/menu/node_modules/mysql/lib/Connection.js:206:8)
at Object.<anonymous> (/var/www/menu/config/db.js:14:12)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
error: Forever detected script exited with code: 1
I'm not sure why this is happening as the log did not stated which line was causing error, and it seems like Forever had try to restart the script but it failed. But once I SSH into my server and start it again then it's working fine already. Anyone able to help? Thanks.
Error: connect ECONNREFUSED 127.0.0.1:3306
You are getting this error that means that port is in use. You can kill the process running over that port by using following command.
sudo kill $(sudo lsof -t -i:3306)
Thereafter, you can re-deploy your server using forever like you do.
Happens to me once
The problem seems to be related to mysql connection.
Please refer to this stackoverflow question to solve your problem
nodejs mysql Error: Connection lost The server closed the connection

Starting node-huxley with example tests

I'm struggling to get node-huxley to run. Having installed it globally, I then installed the node-selenium driver, cloned the repo and tried to run Huxley on the examples. However I'm seeing this error.
It seems to suggest that the server isn't running, but I've verified it as running on localhost:8000 correctly. Any ideas how to debug this?
firefox opening.
At 1 type and toggle.hux
/usr/local/lib/node_modules/huxley/node_modules/selenium-webdriver/lib/webdriver/promise.js:1549
throw error;
^
Error: ECONNREFUSED connect ECONNREFUSED
at ClientRequest.<anonymous> (/usr/local/lib/node_modules/huxley/node_modules/selenium-webdriver/http/index.js:127:16)
at ClientRequest.EventEmitter.emit (events.js:95:17)
at Socket.socketErrorListener (http.js:1547:9)
at Socket.EventEmitter.emit (events.js:95:17)
at net.js:440:14
at process._tickCallback (node.js:415:13)
==== async task ====
WebDriver.createSession()
at Function.webdriver.WebDriver.acquireSession_ (/usr/local/lib/node_modules/huxley/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:131:49)
at Function.webdriver.WebDriver.createSession (/usr/local/lib/node_modules/huxley/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:111:30)
at Builder.build (/usr/local/lib/node_modules/huxley/node_modules/selenium-webdriver/builder.js:105:20)
at _open (/usr/local/lib/node_modules/huxley/source/browser/driver.js:28:6)
at Object.open (/usr/local/lib/node_modules/huxley/source/browser/driver.js:49:3)
at _openRunAndClose (/usr/local/lib/node_modules/huxley/index.js:76:11)
at /usr/local/lib/node_modules/huxley/index.js:169:5
at /usr/local/lib/node_modules/huxley/index.js:217:5
at /usr/local/lib/node_modules/huxley/source/playback/getPlaybackInfos.js:121:5
Have you started selenium? (https://github.com/chenglou/node-huxley#installation)

How to troubleshoot ECONNREFUSED error?

I'm trying to get the d3.js demo given here to work.
I'm following along the instructions in the README.md file. I get the npm install step to work, but the next step, node server, fails:
% node server
Master pid 16196
16197 listening. Go to: http://localhost:3030/
events.js:72
throw er; // Unhandled 'error' event
^
Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
at RedisClient.on_error (/Users/yrstruly/tmp/derby-barchart/node_modules/redis/index.js:189:24)
at Socket.<anonymous> (/Users/yrstruly/tmp/derby-barchart/node_modules/redis/index.js:95:14)
at Socket.EventEmitter.emit (events.js:95:17)
at net.js:440:14
at process._tickCallback (node.js:415:13)
It looks like the code is expecting to have some process listening to port 6379, but the README says nothing about this.
I'm quite unfamiliar with most of the software used by this demo. In particular, I know very little about node.js, derby, and redis. Therefore, I'm following the steps in the README rather blindly. Any help with troubleshooting this error would be appreciated.

Resources