Memcached refuse connection after node upgrade to v18.7.0 - node.js

I am using memcached locally to store user sessions.
To work with memcached I use the npmjs.com/package/memcached
After upgrading nodes to version v18.7.0, the server stopped connecting to memcached at localhost:11211
However, when the address is changed to 127.0.0.1:11211, the connection proceeds normally, but an error still occurs during further work:
Error: connect ECONNREFUSED ::1:11211
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1247:16) {
[stack]: 'Error: connect ECONNREFUSED ::1:11211\n' +
' at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1247:16)',
[message]: 'connect ECONNREFUSED ::1:11211',
errno: -111,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '::1',
port: 11211
}
What could be causing this and how to fix it?

The problem was that memcached was configured to accept connections only via IPv4.
After adding in the settings for receiving connections via IPv6, everything worked.

Related

heroku postgres ETIMEDOUT when conencting through localhost

I have a website which uses the free tier of heroku postgres I was running it on localhost and it was working just fine till today no changes were made to the code and the database url and everything is just fine
Error: connect ETIMEDOUT 3.224.164.189:5432
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1246:16) {
errno: -4039,
code: 'ETIMEDOUT',
syscall: 'connect',
address: '3.224.164.189',
port: 5432
}
This is the error which I get and this error is only shown on localhost, when the same code is deployed to heroku, it works just fine
Also, one thing which I've noticed is that it works just fine when I use my mobile network and this issue only occurs when I use my ethernet connection.
Can Someone help me out with this sticky situation?

Error: connect ETIMEDOUT 55.28.36.18:587 at TCPConnectWrap

I'm sending email using nodemailer.
I just follow the sample here.
But I got error like below.
Error: connect ETIMEDOUT 55.28.36.18:587
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16) {
errno: -4039,
code: 'ESOCKET',
syscall: 'connect',
address: '55.28.36.18',
port: 587,
command: 'CONN' }
I tried to change port number and other things but can't fix this.
Please tell me what's wrong with my code.
You should check your proxy settings first.
Some of these errors are due to proxy setting.
The sample you followed is working fine on my side.

Cpanel Email not sending on live site

I have a cpanel email that can send mails with a nodejs application. However this only works locally. When I try on the live site, I get this error:
Error: connect ECONNREFUSED
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1144:16) {
errno: 'ECONNREFUSED',
code: 'ESOCKET',
syscall: 'connect',
port: 465,
command: 'CONN'
}
I heard it's a firewall issue. If it is, how can I enable port 465 in my cpanel. Or how can I change to a different port? Please graphical solutions would be applicated

Redis ETIMOUT... How many reasons will cause this?

I'm running Redis on Linux and for a period of time an error occured below in the log:
{ Error: Redis connection to xxx.yyy.zzz.ttt:6379 failed - connect ETIMEDOUT xxx.yyy.zzz.ttt:6379
at Object.exports._errnoException (util.js:1020:11)
at exports._exceptionWithHostPort (util.js:1043:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14)
code: 'ETIMEDOUT',
errno: 'ETIMEDOUT',
syscall: 'connect',
address: 'xxx.yyy.zzz.ttt',
port: 6379 }
I checked username and password, it seems everything goes right with me.
I wanna know roughly:
1) How many reasons will cause this?
2) What suggestions do you have to fix that?

Error: connect ECONNREFUSED 127.0.1.1:80 when launching grunt-fetch-pages (node.js)

I've got this issue launching fetchpages Grunt plugin:
Running "fetchpages:dist" (fetchpages) task
Fetching pages...
skipping duplicate page {"local":"public_html/speed/www-fetched/index.html","remote":"http://example.com/"}
Creating folders...
https://example.com/ -> public_html/speed/www-fetched/index.html
{ Error: connect ECONNREFUSED 127.0.1.1:80
at Object.exports._errnoException (util.js:1020:11)
at exports._exceptionWithHostPort (util.js:1043:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.1.1',
port: 80 }
https://example.com/scrap-metal-prices -> public_html/speed/www-fetched/scrap-price.html
I've never seen this kind of errors in other projects before.
I use grunt-fetch-pages#2.0.0 and Node v6.11.5.
What does it mean and how to solve?
I just commented (#) this string in /etc/hosts:
#127.0.1.1 example.com example
Now it's ok.

Resources