diff --git a/cmd/run.go b/cmd/run.go index b8f3619..75c2362 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -227,6 +227,7 @@ func newControlPlane(log *logrus.Logger, bpf interface{}, conf *config.Config) ( break } log.Infof("Bad status: %v (%v)", resp.Status, resp.StatusCode) + time.Sleep(5 * time.Second) } log.Infoln("Network online.") } diff --git a/control/bpf_utils.go b/control/bpf_utils.go index 8efd9f5..7550b88 100644 --- a/control/bpf_utils.go +++ b/control/bpf_utils.go @@ -11,10 +11,10 @@ import ( "errors" "fmt" "github.com/cilium/ebpf" - "github.com/sirupsen/logrus" "github.com/daeuniverse/dae/common" "github.com/daeuniverse/dae/common/consts" "github.com/daeuniverse/dae/pkg/ebpf_internal" + "github.com/sirupsen/logrus" "net/netip" "os" "path/filepath" @@ -210,7 +210,9 @@ retryLoadBpf: } } if strings.Contains(err.Error(), "no BTF found for kernel version") { - err = fmt.Errorf("%w: maybe installing the linux-headers package will solve it", err) + err = fmt.Errorf("%w: you should re-compile linux kernel with BTF configurations; see docs for more information", err) + } else if strings.Contains(err.Error(), "unknown func bpf_trace_printk") { + err = fmt.Errorf(`%w: please try to compile dae without bpf_printk; example of cross-compilation to arm64: make GOARCH=arm64 CGO_ENABLED=0 CFLAGS="-D__REMOVE_BPF_PRINTK"`, err) } return err } diff --git a/pkg/config_parser/config_parser_test.go b/pkg/config_parser/config_parser_test.go index 2f39eee..4995ccc 100644 --- a/pkg/config_parser/config_parser_test.go +++ b/pkg/config_parser/config_parser_test.go @@ -88,6 +88,6 @@ routing { t.Fatalf("\n%v", err) } for _, section := range sections { - t.Logf("\n%v", section.String()) + t.Logf("\n%v", section.String(false, false)) } }