input-output-hk / daedalus

The open source cryptocurrency wallet for ada, built to grow with the community
https://daedaluswallet.io/
Apache License 2.0
1.23k stars 297 forks source link

Node crash on boot when ipv6 is disabled #2788

Closed ikulis closed 2 years ago

ikulis commented 2 years ago

If the ipv6 is disabled on the system, the node crashes on boot. I have it disabled, because of use of vpn.

Image

Version

Broken in 4.6.0. In the version 4.5.2 it was booting fine.

How to reproduce (linux):

Error in developer console:

renderer.js:34 [2021-12-17T07:15:17.262Z] [daedalus.*mainnet*:error:ipcRenderer] {
  "msg": "AdaApi::getNetworkInfo error",
  "data": {
    "error": {}
  }
}

Node logs:

[charon:cardano.node.networkMagic:Notice:5] [2021-12-17 07:04:11.44 UTC] NetworkMagic 764824073
[charon:cardano.node.basicInfo.protocol:Notice:5] [2021-12-17 07:04:11.44 UTC] Byron; Shelley
[charon:cardano.node.basicInfo.version:Notice:5] [2021-12-17 07:04:11.44 UTC] 1.30.1
[charon:cardano.node.basicInfo.commit:Notice:5] [2021-12-17 07:04:11.44 UTC] 0fb43f4e3da8b225f4f86557aed90a183981a64f
[charon:cardano.node.basicInfo.nodeStartTime:Notice:5] [2021-12-17 07:04:11.44 UTC] 2021-12-17 07:04:11.446871982 UTC
[charon:cardano.node.basicInfo.systemStartTime:Notice:5] [2021-12-17 07:04:11.44 UTC] 2017-09-23 21:44:51 UTC
[charon:cardano.node.basicInfo.slotLengthByron:Notice:5] [2021-12-17 07:04:11.44 UTC] 20s
[charon:cardano.node.basicInfo.epochLengthByron:Notice:5] [2021-12-17 07:04:11.44 UTC] 21600
[charon:cardano.node.basicInfo.slotLengthShelley:Notice:5] [2021-12-17 07:04:11.44 UTC] 1s
[charon:cardano.node.basicInfo.epochLengthShelley:Notice:5] [2021-12-17 07:04:11.44 UTC] 432000
[charon:cardano.node.basicInfo.slotsPerKESPeriodShelley:Notice:5] [2021-12-17 07:04:11.44 UTC] 129600
[charon:cardano.node.basicInfo.slotLengthAllegra:Notice:5] [2021-12-17 07:04:11.44 UTC] 1s
[charon:cardano.node.basicInfo.epochLengthAllegra:Notice:5] [2021-12-17 07:04:11.44 UTC] 432000
[charon:cardano.node.basicInfo.slotsPerKESPeriodAllegra:Notice:5] [2021-12-17 07:04:11.44 UTC] 129600
[charon:cardano.node.basicInfo.slotLengthMary:Notice:5] [2021-12-17 07:04:11.44 UTC] 1s
[charon:cardano.node.basicInfo.epochLengthMary:Notice:5] [2021-12-17 07:04:11.44 UTC] 432000
[charon:cardano.node.basicInfo.slotsPerKESPeriodMary:Notice:5] [2021-12-17 07:04:11.44 UTC] 129600
[charon:cardano.node.basicInfo.slotLengthAlonzo:Notice:5] [2021-12-17 07:04:11.44 UTC] 1s
[charon:cardano.node.basicInfo.epochLengthAlonzo:Notice:5] [2021-12-17 07:04:11.44 UTC] 432000
[charon:cardano.node.basicInfo.slotsPerKESPeriodAlonzo:Notice:5] [2021-12-17 07:04:11.44 UTC] 129600
[charon:cardano.node.error:Notice:5] [2021-12-17 07:04:11.44 UTC] Failure while getting address information for the public listening address: Just ::1 Just 37103 : Network.Socket.getAddrInfo (called with preferred socket type/protocol: AddrInfo {addrFlags = [AI_PASSIVE,AI_ADDRCONFIG], addrFamily = AF_UNSPEC, addrSocketType = Stream, addrProtocol = 0, addrAddress = 0.0.0.0:0, addrCanonName = Nothing}, host name: Just "::1", service name: Just "37103"): does not exist (Address family for hostname not supported)
GetAddrInfoError (Just ::1) (Just 37103) Network.Socket.getAddrInfo (called with preferred socket type/protocol: AddrInfo {addrFlags = [AI_PASSIVE,AI_ADDRCONFIG], addrFamily = AF_UNSPEC, addrSocketType = Stream, addrProtocol = 0, addrAddress = 0.0.0.0:0, addrCanonName = Nothing}, host name: Just "::1", service name: Just "37103"): does not exist (Address family for hostname not supported)

