dappnode / DAppNode

General repository of the project dappnode
GNU General Public License v3.0
581 stars 99 forks source link

Wireguard VPN Credentials Get Link returns an error #551

Closed clamdad closed 12 months ago

clamdad commented 1 year ago

Describe the bug

Clicking the Get Link button for Wireguard VPN credentials returns an error.

To Reproduce

I've reproduced this behavior on several installations using the following methods:

Expected behavior

The wireguard credentials should be returned.

Screenshots

Error: Error fetching credentials: Internal Server Error RequestError: getaddrinfo ENOTFOUND my.dappnode
    at ClientRequest.<anonymous> (/app/node_modules/got/dist/source/core/index.js:956:111)
    at Object.onceWrapper (node:events:628:26)
    at ClientRequest.emit (node:events:525:35)
    at ClientRequest.origin.emit (/app/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)
    at Socket.socketErrorListener (node:_http_client:481:9)
    at Socket.emit (node:events:513:28)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:109:26)
    at fetchWireguardConfigFile (file:///usr/src/app/packages/dappmanager/src/modules/wireguard/client.ts:86:11)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 1)
    at WireguardClient.getDeviceCredentials (file:///usr/src/app/packages/dappmanager/src/modules/wireguard/client.ts:69:41)
    at file:///usr/src/app/packages/dappmanager/src/api/handler/index.ts:36:22
Error: Error fetching credentials: Internal Server Error RequestError: getaddrinfo ENOTFOUND my.dappnode
    at ClientRequest.<anonymous> (/app/node_modules/got/dist/source/core/index.js:956:111)
    at Object.onceWrapper (node:events:628:26)
    at ClientRequest.emit (node:events:525:35)
    at ClientRequest.origin.emit (/app/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)
    at Socket.socketErrorListener (node:_http_client:481:9)
    at Socket.emit (node:events:513:28)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:109:26)
    at http://dappnode.local/static/js/main.fc43bc8a.js:2:568083
    at d (http://dappnode.local/static/js/main.fc43bc8a.js:2:536844)
    at Generator.<anonymous> (http://dappnode.local/static/js/main.fc43bc8a.js:2:538187)
    at Generator.next (http://dappnode.local/static/js/main.fc43bc8a.js:2:537207)
    at n (http://dappnode.local/static/js/main.fc43bc8a.js:2:531886)
    at s (http://dappnode.local/static/js/main.fc43bc8a.js:2:532089)
    at http://dappnode.local/static/js/main.fc43bc8a.js:2:532148
    at new Promise (<anonymous>)
    at http://dappnode.local/static/js/main.fc43bc8a.js:2:532029
    at w (http://dappnode.local/static/js/main.fc43bc8a.js:2:567889)

DAppNode version:

Core DAppNode Packages versions

System info

Additional context

Using dappnode_wireguard from the command line returns credentials, but the endpoint is blank. I have to manually fill it with the local OP Address:

[Interface]
Address = xx.xx.xx.xx
PrivateKey = xxxxxxxxxxxxxxxxxxxxxxxxx
ListenPort = 51820
DNS = 172.33.1.2,xx.xx.xx.xx

[Peer]
PublicKey = xxxxxxxxxxxxxxxxxxxxxxxx
Endpoint = :51820
AllowedIPs = 172.33.0.0/16,xx.xx.xx.xx/24

Using dappnode_wireguard --local also returns an error:

RequestError: getaddrinfo ENOTFOUND my.dappnode
    at ClientRequest.<anonymous> (/app/node_modules/got/dist/source/core/index.js:956:111)
    at Object.onceWrapper (node:events:628:26)
    at ClientRequest.emit (node:events:525:35)
    at ClientRequest.origin.emit (/app/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)
    at Socket.socketErrorListener (node:_http_client:481:9)
    at Socket.emit (node:events:513:28)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:109:26) {
  code: 'ENOTFOUND',
  timings: {
    start: 1678976181467,
    socket: 1678976181467,
    lookup: 1678976181469,
    connect: undefined,
    secureConnect: undefined,
    upload: undefined,
    response: undefined,
    end: undefined,
    error: 1678976181469,
    abort: undefined,
    phases: {
      wait: 0,
      dns: 2,
      tcp: undefined,
      tls: undefined,
      request: undefined,
      firstByte: undefined,
      download: undefined,
      total: 2
    }
  }
}
pablomendezroyo commented 1 year ago

It looks like the issue may be that your dappnode is not connected to the internet. Is your dappnode connected through ethernet to your router and the UPnP enabled?

dsimog01 commented 1 year ago

Can you see your dyndns subdomain when clicking on the avatar icon on the top right corner of the Dappmanager (UI you access via http://my.dappnode). You should see something like:

DAppNode Identity
XXXXXXXXX
xxxxxxxxxxx.dyndns.dappnode.io
XX.XX.XX.XX (public IP)
XX.XX.XX.XX  (internal IP)
stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions!

stale[bot] commented 12 months ago

This issue or pull request has been automatically been closed due to inactivity.