Skip to content

DNS plugin crashes retina-agent when debugfs is not mounted #1711

Open
@baldugus

Description

@baldugus

Describe the bug
When running retina-agent with the DNS plugin enabled on a system where debugfs is not mounted, an underlying dependency (inspektor-gadget) emits the following error to stderr:

error: filesystems debugfs not mounted (did you try --auto-mount-filesystems?)

Shortly after, it terminates the agent process ungracefully.

This behavior originates from this line, which uses pkg/utils/host from inspektor-gadget.

That package doesn't appear to be designed for library use, as these lines in host.go directly writes to stderr and calls os.Exit(1), not returning any error for handling upstream.

To Reproduce
I'm running Talos Linux, which is hardened by default and does not mount debugfs. Installing retina via the helm chart with the DNS plugin enabled always causes the agent to crash.

Command line I've used:

helm upgrade --install retina oci://ghcr.io/microsoft/retina/charts/retina-hubble \
        --version $VERSION \
        --namespace retina \
        --set operator.enabled=true \
        --set operator.repository=ghcr.io/microsoft/retina/retina-operator \
        --set operator.tag=$VERSION \
        --set agent.enabled=true \
        --set agent.repository=ghcr.io/microsoft/retina/retina-agent \
        --set agent.tag=$VERSION \
        --set agent.init.enabled=true \
        --set agent.init.repository=ghcr.io/microsoft/retina/retina-init \
        --set agent.init.tag=$VERSION \
        --set enabledPlugin_linux="\[dropreason\,packetforward\,linuxutil\,dns\]" \
        --set namespace=retina \
        --set logLevel=debug

Expected behavior
Either retina-agent should execute with no errors, or handle the error, logging properly and gracefully exiting.

Platform (please complete the following information):

  • OS: Talos Linux v1.9.4
  • Kubernetes Version: v1.32.2
  • Host: Self-host
  • Retina Version: v0.0.35

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions