panic: runtime error: invalid memory address or nil pointer dereference
jingkang99 opened this issue · comments
./edgevpn api
command throws out some error.
another issue, it is fine (not always) to create a NIC on a physical Ubuntu box, but not on a vm and rasberry PI.
EDGEVPNTOKEN=$EDGEVPNTOKEN ./edgevpn --address 10.1.0.11/24
root@ostella-18:/box/vpn/edgevpn# ./edgevpn
INFO edgevpn Copyright (C) 2021-2022 Ettore Di Giacinto
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions.
INFO Version: commit:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0xd0767f]
goroutine 1 [running]:
github.com/mudler/edgevpn/pkg/blockchain.(*Ledger).newGenesis(0xc000960d50)
github.com/mudler/edgevpn/pkg/blockchain/ledger.go:60 +0x15f
github.com/mudler/edgevpn/pkg/blockchain.New(...)
github.com/mudler/edgevpn/pkg/blockchain/ledger.go:52
github.com/mudler/edgevpn/pkg/node.(*Node).Ledger(0xc0002c0fc0)
github.com/mudler/edgevpn/pkg/node/node.go:85 +0x17a
github.com/mudler/edgevpn/pkg/node.(*Node).Start(0xc0002c0fc0, {0x152baf0, 0xc000146350})
github.com/mudler/edgevpn/pkg/node/node.go:92 +0x46
github.com/mudler/edgevpn/cmd.Main.func1(0xc0002be840)
github.com/mudler/edgevpn/cmd/main.go:196 +0xbaf
github.com/urfave/cli.HandleAction({0xefd3a0, 0x14033e0}, 0xc0002c0e00)
github.com/urfave/cli@v1.22.5/app.go:524 +0xa8
github.com/urfave/cli.(*App).Run(0xc0002c0e00, {0xc0001181e0, 0x1, 0x1})
github.com/urfave/cli@v1.22.5/app.go:286 +0x625
main.main()
github.com/mudler/edgevpn/main.go:50 +0x5a5
Hi! Thanks for opening an issue!
I've been able to reproduce this by passing by a EDGEVPNTOKEN
which is invalid, for example that is containing a space and not in base64 format. Can you try to specify the token with --token
, or print out $EDGEVPNTOKEN
on your terminal to confirm that's not empty?
I've been running edgevpn fine on my rpi, and in other different linux distros (alpine included), so I don't think it's related to the Environment.
I'm going to land a patch to make it fail properly, as in this case it looks like there is something going wrong, but actually it's the token which is invalid.
Thanks for your patience, really appreciated!
This should be fixed by now, thanks for reporting the issue!