Checklist
Installation method
ipfs-desktop
Version
Config
No response
Description
I posted on the forums and stack overflow about this issue because I assumed this was my fault for doing something wrong.
However, it appears as if it is not obvious what I'm doing wrong or there is a bug.
If it is not a bug then this needs to be expressed how to do in the documentation since this is basic stuff.
Hence, why I'm posting this as an issue.
I’m getting an invalid memory address or nil pointer dereference from IpfsNode.Bootstrap I assume that there is some panic in bootstrap Round, but am I doing something wrong here? Or is there a bug? I’m using kubo v0.20.0 here is my code:
package main
import (
"context"
"fmt"
"github.com/ipfs/kubo/config"
"github.com/ipfs/kubo/core"
"github.com/ipfs/kubo/core/bootstrap"
)
func main() {
ctx := context.Background()
conf := core.BuildCfg{}
node, err := core.NewNode(ctx, &conf)
if err != nil {
panic(err)
}
peers, err := config.DefaultBootstrapPeers()
if err != nil {
panic(err)
}
bs_conf := bootstrap.BootstrapConfigWithPeers(peers)
err = node.Bootstrap(bs_conf) // this gets nil pointer dereference
fmt.Println("THIS LINE WILL NOT PRINT")
if err != nil {
panic(err)
}
}
The full error is:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0xee49eb]
goroutine 69 [running]:
github.com/ipfs/kubo/core/bootstrap.bootstrapRound({0x18bf1d8?, 0xc0000b05f0?}, {0x0, 0x0}, {0x0?, 0x0?, 0x0?, 0xc0006240c0?})
/home/axel/go/pkg/mod/github.com/ipfs/kubo@v0.20.0/core/bootstrap/bootstrap.go:118 +0xab
github.com/ipfs/kubo/core/bootstrap.Bootstrap.func1({0x18cbd58?, 0xc0006226c0?})
/home/axel/go/pkg/mod/github.com/ipfs/kubo@v0.20.0/core/bootstrap/bootstrap.go:89 +0xdc
github.com/jbenet/goprocess.(*process).Go.func1()
/home/axel/go/pkg/mod/github.com/jbenet/goprocess@v0.1.4/impl-mutex.go:134 +0x36
created by github.com/jbenet/goprocess.(*process).Go
/home/axel/go/pkg/mod/github.com/jbenet/goprocess@v0.1.4/impl-mutex.go:133 +0x238
exit status 2
the bs_conf := bootstrap.BootstrapConfigWithPeers(peers) is {4 30s 10s 0x112b700}
Checklist
Installation method
ipfs-desktop
Version
Config
No response
Description
I posted on the forums and stack overflow about this issue because I assumed this was my fault for doing something wrong.
However, it appears as if it is not obvious what I'm doing wrong or there is a bug.
If it is not a bug then this needs to be expressed how to do in the documentation since this is basic stuff.
Hence, why I'm posting this as an issue.
I’m getting an invalid memory address or nil pointer dereference from IpfsNode.Bootstrap I assume that there is some panic in bootstrap Round, but am I doing something wrong here? Or is there a bug? I’m using kubo v0.20.0 here is my code:
The full error is:
the
bs_conf := bootstrap.BootstrapConfigWithPeers(peers)is{4 30s 10s 0x112b700}