{"record":{"id":"ebd8caf14a5ed29d","repo":"kubernetes/kops","slug":"failed-to-create-bpf-mount-unit-w","errorCode":null,"errorMessage":"failed to create bpf mount unit: %w","messagePattern":"failed to create bpf mount unit: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nodeup/pkg/model/networking/cilium.go","lineNumber":54,"sourceCode":"}\n\nvar _ fi.NodeupModelBuilder = &CiliumBuilder{}\n\n// Build is responsible for configuring the network cni\nfunc (b *CiliumBuilder) Build(c *fi.NodeupModelBuilderContext) error {\n\t// As long as the Cilium Etcd cluster exists, we should do this\n\tif b.NodeupConfig.UseCiliumEtcd {\n\t\tif err := b.buildCiliumEtcdSecrets(c); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif b.NodeupConfig.Networking.Cilium == nil {\n\t\treturn nil\n\t}\n\n\tif err := b.buildBPFMount(c); err != nil {\n\t\treturn fmt.Errorf(\"failed to create bpf mount unit: %w\", err)\n\t}\n\n\tif err := b.buildCgroup2Mount(c); err != nil {\n\t\treturn fmt.Errorf(\"failed to create cgroupv2 mount unit: %w\", err)\n\t}\n\n\tdisableManageForeignRoutes(c, b.Distribution)\n\tdisableCloudInitNetworkHotplug(c, b.Distribution)\n\n\tif b.NodeupConfig.Networking.Cilium.IPAM == kops.CiliumIpamEni {\n\t\tmaskEC2NetUtilsUdevRules(c, b.Distribution)\n\t\tsetMACAddressPolicyNone(c, b.Distribution)\n\t\tif err := markSecondaryENIsUnmanaged(c, b.Distribution); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/nodeup/pkg/model/networking/cilium.go#L36-L72","documentation":"CiliumBuilder.Build, when Cilium networking is configured, creates a systemd mount unit for /sys/fs/bpf via buildBPFMount; any failure from that helper is wrapped in this error. The BPF fs mount is required by Cilium's eBPF datapath, so nodeup aborts the Cilium model build without it.","triggerScenarios":"buildBPFMount(c) returns an error during nodeup Build with Cilium enabled — practically, unix.Statfs(\"/sys/fs/bpf\") failing (see error 717) or an error adding the mount task.","commonSituations":"Kernel without BPF filesystem support (missing CONFIG_BPF_FS); restricted container/nodeup environments where /sys is not mounted; very old or minimal kernel images.","solutions":["Boot a kernel with bpffs support (CONFIG_BPF_FS=y) — upgrade the image/kernel","Ensure /sys is mounted (and not fully masked) on the node before nodeup runs","Inspect the wrapped %w error to confirm whether Statfs failed","Check the generated systemd mount unit for invalid settings if the failure is at task-add time"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"var fsdata unix.Statfs_t\nif err := unix.Statfs(\"/sys/fs/bpf\", &fsdata); err != nil {\n    return fmt.Errorf(\"bpffs unavailable, Cilium build would fail: %v\", err)\n}","typeGuard":null,"tryCatchPattern":"if err := b.buildBPFMount(c); err != nil {\n    klog.Errorf(\"bpf mount unit creation failed: %v\", err)\n    return fmt.Errorf(\"failed to create bpf mount unit: %w\", err)\n}","preventionTips":["Choose node images with modern kernels (bpffs + systemd ≥ v238)","Do not mask or unmount /sys in node bootstrap environments","Test Cilium enablement on a staging image before production"],"tags":["nodeup","cilium","bpf","systemd","mount"],"backgroundTag":"bpf-mount-unit-failed","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}