cardano-node: Failure while getting address information for the public listening address: Just ::1 Just 37103 : Network.Socket.getAddrInfo (called with preferred socket type/protocol: AddrInfo {addrFlags = [AI_PASSIVE,AI_ADDRCONFIG], addrFamily = AF_UNSPEC, addrSocketType = Stream, addrProtocol = 0, addrAddress = 0.0.0.0:0, addrCanonName = Nothing}, host name: Just "::1", service name: Just "37103"): does not exist (Address family for hostname not supported)

Cardano wallet logs

[cardano-wallet.main:Info:4] [2021-12-17 07:04:10.84 UTC] Running as v2021-11-11 (git revision: dac16ba7e3bf64bf5474497656932fd342c3b720) on x86_64-linux
[cardano-wallet.main:Info:4] [2021-12-17 07:04:10.84 UTC] Command line: /nix/store/...-daedalus-cardano-bridge/bin/cardano-wallet serve --shutdown-handler --port 34439 --database ~/.local/share/Daedalus/mainnet/wallets --tls-ca-cert ~/.local/share/Daedalus/mainnet/tls/server/ca.crt --tls-sv-cert ~/.local/share/Daedalus/mainnet/tls/server/server.crt --tls-sv-key ~/.local/share/Daedalus/mainnet/tls/server/server.key --token-metadata-server https://tokens.cardano.org --sync-tolerance 300s --mainnet --node-socket ~/.local/share/Daedalus/mainnet/cardano-node.socket
[cardano-wallet.main:Debug:4] [2021-12-17 07:04:10.84 UTC] Cross-platform subprocess shutdown handler is enabled.
[cardano-wallet.main:Debug:12] [2021-12-17 07:04:10.84 UTC] ServeArgs {_hostPreference = Host "127.0.0.1", _listen = ListenOnPort 34439, _tlsConfig = Just (TlsConfiguration {tlsCaCert = "~/.local/share/Daedalus/mainnet/tls/server/ca.crt", tlsSvCert = "~/.local/share/Daedalus/mainnet/tls/server/server.crt", tlsSvKey = "~/.local/share/Daedalus/mainnet/tls/server/server.key"}), _nodeSocket = CardanoNodeConn "~/.local/share/Daedalus/mainnet/cardano-node.socket", _networkConfiguration = MainnetConfig, _database = Just "~/.local/share/Daedalus/mainnet/wallets", _syncTolerance = SyncTolerance 300s, _enableShutdownHandler = True, _poolMetadataSourceOpt = Nothing, _tokenMetadataSourceOpt = Just (TokenMetadataServer {unTokenMetadataServer = https://tokens.cardano.org}), _logging = LoggingOptions {loggingMinSeverity = Debug, loggingTracers = Tracers {applicationTracer = Const (Just Info), apiServerTracer = Const (Just Info), tokenMetadataTracer = Const (Just Info), walletEngineTracer = Const (Just Info), walletDbTracer = Const (Just Info), poolsEngineTracer = Const (Just Info), poolsDbTracer = Const (Just Info), ntpClientTracer = Const (Just Info), networkTracer = Const (Just Info)}, loggingTracersDoc = Nothing}}
[cardano-wallet.main:Info:12] [2021-12-17 07:04:10.84 UTC] Wallet databases: Using directory: ~/.local/share/Daedalus/mainnet/wallets
[cardano-wallet.application:Info:12] [2021-12-17 07:04:10.84 UTC] Wallet backend server starting. Using ~/.local/share/Daedalus/mainnet/cardano-node.socket.
[cardano-wallet.application:Info:12] [2021-12-17 07:04:10.84 UTC] Node is Haskell Node on mainnet.
[cardano-wallet.wallet-db:Info:12] [2021-12-17 07:04:10.86 UTC] Found existing wallet: 38e2...276b
[cardano-wallet.wallet-db:Info:29] [2021-12-17 07:04:10.86 UTC] Starting connection pool for ~/.local/share/Daedalus/mainnet/wallets/she.38e2...276b.sqlite
[cardano-wallet.wallet-engine:Info:37] [2021-12-17 07:04:10.87 UTC] 38e2cb12: Chain following starting.
[cardano-wallet.pools-db:Info:12] [2021-12-17 07:04:10.87 UTC] Starting connection pool for ~/.local/share/Daedalus/mainnet/wallets/stake-pools.sqlite
[cardano-wallet.pools-engine:Info:45] [2021-12-17 07:04:11.02 UTC] Chain following starting.
[cardano-wallet.main:Info:12] [2021-12-17 07:04:11.02 UTC] Wallet backend server listening on https://127.0.0.1:34439/
[cardano-wallet.network:Notice:16] [2021-12-17 07:04:11.11 UTC] Couldn't connect to node (x2). Retrying in a bit...
[cardano-wallet.network:Notice:18] [2021-12-17 07:04:11.11 UTC] Couldn't connect to node (x2). Retrying in a bit...
[cardano-wallet.network:Notice:20] [2021-12-17 07:04:11.11 UTC] Couldn't connect to node (x2). Retrying in a bit...
[cardano-wallet.network:Notice:37] [2021-12-17 07:04:11.14 UTC] Couldn't connect to node (x2). Retrying in a bit...
[cardano-wallet.network:Notice:45] [2021-12-17 07:04:11.27 UTC] Couldn't connect to node (x2). Retrying in a bit...
[cardano-wallet.pools-engine:Info:47] [2021-12-17 07:04:11.28 UTC] Successfully checked health HealthStatusSMASH {status = "OK", version = "12.0.1"}
[cardano-wallet.network:Warning:16] [2021-12-17 07:04:11.36 UTC] Couldn't connect to node (x3). Retrying in a bit...
[cardano-wallet.network:Warning:18] [2021-12-17 07:04:11.36 UTC] Couldn't connect to node (x3). Retrying in a bit...
[cardano-wallet.network:Warning:20] [2021-12-17 07:04:11.36 UTC] Couldn't connect to node (x3). Retrying in a bit...
[cardano-wallet.network:Warning:37] [2021-12-17 07:04:11.39 UTC] Couldn't connect to node (x3). Retrying in a bit...
[cardano-wallet.network:Warning:45] [2021-12-17 07:04:11.52 UTC] Couldn't connect to node (x3). Retrying in a bit...
[cardano-wallet.main:Notice:11] [2021-12-17 07:04:11.85 UTC] Starting clean shutdown...
[cardano-wallet.pools-db:Info:12] [2021-12-17 07:04:11.85 UTC] Stopping database connection pool ~/.local/share/Daedalus/mainnet/wallets/stake-pools.sqlite
[cardano-wallet.pools-db:Info:12] [2021-12-17 07:04:11.85 UTC] Closing single database connection (~/.local/share/Daedalus/mainnet/wallets/stake-pools.sqlite)
[cardano-wallet.pools-db:Info:12] [2021-12-17 07:04:11.85 UTC] Closing single database connection (~/.local/share/Daedalus/mainnet/wallets/stake-pools.sqlite)
[cardano-wallet.main:Debug:4] [2021-12-17 07:04:11.86 UTC] Logging shutdown.
danielmain commented 2 years ago

Hi @ikulis thank you so much for giving us this detailed report! I added an Issue on our cardano-node GitHub page here: https://github.com/input-output-hk/cardano-node/issues/3449

Thank you so much!!

KrisPett commented 2 years ago

I have a similar issue where Cardano Node keeps crashing when I am connected to nordvpn, when disconnecting from nordvpn the issue disappear.

danielmain commented 2 years ago

This Issue will be resolved in the scope of ADP-1334

danielmain commented 2 years ago

Fix coming soon 😊 https://github.com/input-output-hk/daedalus/pull/2839

adamwojt commented 2 years ago

I have a similar issue where Cardano Node keeps crashing when I am connected to nordvpn, when disconnecting from nordvpn the issue disappear.

@KQT3 Same here. VPN on -> Daedalus crashes. But this still fits sysctl net.ipv6.conf.all.disable_ipv6 problem as it gets set to 1 when VPN is on.

gitmachtl commented 2 years ago

I made a short oneliner to fix it temporary by commenting out the troublemaking line in the index.js file of the launcher

https://github.com/input-output-hk/daedalus/pull/2839#issuecomment-1079997820

I have made a oneliner to fix it temporary:

cd $HOME/.daedalus/nix/store && tmpfile=$(ack -l "concat\(args.listen.address6") && chmod 755 $(dirname "$tmpfile") && chmod 600 "$tmpfile" && sed -i "s+.concat(args.listen.address6+//.concat\(args.listen.address6+" "$tmpfile" && chmod 444 "$tmpfile" && chmod 555 $(dirname "$tmpfile") && tmpfile= && cd - && echo "IPv6 start parameter disabled"

If the little tool ack is not installed, install it first like typically:

sudo apt update && sudo apt install ack

Why does this take so long to fix it? Not skilled users will never be able to start Daedalus on such Systems.

dmitrii-gaico commented 2 years ago

@ikulis Hello. Could you please advise you are still facing the issue after the latest Daedalus release? Thank you in advance!

pauljgardner commented 2 years ago

Did the upgrade from 4.9.0 to 4.10.0 today on Ubuntu 20.04 and all went well. Thanks so much!

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Dmitrii Gaico @.> Sent: Monday, May 16, 2022 2:05:20 AM To: input-output-hk/daedalus @.> Cc: Paul Gardner @.>; Manual @.> Subject: Newsletter:_ Re: [input-output-hk/daedalus] Node crash on boot when ipv6 is disabled (Issue #2788)

@ikulishttps://github.com/ikulis Hello. Could you please advise you are still facing the issue after the latest Daedalus release? Thank you in advance!

— Reply to this email directly, view it on GitHubhttps://github.com/input-output-hk/daedalus/issues/2788#issuecomment-1127357606, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADEQMZWMQGMBEXQG47G36MLVKH6UBANCNFSM5KIF5GXQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>

ikulis commented 2 years ago

@dmitrii-gaico @danielmain After upgrading to 4.10.0#21740 , it works great with ipv6 disabled.

Thank you very much :1st_place_medal: