Skip to content

Failed to compile eBPF code for the Linux distro 'debian' running kernel version 6.8.0-86-generic #477

Description

@hahakiki2025

What happened?

Description

Install EBPF helm chart on Ubuntu 2404, and the collector kernel pod, although running, emits the following error:

root@corgi-jumper:~# kubectl logs -f my-opentelemetry-ebpf-kernel-collector-lnlnp -n ebpf
resolving kernel headers...
cleaning up stale kprobes...
launching kernel collector...
+ exec /srv/kernel-collector --host-distro debian --kernel-headers-source pre_installed --config-file=/etc/network-explorer/config.yaml --disable-nomad-metadata --warning
In file included from ../../../src/collector/kernel/bpf_src/render_bpf.c:39:
In file included from include/net/tcp.h:35:
In file included from include/net/sock_reuseport.h:5:
In file included from include/linux/filter.h:9:
include/linux/bpf.h:351:10: error: invalid application of 'sizeof' to an incomplete type 'struct bpf_rb_root'
                return sizeof(struct bpf_rb_root);
                       ^     ~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:351:24: note: forward declaration of 'struct bpf_rb_root'
                return sizeof(struct bpf_rb_root);
                                     ^
include/linux/bpf.h:353:10: error: invalid application of 'sizeof' to an incomplete type 'struct bpf_rb_node'
                return sizeof(struct bpf_rb_node);
                       ^     ~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:353:24: note: forward declaration of 'struct bpf_rb_node'
                return sizeof(struct bpf_rb_node);
                                     ^
include/linux/bpf.h:355:10: error: invalid application of 'sizeof' to an incomplete type 'struct bpf_refcount'
                return sizeof(struct bpf_refcount);
                       ^     ~~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:355:24: note: forward declaration of 'struct bpf_refcount'
                return sizeof(struct bpf_refcount);
                                     ^
include/linux/bpf.h:378:10: error: invalid application of '__alignof' to an incomplete type 'struct bpf_rb_root'
                return __alignof__(struct bpf_rb_root);
                       ^          ~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:378:29: note: forward declaration of 'struct bpf_rb_root'
                return __alignof__(struct bpf_rb_root);
                                          ^
include/linux/bpf.h:380:10: error: invalid application of '__alignof' to an incomplete type 'struct bpf_rb_node'
                return __alignof__(struct bpf_rb_node);
                       ^          ~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:380:29: note: forward declaration of 'struct bpf_rb_node'
                return __alignof__(struct bpf_rb_node);
                                          ^
include/linux/bpf.h:382:10: error: invalid application of '__alignof' to an incomplete type 'struct bpf_refcount'
                return __alignof__(struct bpf_refcount);
                       ^          ~~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:382:29: note: forward declaration of 'struct bpf_refcount'
                return __alignof__(struct bpf_refcount);
                                          ^
In file included from ../../../src/collector/kernel/bpf_src/render_bpf.c:39:
In file included from include/net/tcp.h:48:
include/linux/bpf-cgroup.h:51:2: error: use of undeclared identifier 'BPF_CGROUP_UNIX_CONNECT'
        CGROUP_ATYPE(CGROUP_UNIX_CONNECT);
        ^
include/linux/bpf-cgroup.h:36:7: note: expanded from macro 'CGROUP_ATYPE'
        case BPF_##type: return type
             ^
<scratch space>:73:1: note: expanded from here
BPF_CGROUP_UNIX_CONNECT
^
In file included from ../../../src/collector/kernel/bpf_src/render_bpf.c:39:
In file included from include/net/tcp.h:48:
include/linux/bpf-cgroup.h:56:2: error: use of undeclared identifier 'BPF_CGROUP_UNIX_SENDMSG'
        CGROUP_ATYPE(CGROUP_UNIX_SENDMSG);
        ^
include/linux/bpf-cgroup.h:36:7: note: expanded from macro 'CGROUP_ATYPE'
        case BPF_##type: return type
             ^
<scratch space>:78:1: note: expanded from here
BPF_CGROUP_UNIX_SENDMSG
^
In file included from ../../../src/collector/kernel/bpf_src/render_bpf.c:39:
In file included from include/net/tcp.h:48:
include/linux/bpf-cgroup.h:60:2: error: use of undeclared identifier 'BPF_CGROUP_UNIX_RECVMSG'
        CGROUP_ATYPE(CGROUP_UNIX_RECVMSG);
        ^
include/linux/bpf-cgroup.h:36:7: note: expanded from macro 'CGROUP_ATYPE'
        case BPF_##type: return type
             ^
<scratch space>:82:1: note: expanded from here
BPF_CGROUP_UNIX_RECVMSG
^
In file included from ../../../src/collector/kernel/bpf_src/render_bpf.c:39:
In file included from include/net/tcp.h:48:
include/linux/bpf-cgroup.h:65:2: error: use of undeclared identifier 'BPF_CGROUP_UNIX_GETPEERNAME'
        CGROUP_ATYPE(CGROUP_UNIX_GETPEERNAME);
        ^
include/linux/bpf-cgroup.h:36:7: note: expanded from macro 'CGROUP_ATYPE'
        case BPF_##type: return type
             ^
<scratch space>:87:1: note: expanded from here
BPF_CGROUP_UNIX_GETPEERNAME
^
In file included from ../../../src/collector/kernel/bpf_src/render_bpf.c:39:
In file included from include/net/tcp.h:48:
include/linux/bpf-cgroup.h:68:2: error: use of undeclared identifier 'BPF_CGROUP_UNIX_GETSOCKNAME'
        CGROUP_ATYPE(CGROUP_UNIX_GETSOCKNAME);
        ^
include/linux/bpf-cgroup.h:36:7: note: expanded from macro 'CGROUP_ATYPE'
        case BPF_##type: return type
             ^
<scratch space>:90:1: note: expanded from here
BPF_CGROUP_UNIX_GETSOCKNAME
^
../../../src/collector/kernel/bpf_src/tcp-processor/bpf_tcp_send_recv.h:184:53: error: no member named 'iov' in 'struct iov_iter'
  bpf_probe_read(&iov, sizeof(iov), &(msg->msg_iter.iov));
                                      ~~~~~~~~~~~~~ ^
../../../src/collector/kernel/bpf_src/tcp-processor/bpf_tcp_send_recv.h:393:53: error: no member named 'iov' in 'struct iov_iter'
  bpf_probe_read(&iov, sizeof(iov), &(msg->msg_iter.iov));
                                      ~~~~~~~~~~~~~ ^
13 errors generated.Failed to compile eBPF code for the Linux distro 'debian' running kernel version 6.8.0-86-generic.troubleshoot item bpf_compilation_failed (os=Linux,flavor=debian,headers_src=pre_installed,kernel=6.8.0-86-generic): ProbeHandler couldn't load BPFModule: SuccessThis usually means that kernel headers weren't installed correctly.Please reach out to support and include this log in its entirety so we can diagnose and fix
the problem.
In the meantime, please install kernel headers manually on each host before running
the Kernel Collector. 

Steps to Reproduce

helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
helm install my-opentelemetry-ebpf open-telemetry/opentelemetry-ebpf -n ebpf
check logs of kernel collector pod

Expected Result

transmission of metrics

Actual Result

Errors in data collection.

eBPF Collector version

v0.10.2

Environment information

Environment

OS: Ubuntu 2404
Kernel version: 6.8.0-86-generic.

eBPF Collector configuration

use the default values.yaml in helm chart

Log output

Additional context

No response

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions