View Issue Details

IDProjectCategoryView StatusLast Update
0009942Talerwallet-corepublic2025-05-12 14:07
Reportersebasjm Assigned To 
PrioritynormalSeveritycrashReproducibilitysometimes
Status confirmedResolutionopen 
Product Versiongit (master) 
Target Version1.1 
Summary0009942: node implementation of dns lookup broke my internet
Descriptionwhen the target host can be reach by ipv4 but not by ipv6 and the connection delay is bad enough then node will throw an "AggregateError [ETIMEDOUT]"

in my setup
# node connection-test.js 500
is enough to work.

i think we should at least have an option to let the user workaround otherwise the wallet is not usable.
we could go for a env variable like WALLET_DISABLE_AUTO_SELECT_FAMILY or maybe increase the timeout delay

https://github.com/nodejs/node/issues/47822

https://nodejs.org/api/net.html#socketconnectoptions-connectlistener

https://www.rfc-editor.org/rfc/rfc8305.txt
Steps To Reproduce1) have a non "first world" connection, a router with ipv4 without ipv6 will work
2) find a target with ipv4 and ipv6, test:
OK : curl -4 https://bank.demo.taler.net/config
FAIL: curl -6 https://bank.demo.taler.net/config
3) node connection-test.js

TagsNo tags attached.
Attached Files
connection-test.js (926 bytes)   
const https = require('https');

if (process.argv[2] == "auto")
  require("net").setDefaultAutoSelectFamily(false);

if (process.argv[2] == "100")
  require("net").setDefaultAutoSelectFamilyAttemptTimeout(100);

if (process.argv[2] == "500")
  require("net").setDefaultAutoSelectFamilyAttemptTimeout(500);

let agent = undefined
if (process.argv[2] == "agent")
  agent = new https.Agent({autoSelectFamily:false})

if (process.argv[2] == "agent-4")
  agent = new https.Agent({family:4})

if (process.argv[2] == "agent-6")
  agent = new https.Agent({family:6})

if (process.argv[2] == "agent-timeout")
  agent = new https.Agent({autoSelectFamilyAttemptTimeout:Number.parseInt(process.argv[3])})

https.get(`https://bank.demo.taler.net/config`, {agent}, (resp) => {
  let data = ''
  resp.on('data', (chunk) => data += chunk)
  resp.on('end', () => console.log(data))
}).on('error', (err) => {
  console.log('error: ', err);
})

connection-test.js (926 bytes)   

Activities

sebasjm

2025-05-12 13:56

developer   ~0024878

there was a patch for a specific version of node v20
since this is still not working I extended the workaround
1f0a2c649..ab034bde5

sebasjm

2025-05-12 13:58

developer   ~0024879

This are the version i tried, for my, only v18 works without the patch.

$ nvm ls
       v18.20.8
       v20.19.1
        v21.7.3
       v22.12.0
-> v22.15.0
        v24.0.1

Issue History

Date Modified Username Field Change
2025-05-12 13:35 sebasjm New Issue
2025-05-12 13:35 sebasjm File Added: connection-test.js
2025-05-12 13:56 sebasjm Note Added: 0024878
2025-05-12 13:58 sebasjm Note Added: 0024879
2025-05-12 14:07 Christian Grothoff Status new => confirmed