trames57 opened a new issue #292:
URL: https://github.com/apache/couchdb-nano/issues/292
<!--- Provide a general summary of the issue in the Title above -->
Linux distribution: Arch Linux
On my Linode VM, I upgraded from Node 16 to Node 17.3. After this, I could
no longer connect via nano to my couchdb. It seems that in my VM, the port 5984
is redirected to another open port e.g 127.0.0.1:5984 -> 127.0.0.1:xxxxx.
However, it does not create a redirect for ::1:5984 so I was getting a
connection refused.
I found this by doing a console.log(response) in
../node_modules/nano/lib/nano.js just above line 137 (a socket error)
> Error: connect ECONNREFUSED ::1:5984
3 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16) {
4 errno: -111,
5 code: 'ECONNREFUSED',
6 syscall: 'connect',
7 address: '::1',
8 port: 5984,
9 config: {
10 url: 'http://localhost:5984/musiccat/_find',
11 method: 'post',
12 data:
'{"selector":{"$or":[{"dtype":"album"},{"dtype":"code","code_type":"format"}]},"fields":["_id","dtype","code_type","name","images","format","_attachments"],"use_index":"dtype-name-index","limit":999999}',
13 headers: {
14 Accept: 'application/json',
15 'Content-Type': 'application/json',
16 'user-agent': 'nano/9.0.5 (Node.js v17.3.0)',
17 'Accept-Encoding': 'deflate, gzip',
18 'Content-Length': 201
19 },...
>
On my LInode VM, I disabled IPV6 for all interfaces (in
/etc/sysctl.d/40-ipv6.conf). After doing that, the redirects are gone and the
connection starting working again. It took many hours to find this problem.
Today I had found an entry on Reddit where new versions of Nodejs are now
preferring IPV6. However, when I look at Nodejs net.socketAddress, the default
family is still 'ipv4'.
I am not sure how to configure the nano connection to only use IPV4 or if
something needs to change in the nano library to help with this issue so people
don't have to completely disable IPV6 on their systems.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]