Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy pod failed with "Error: failed to set xdp to dev eth0, err is numerical result out of range\n" #1253

Open
calvinxu1526 opened this issue Feb 25, 2025 · 10 comments
Assignees

Comments

@calvinxu1526
Copy link

Hi,

after deployment of kmesh, tried to deploy a pod failed as below, any advice? thanks.
Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "9d5e8d8ed639459ce1863e13a4db3f2af7107321d98c9f01b4480418e223488b": plugin type="kmesh-cni" failed (add): netplugin failed: "Error: failed to set xdp to dev eth0, err is numerical result out of range\n"

`
#kubectl describe po testpo
Name: testpo
Namespace: default
Priority: 0
Service Account: default
..
Annotations: ...
kmesh.net/redirection: enabled
Status: Pending
Events:
Type Reason Age From Message


Normal Scheduled ...
Warning FailedCreatePodSandBox 16s kubelet Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "90badd37fb40d2418c35900a2a9b8e70dd120336c4d24194d53c2628fb2bd63e": plugin type="kmesh-cni" failed (add): netplugin failed: "Error: failed to set xdp to dev eth0, err is numerical result out of range\n"
Warning FailedCreatePodSandBox 15s kubelet Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "40a81a1c8a1918fe86d8fec07c77038de8d962917c3340f2155d29a4500eb462": plugin type="kmesh-cni" failed (add): netplugin failed: "Error: failed to set xdp to dev eth0, err is numerical result out of range\n"
...
`

@hzxuzhonghu
Copy link
Member

@weli-l @tacslon can u take a look

@hzxuzhonghu
Copy link
Member

@calvinxu1526 what is your env, which k8s do you use?

@tacslon
Copy link
Contributor

tacslon commented Feb 26, 2025

@calvinxu1526 Hello, please run uname -a to show your kernel version.
Also, print xdp.FD() in pkg\cni\plugin\plugin.go line 126 to see if it's a valid value.

@calvinxu1526
Copy link
Author

#uname -r
6.4.0-150600.21-default
well, can't add print info as I don't have the dev env for that just use it from end-user

@LiZhenCheng9527
Copy link
Collaborator

/assign @tacslon

@calvinxu1526
Copy link
Author

any advice for the issue, is it a bug for some configuration needed

@tacslon
Copy link
Contributor

tacslon commented Mar 7, 2025

any advice for the issue, is it a bug for some configuration needed

Hi, I'm working on reappearing your problem, could you please give more details, like the .yaml file used to create this Pod?

@calvinxu1526
Copy link
Author

calvinxu1526 commented Mar 7, 2025

# kubectl run alpine-pod --image=alpine --restart=Never --command -- sh -c "sleep infinity"
# kubectl describe po alpine-pod
...
Name:             alpine-pod
Namespace:        default
Priority:         0
Service Account:  default
...
Start Time:       Fri, 07 Mar 2025 20:14:08 +0100
Labels:           run=alpine-pod
Annotations:      cni.projectcalico.org/containerID: bfaae3fbf0b9115694271e03197e3e5c3c2020344e9397843988f563fb888ea3
                  cni.projectcalico.org/podIP: 192.168.153.57/32
                  cni.projectcalico.org/podIPs: 192.168.153.57/32,fc00:1000::9939/128
                  kmesh.net/redirection: enabled
Status:           Pending
...
Events:
  Type     Reason                  Age                 From               Message
  ----     ------                  ----                ----               -------
  Normal   Scheduled               90s                 default-scheduler  Successfully assigned default/alpine-pod to node-xx-xx-xx
  Warning  FailedCreatePodSandBox  88s                 kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "c59f71d8c82d3cac1b872fd4d00042a2b0f8289f6b511c7698addc45ec5940e9": plugin type="kmesh-cni" failed (add): netplugin failed: "Error: failed to set xdp to dev eth0, err is numerical result out of range\n"
  Warning  FailedCreatePodSandBox  87s                 kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "222ebe0a3f5fc2316887fe22c21b32b5bde75319948896c2996b15fe01440136": plugin type="kmesh-cni" failed (add): netplugin failed: "Error: failed to set xdp to dev eth0, err is numerical result out of range\n"
  Warning  FailedCreatePodSandBox  86s                 kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "c8de4e0c7ad7d246e26fa470ed0f5729241b986b1030dba5f63a2fde656fa00b": plugin type="kmesh-cni" failed (add): netplugin failed: "Error: failed to set xdp to dev eth0, err is numerical result out of range\n"
  Warning  FailedCreatePodSandBox  85s                 kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "066193e86d53b4a6dd8ea6e50d4fdf764033aeaecb0af47a19dae667abd6a3ab": plugin type="kmesh-cni" failed (add): netplugin failed: "Error: failed to set xdp to dev eth0, err is numerical result out of range\n"
  Warning  FailedCreatePodSandBox  84s                 kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "7b324f332ab1de887f4dbdfd841657009835c264c1dfb629aae701763961eb35": plugin type="kmesh-cni" failed (add): netplugin failed: "Error: failed to set xdp to dev eth0, err is numerical result out of range\n"
  Warning  FailedCreatePodSandBox  83s                 kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "94753719095125dc4ebcd7daec11af34ec69021c9b3ccddc36fda8b7b61d3770": plugin type="kmesh-cni" failed (add): netplugin failed: "Error: failed to set xdp to dev eth0, err is numerical result out of range\n"
  Warning  FailedCreatePodSandBox  81s                 kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "390934b62a2d8c6bf7ad0eaaf84b6ae417c263be7e42675718f30db7cb66a857": plugin type="kmesh-cni" failed (add): netplugin failed: "Error: failed to set xdp to dev eth0, err is numerical result out of range\n"
  Warning  FailedCreatePodSandBox  79s                 kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "90341877db53b4c62ab8ca2fcbd4ec95dad4e779c111f880e5c34010823bf828": plugin type="kmesh-cni" failed (add): netplugin failed: "Error: failed to set xdp to dev eth0, err is numerical result out of range\n"
  Warning  FailedCreatePodSandBox  77s                 kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "c1dc235525c1e116ea1edd520ce179f17d47e561d785796046ed0bef0b29492d": plugin type="kmesh-cni" failed (add): netplugin failed: "Error: failed to set xdp to dev eth0, err is numerical result out of range\n"
  Warning  FailedCreatePodSandBox  56s (x16 over 75s)  kubelet            (combined from similar events): Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "fd8bd039f52c822137a126c4ce4bece8a3a557fb9dd212db17e9b02ef7532818": plugin type="kmesh-cni" failed (add): netplugin failed: "Error: failed to set xdp to dev eth0, err is numerical result out of range\n"

@hzxuzhonghu
Copy link
Member

The error seems coming from https://github.com/kmesh-net/kmesh/blob/1dd17503c480a081752cd3946375d9ad02c7e968/pkg/cni/plugin/plugin.go

Should first add some more error info below to figureout which function call failed.

func enableXdpAuth(ifname string) error {
	var (
		err  error
		xdp  *ebpf.Program
		link netlink.Link
	)

	if xdp, err = utils.GetProgramByName(constants.XDP_PROG_NAME); err != nil {
		return err
	}

	if link, err = netlink.LinkByName(ifname); err != nil {
		return err
	}

	if err = netlink.LinkSetXdpFd(link, xdp.FD()); err != nil {
		return err
	}

	return nil
}

@calvinxu1526
Copy link
Author

just wondering whether you're trying to reproduce or debug the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants