You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
did:web handles that resolve to an IPv6 address fail with could not resolve valid DID document. For example, my server has the FQDN dead10ck.dev, which is the same as the did:web handle I'm trying to create on my sandbox PDS. It has a link local IPv6 address, which the FQDN resolves to when it makes a request from the same server (to itself).
[root@dead10ck ~]# ip addr show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9001 qdisc mq state UP
group default qlen 1000
link/ether 12:6d:da:9e:b4:03 brd ff:ff:ff:ff:ff:ff
altname enp0s5
altname ens5
inet 172.31.86.138/20 brd 172.31.95.255 scope global dynamic nopr
efixroute eth0
valid_lft 3469sec preferred_lft 3469sec
inet6 2600:1f18:6af3:9f05:f526:3a1a:611:6b22/128 scope global dyn
amic noprefixroute
valid_lft 418sec preferred_lft 108sec
inet6 fe80::62f0:705:bdbd:6279/64 scope link noprefixroute
valid_lft forever preferred_lft forever
The DID document is served at the expected location successfully:
Jul 14 04:49:46 dead10ck.dev bsky-pds[35756]: {"level":50,"time":1689310185811,"pid":35756,"hostname":"dead10ck.dev","name":"xrpc-server","err":{"type":"InvalidRequestError","message":"could not resolve valid DID document: did:web:dead10ck.dev\n----------Error: connect EINVAL fe80::62f0:705:bdbd:6279:443 - Local (:::0)\n at __node_internal_captureLargerStackTrace (node:internal/errors:490:5)\n at __node_internal_exceptionWithHostPort (node:internal/errors:668:12)\n at internalConnect (node:net:1066:16)\n at defaultTriggerAsyncIdScope(node:internal/async_hooks:464:18)\n at GetAddrInfoReqWrap.emitLookup [as callback] (node:net:1323:9)\n at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:109:8)\n----------","stack":"Error: could not resolve valid DID document: did:web:dead10ck.dev\n----------Error: connect EINVAL fe80::62f0:705:bdbd:6279:443 - Local (:::0)\n at __node_internal_captureLargerStackTrace (node:internal/errors:490:5)\n at __node_internal_exceptionWithHostPort (node:internal/errors:668:12)\n at internalConnect (node:net:1066:16)\n at defaultTriggerAsyncIdScope (node:internal/async_hooks:464:18)\n at GetAddrInfoReqWrap.emitLookup [as callback] (node:net:1323:9)\n at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:109:8)\n----------\n
at getDidAndPlcOp (/opt/bsky/pds/packages/pds/src/api/com/atproto/server/createAccount.ts:211:11)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at <anonymous> (/opt/bsky/pds/packages/pds/src/api/com/atproto/server/createAccount.ts:34:28)\n at <anonymous> (/opt/bsky/pds/packages/xrpc-server/src/server.ts:207:35)","errorMessage":"could not resolve valid DID document: did:web:dead10ck.dev\n----------Error: connect EINVAL fe80::62f0:705:bdbd:6279:443 - Local (:::0)\n at __node_internal_captureLargerStackTrace (node:internal/errors:490:5)\n at __node_internal_exceptionWithHostPort (node:internal/errors:668:12)\n at internalConnect(node:net:1066:16)\n at defaultTriggerAsyncIdScope (node:internal/async_hooks:464:18)\n at GetAddrInfoReqWrap.emitLookup [as callback] (node:net:1323:9)\n at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:109:8)\n----------","customErrorName":"UnresolvableDid"},"msg":"error in xrpc method com.atproto.server.createAccount"}
In particular, note this bit:
Error: connect EINVAL fe80::62f0:705:bdbd:6279:443 - Local (:::0)
It seems when it makes the HTTP request to https://dead10ck.dev/.well-known/did.json, it resolves to the IP address and port, but then simply uses the IPv6 address as the host without the necessary [] enclosure to disambiguate the port.
Describe the bug
did:web
handles that resolve to an IPv6 address fail withcould not resolve valid DID document
. For example, my server has the FQDNdead10ck.dev
, which is the same as thedid:web
handle I'm trying to create on my sandbox PDS. It has a link local IPv6 address, which the FQDN resolves to when it makes a request from the same server (to itself).The DID document is served at the expected location successfully:
But when I try to create an account for this handle, it fails. I added extra debug print statements to see the actual error:
In particular, note this bit:
Error: connect EINVAL fe80::62f0:705:bdbd:6279:443 - Local (:::0)
It seems when it makes the HTTP request to
https://dead10ck.dev/.well-known/did.json
, it resolves to the IP address and port, but then simply uses the IPv6 address as the host without the necessary[]
enclosure to disambiguate the port.The particular line where it fails is here:
atproto/packages/identity/src/did/web-resolver.ts
Lines 32 to 43 in 6b51ecb
So this may be an upstream bug with Axios.
Details
The text was updated successfully, but these errors were encountered: