Cannot get 'getNegotiatedProtocol' of null when requesting via https in request.js - node.js

I'm doing http request using request.js, and I have run my program for a very long time this is the first time got this kind of error, it seems related to openssl and TLS issue. Does anybody have idea?
2017-02-20T14:27:34.330Z - error: Error: write EPROTO 140125135710016:error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number:../deps/openssl/openssl/ssl/s3_pkt.c:365:
at exports._errnoException (util.js:1022:11)
at WriteWrap.afterWrite (net.js:801:14) 2017-02-20T14:27:34.332Z - warn: worker warning, msg={"code":"EPROTO","errno":"EPROTO","syscall":"write"}
2017-02-20T14:27:34.348Z - error: uncaughtException: Cannot read property 'getNegotiatedProtocol' of null ,
version=v6.9.5,
argv=[/usr/bin/nodejs, /home/bda/tm/worker.js],rss=234672128, heapTotal=135876608, heapUsed=107730496, loadavg=[0.43798828125, 0.5263671875, 0.53857421875], uptime=906959,
trace=[column=36, file=_tls_wrap.js, function=TLSSocket._finishInit, line=588, method=_finishInit, native=false, column=38, file=_tls_wrap.js, function=TLSWrap.ssl.onhandshakedone, line=433, method=ssl.onhandshakedone, native=false], stack=[TypeError: Cannot read property 'getNegotiatedProtocol' of null, at TLSSocket._finishInit (_tls_wrap.js:588:36), at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:433:38)]

Related

Getting Error In ImageMagick of Invalid Parameter - 150?

Hi all I am using ImageMagick to convert image. But while running the server I am getting the following Error. Anyone have the answer for this? The error is below>
Invalid Parameter - 150
ImageMagick Error:
Error: write EOF
events.js:377
throw er; // Unhandled 'error' event
^
Error: write EOF
at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:94:16)
Emitted 'error' event on ImageMagick instance at:
at onwriteError (E:\git_clone\nuron_core_ns\node_modules\readable-
stream\lib\_stream_writable.js:449:12)
at onwrite (E:\git_clone\nuron_core_ns\node_modules\readable-
stream\lib\_stream_writable.js:470:11)
at WritableState.onwrite (E:\git_clone\nuron_core_ns\node_modules\readable-
stream\lib\_stream_writable.js:180:5)
at ImageMagick.Duplexify._destroy
(E:\git_clone\nuron_core_ns\node_modules\duplexify\index.js:190:18)
at E:\git_clone\nuron_core_ns\node_modules\duplexify\index.js:182:10
at processTicksAndRejections (internal/process/task_queues.js:77:11) {
errno: -4095,
code: 'EOF',
syscall: 'write'

When I try to connect to Redis from inside Kubernetes, always got connection failed

I have my node app deployed inside Kubernetes cluster, when the app tries to connect to Redis outside from the Kubernetes, it throws following error:
2019-09-04T06:21:55.320Z ioredis:redis status[101.37.199.xx:6379]: connecting -> connect
2019-09-04T06:21:55.321Z ioredis:redis write command[101.37.199.xx:6379]: 32 -> auth([ 'xxxxxx' ])
2019-09-04T06:21:55.321Z ioredis:redis write command[101.37.199.xx:6379]: 32 -> select([ '32' ])
2019-09-04T06:21:55.321Z ioredis:connection error: Error: write EPIPE
at afterWriteDispatched (internal/stream_base_commons.js:146:25)
at writeGeneric (internal/stream_base_commons.js:137:3)
at Socket._writeGeneric (net.js:698:11)
at Socket._write (net.js:710:8)
at doWrite (_stream_writable.js:417:12)
at writeOrBuffer (_stream_writable.js:401:5)
at Socket.Writable.write (_stream_writable.js:301:11)
at Redis.sendCommand (/app/node_modules/ioredis/built/redis/index.js:601:33)
at Redis.select (/app/node_modules/ioredis/built/commander.js:124:21)
at Socket.<anonymous> (/app/node_modules/ioredis/built/redis/event_handler.js:32:18) {
errno: 'EPIPE',
code: 'EPIPE',
syscall: 'write'
}
[ioredis] Unhandled error event: Error: write EPIPE
at afterWriteDispatched (internal/stream_base_commons.js:146:25)
at writeGeneric (internal/stream_base_commons.js:137:3)
at Socket._writeGeneric (net.js:698:11)
at Socket._write (net.js:710:8)
at doWrite (_stream_writable.js:417:12)
at writeOrBuffer (_stream_writable.js:401:5)
at Socket.Writable.write (_stream_writable.js:301:11)
at Redis.sendCommand (/app/node_modules/ioredis/built/redis/index.js:601:33)
at Redis.select (/app/node_modules/ioredis/built/commander.js:124:21)
at Socket.<anonymous> enter code here(/app/node_modules/ioredis/built/redis/event_handler.js:32:18)
2019-09-04T06:21:55.324Z ioredis:redis queue command[101.37.199.xx:6379]: 32 -> info([])
2019-09-04T06:21:55.324Z ioredis:redis status[101.37.199.xx:6379]: connect -> close
I've tried to deploy redis-cli inside the kubernetes cluster, it can access the redis service.
you have to expose redis as a service in your cluster

Intermittent redis connection error: 'UNCERTAIN STATE'

Time and time again, we get this error:
{ Error: Redis connection to some-redis-server:6379 failed - read ETIMEDOUT
at TCP.onStreamRead (internal/stream_base_commons.js:171:27) errno: 'ETIMEDOUT', code: 'ETIMEDOUT', syscall: 'read' }
{ AbortError: Redis connection lost and command aborted. It might have been processed.
at RedisClient.flush_and_error (/usr/src/app/node_modules/redis/index.js:362:23)
at RedisClient.connection_gone (/usr/src/app/node_modules/redis/index.js:664:14)
at Socket.<anonymous> (/usr/src/app/node_modules/redis/index.js:289:14)
at Object.onceWrapper (events.js:281:20)
at Socket.emit (events.js:193:13)
at TCP._handle.close (net.js:614:12)
code: 'UNCERTAIN_STATE',
command: 'GET'
args: [ 'some-key' ] }
We are using https://www.npmjs.com/package/redis to access redis.
Some details of the setup:
Currently 25GB of data stored in Redis
Writes = a rate of approximately 2MB/sec.
Max number of concurrent clients connected: 400
I don't know where to really start looking, so any help would be appreciated.

MEAN: Unhandled rejection MongoError: not authorized on mean-dev to execute command

I installed meanjs in my OpenSUSE distro, however when I run npm start, here's what I get:
+ Important warning: config.domain is empty. It should be set to the fully qualified domain of the app.
Unhandled rejection MongoError: not authorized on mean-dev to execute command { listIndexes: "sessions", cursor: {} }
at Function.MongoError.create (/home/tasher/Projects/meanjs_test/node_modules/mongodb-core/lib/error.js:31:11)
at queryCallback (/home/tasher/Projects/meanjs_test/node_modules/mongodb-core/lib/cursor.js:212:36)
at /home/tasher/Projects/meanjs_test/node_modules/mongodb-core/lib/connection/pool.js:469:18
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
From previous event:
at MongoStore.setAutoRemoveAsync (/home/tasher/Projects/meanjs_test/node_modules/connect-mongo/src/index.js:129:40)
at MongoStore.handleNewConnectionAsync (/home/tasher/Projects/meanjs_test/node_modules/connect-mongo/src/index.js:121:18)
at MongoStore (/home/tasher/Projects/meanjs_test/node_modules/connect-mongo/src/index.js:96:26)
at Object.module.exports.initSession (/home/tasher/Projects/meanjs_test/config/lib/express.js:120:12)
at Object.module.exports.init (/home/tasher/Projects/meanjs_test/config/lib/express.js:243:8)
at /home/tasher/Projects/meanjs_test/config/lib/app.js:25:23
at /home/tasher/Projects/meanjs_test/config/lib/mongoose.js:35:21
at process._tickCallback (internal/process/next_tick.js:109:7)
Unhandled rejection MongoError: not authorized on mean-dev to execute command { listIndexes: "sessions", cursor: {} }
at Function.MongoError.create (/home/tasher/Projects/meanjs_test/node_modules/mongodb-core/lib/error.js:31:11)
at queryCallback (/home/tasher/Projects/meanjs_test/node_modules/mongodb-core/lib/cursor.js:212:36)
at /home/tasher/Projects/meanjs_test/node_modules/mongodb-core/lib/connection/pool.js:469:18
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
From previous event:
at MongoStore.setAutoRemoveAsync (/home/tasher/Projects/meanjs_test/node_modules/connect-mongo/src/index.js:129:40)
at MongoStore.handleNewConnectionAsync (/home/tasher/Projects/meanjs_test/node_modules/connect-mongo/src/index.js:121:18)
at MongoStore (/home/tasher/Projects/meanjs_test/node_modules/connect-mongo/src/index.js:96:26)
at module.exports (/home/tasher/Projects/meanjs_test/config/lib/socket.io.js:73:20)
at Object.module.exports.configureSocketIO (/home/tasher/Projects/meanjs_test/config/lib/express.js:214:38)
at Object.module.exports.init (/home/tasher/Projects/meanjs_test/config/lib/express.js:258:14)
at /home/tasher/Projects/meanjs_test/config/lib/app.js:25:23
at /home/tasher/Projects/meanjs_test/config/lib/mongoose.js:35:21
at process._tickCallback (internal/process/next_tick.js:109:7)
error: uncaughtException: getaddrinfo ENOTFOUND linux-hcjz.suse date=Mon Aug 28 2017 22:46:50 GMT+0100 (WEST), pid=4497, uid=1000, gid=100, cwd=/home/tasher/Projects/meanjs_test, execPath=/usr/bin/node6, version=v6.11.1, argv=[/usr/bin/node6, /home/tasher/Projects/meanjs_test/server.js], rss=97284096, heapTotal=69029888, heapUsed=48863040, external=20182576, loadavg=[0.6513671875, 0.61669921875, 0.43505859375], uptime=3056
Error: getaddrinfo ENOTFOUND linux-hcjz.suse
at errnoException (dns.js:28:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)
I have re-installed meanjs twice but in vain. Mongo is also running. By the way:
tasher#linux-hcjz:~/Projects/meanjs_test> node -v
v6.11.1
tasher#linux-hcjz:~/Projects/meanjs_test> npm6 -v
3.10.10
Any thoughts?
try adding execution permission to your mean-dev
chmod 755 path_for_package/mean-dev
replace path path_for_package with your path

Sauce Labs with protractor, malformed URI

My protractor config is:
exports.config = {
baseUrl: 'http://www.onet.pl',
directConnect: false,
sauceUser: 'myuser',
sauceKey: 'mypassword',
capabilities: {
'browserName': 'chrome',
'chromeOptions': {
'args': ['show-fps-counter=true', '--allow-running-insecure-content']
}
},
}
When I try to launch the tests I get the following Error:
[12:57:56] I/sauce - Using SauceLabs selenium server at http://ondemand.saucelabs.com:80/wd/hub
[12:57:56] I/launcher - Running 1 instances of WebDriver
[12:57:56] E/launcher - URI malformed
[12:57:56] E/launcher - URIError: URI malformed
at decodeURIComponent (native)
at Url.parse (url.js:275:19)
at Object.urlParse [as parse] (url.js:81:5)
at new HttpClient (C:\Users\gwk736\Gitlab\Inform\e2e\node_modules\selenium-webdriver\http\index.js:221:25)
at C:\Users\gwk736\Gitlab\Inform\e2e\node_modules\selenium-webdriver\executors.js:47:18
at ManagedPromise.invokeCallback_ (C:\Users\gwk736\Gitlab\Inform\e2e\node_modules\selenium-webdriver\lib\promise.js:1379:14)
at TaskQueue.execute_ (C:\Users\gwk736\Gitlab\Inform\e2e\node_modules\selenium-webdriver\lib\promise.js:2913:14)
at TaskQueue.executeNext_ (C:\Users\gwk736\Gitlab\Inform\e2e\node_modules\selenium-webdriver\lib\promise.js:2896:21)
at asyncRun (C:\Users\gwk736\Gitlab\Inform\e2e\node_modules\selenium-webdriver\lib\promise.js:2820:25)
at C:\Users\gwk736\Gitlab\Inform\e2e\node_modules\selenium-webdriver\lib\promise.js:639:7
[12:57:56] E/launcher - Process exited with error code 199
Anyone encountered this problem when running tests ?
This is a very strange behaviour to me...
Unfortunately no examples can be found.
I was able to replicate your error by having incorrectly encoded characters in either sauceUser or sauceKey. Can you check if you have any such characters in your config?
sauceUser: 'myuser',
sauceKey: 'password%EA',
Error Stack:
[14:41:46] I/sauce - Using SauceLabs selenium server at http://ondemand.saucelabs.com:80/wd/hub
[14:41:46] I/launcher - Running 1 instances of WebDriver
[14:41:46] E/launcher - URI malformed
[14:41:46] E/launcher - URIError: URI malformed
at decodeURIComponent (native)
at Url.parse (url.js:195:19)
at Object.urlParse [as parse] (url.js:84:5)
This issue in nodeJs has been explained in this nodejs git issue
I just ran into this error when a client encoded 'ê' as '%EA' and an
'é' as "%E9" and then sent them to my node server. Attempting to
decode either of them result in the uri malformed error:
decodeURIComponent("%EA"); URIError: URI malformed at decodeURIComponent (native) at repl:1:1

Resources