Firebase Functions deploying Not Working, Rejected with [ Server Error. Client network socket disconnected ] - node.js

I am trying to deploy my firebase functions but it's giving me an error.
⚠ functions: Upload Error: Server Error. Client network socket disconnected before secure TLS connection was established
Error: Server Error. Client network socket disconnected before secure TLS connection was established
Firebase Debug Log
[warn] ⚠ functions: Upload Error: Server Error. Client network socket disconnected before secure TLS connection was established
[debug] [2020-04-04T17:59:21.405Z] Error: Client network socket disconnected before secure TLS connection was established
at connResetException (internal/errors.js:570:14)
at TLSSocket.onConnectEnd (_tls_wrap.js:1361:19)
at Object.onceWrapper (events.js:299:28)
at TLSSocket.emit (events.js:215:7)
at TLSSocket.EventEmitter.emit (domain.js:476:20)
at endReadableNT (_stream_readable.js:1183:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
[error]
[error] Error: Server Error. Client network socket disconnected before secure TLS connection was established

This problem often happens due to slow internet connection. Please check your Internet connection.

Related

nodejs request with proxy socket disconnected before secure TLS connection was established error

I'm trying to connect to instagram.com through proxy. This worked today on another server, but when I moved to new server, it stopped working. I think that the matter is in some network settings, maybe openssl.
const request = require('request');
request({url: 'https://i.instagram.com', proxy: 'http://username:pass#ip:port'}, (err, res, body)=>{console.log(err)})
Output:
{ Error: Client network socket disconnected before secure TLS connection was established
at TLSSocket.onConnectEnd (_tls_wrap.js:1125:19)
at Object.onceWrapper (events.js:286:20)
at TLSSocket.emit (events.js:203:15)
at TLSSocket.EventEmitter.emit (domain.js:466:23)
at endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
code: 'ECONNRESET',
path: undefined,
host: undefined,
port: 0,
localAddress: undefined }
if you change the proxy port to https, then the error will be as follows:
tunneling socket could not be established, cause=write EPROTO 140260722169664:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332
On the old server it worked with http, not https.
I try to install another version of nodes from 10 up to 16

Greenlock #v4 don't create ssl sertificate

When i start node js server that are using greenlock i got this message
Listening on 0.0.0.0:80 for ACME challenges, and redirecting to HTTPS
Listening on 0.0.0.0:443 for secure traffic
Ready to Serve:
But 2 minutes later i got error message
Error cert_issue:
connect ENETUNREACH 172.31.240.54:80
code: ENETUNREACH
Error: connect ENETUNREACH 172.31.240.54:80
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16)
I use virtual server and domen that i buy on GoDaddy

Passport-azure-ad : authentication failed due to: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND 3128

I try to implement Passport-azure-ad OIDCStrategy on my node application.
It is working find in my personal computer but with my corporate laptop (without VPN or proxy configured) I cannot connect and I get that error :
authentication failed due to: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND 3128
I don't understand why because I can access by a browser to https://login.microsoftonline.com/ without any issues.
I don't understand what endpoint node try to contact and why the tunnel socket cannot be established.
Any help ?
Thanks

Azure Hybrid Connection trouble-shooting

In both Azure and the Hybrid Connection Manager I have a status of 'Connected' but when I try tcpping to it fails.
Apart from tccping, is there any other trouble shooting I can do?
The HCM endpoint is DESDESKTOP-6E0E4QK:5162. Here are my tccping results
tcpping DESDESKTOP-6E0E4QK:5162
D:\home\site\wwwroot
Connection attempt failed: No such host is known
Connection attempt failed: No such host is known
Connection attempt failed: No such host is known
Connection attempt failed: No such host is known
Complete: 0/4 successfull attempts (0%). Average success time: 0ms
Internal IP that resolves to DESDESKTOP-6E0E4QK
tcpping 192.168.1.158:5162
D:\home\site\wwwroot
Connection attempt failed: An attempt was made to access a socket in a way forbidden by its access permissions 192.168.1.158:5162
Connection attempt failed: An attempt was made to access a socket in a way forbidden by its access permissions 192.168.1.158:5162
Connection attempt failed: An attempt was made to access a socket in a way forbidden by its access permissions 192.168.1.158:5162
Connection attempt failed: An attempt was made to access a socket in a way forbidden by its access permissions 192.168.1.158:5162
Complete: 0/4 successfull attempts (0%). Average success time: 0ms
External IP
tcpping 47.198.9.249:5162
D:\home\site\wwwroot
Connection attempt failed: Connection timed out.
Connection attempt failed: Connection timed out.
Connection attempt failed: Connection timed out.
Connection attempt failed: Connection timed out.
Complete: 0/4 successfull attempts (0%). Average success time: 0ms

How to connect to redis which is running on EC2, from node.js application running on local system using Express.js?

I am writing an Node.js application on Express.js. I have a Redis server installed on an EC2 instance running on UBUNTU Server 16.04. I have installed npm modules for Redis.I have mentioned the port and the host like this:-
var redis = require('redis');
var client = redis.createClient(6379,"127.0.0.1");
When I try connecting to EC2 instance of Redis, I get an error like this:-
events.js:141
throw er; // Unhandled 'error' event
^
Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
at Object.exports._errnoException (util.js:870:11)
at exports._exceptionWithHostPort (util.js:893:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1061:14)
How do I connect to redis which is running on ec2?
from the error message, it seems like redis isn't actually running on your host. i would check that redis is indeed running like this:
ps auxwg | grep redis
and check for a running redis process. another, simpler way would be to use the 'telnet' command to attempt to connect your local redis instance like:
wintermute:~ 07:52:58 melgart$ telnet 127.0.0.1 6379
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
in my case, redis is up and running so i get the 'connected' response. HTH

Resources