nanovms / ops

ops - build and run nanos unikernels
https://ops.city
MIT License
1.27k stars 132 forks source link

p2p network problem #769

Open QiZhang1997 opened 3 years ago

QiZhang1997 commented 3 years ago

Hello! Recently I'm encapsulating a P2P application with nanovms. However, I met a problem as follows:

qi@qi-HP-Pavilion-Notebook:~/bdledger$ ops run -c config2.json -p 2416 -p 2401 bdledger
booting /home/qi/.ops/images/bdledger.img ...
assigned: 10.0.2.15
Using config file:  /config.json
panic: Failed to setup BDLedger: route ip+net: netlinkrib: address family not supported by protocol

goroutine 1 [running]:
go.uber.org/zap/zapcore.(*CheckedEntry).Write(0x1680ec480, 0x0, 0x0, 0x0)
    C:/n/dev/go/pkg/mod/go.uber.org/zap@v1.16.0/zapcore/entry.go:234 +0x566
go.uber.org/zap.(*SugaredLogger).log(0x16800c480, 0x4, 0x0, 0x0, 0x16838b280, 0x2, 0x2, 0x0, 0x0, 0x0)
    C:/n/dev/go/pkg/mod/go.uber.org/zap@v1.16.0/sugar.go:234 +0x100
go.uber.org/zap.(*SugaredLogger).Panic(0x16800c480, 0x16838b280, 0x2, 0x2)
    C:/n/dev/go/pkg/mod/go.uber.org/zap@v1.16.0/sugar.go:123 +0x64
bdware.org/bdledger/cmd/bdledger/cmd.glob..func3(0x20b8d80, 0x210a840, 0x0, 0x0)
    C:/n/dev/workspace/bdware/bdledger/bdledger/cmd/bdledger/cmd/run.go:45 +0x21a
bdware.org/bdledger/cmd/bdledger/cmd.glob..func2(0x20b8d80, 0x210a840, 0x0, 0x0)
    C:/n/dev/workspace/bdware/bdledger/bdledger/cmd/bdledger/cmd/root.go:20 +0x57
github.com/spf13/cobra.(*Command).execute(0x20b8d80, 0x16803a1d0, 0x0, 0x0, 0x20b8d80, 0x16803a1d0)
    C:/n/dev/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:854 +0x29d
github.com/spf13/cobra.(*Command).ExecuteC(0x20b8d80, 0x16807c058, 0x0, 0x0)
    C:/n/dev/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:958 +0x349
github.com/spf13/cobra.(*Command).Execute(...)
    C:/n/dev/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:895
bdware.org/bdledger/cmd/bdledger/cmd.Execute()
    C:/n/dev/workspace/bdware/bdledger/bdledger/cmd/bdledger/cmd/root.go:32 +0x3b
main.main()
    C:/n/dev/workspace/bdware/bdledger/bdledger/cmd/bdledger/main.go:6 +0x20
exit status 5

I looked up a lot of information, and it seems that this problem is caused by the fact that nanos does not support IPv6. After that, I noticed that the master branch of nanos supports IPv6 now. Then I compiled the master branch of 'nanos' program. I replaced these three binary files in ops home directory.

cp output/tools/bin/mkfs ~/.ops/0.1.17/.
cp output/platform/pc/boot/boot.img ~/.ops/0.1.17/.
cp output/platform/pc/bin/kernel.img ~/.ops/0.1.17/.

After that I tested it again, but I still encounter the above error. I don’t know if this error is caused by ipv6, can anyone give me some suggestions. Thanks a lot!

francescolavra commented 3 years ago

Hi @QiZhang1997, I can confirm that Nanos supports IPv6, the problem here is that Nanos doesn't support Netlink sockets yet, we are tracking this issue in https://github.com/nanovms/nanos/issues/453.

QiZhang1997 commented 3 years ago

Hi @QiZhang1997, I can confirm that Nanos supports IPv6, the problem here is that Nanos doesn't support Netlink sockets yet, we are tracking this issue in nanovms/nanos#453.

OK! I got it. Thanks a lot!

eyberg commented 3 years ago

also @QiZhang1997 fyi - if you run ops update you can get the latest release which should be 0.1.28 - and if you ever want to use what's in nanos master - we do nightly builds and you can use that via the '-n' switch for ops run

QiZhang1997 commented 3 years ago

also @QiZhang1997 fyi - if you run ops update you can get the latest release which should be 0.1.28 - and if you ever want to use what's in nanos master - we do nightly builds and you can use that via the '-n' switch for ops run

yep! I will try it.

francescolavra commented 3 years ago

The issue should be fixed now in the Nanos master branch (see https://github.com/nanovms/nanos/pull/1407).