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

error "netlink receive: no such file or directory" #58

Open
aojea opened this issue Jan 29, 2025 · 6 comments
Open

error "netlink receive: no such file or directory" #58

aojea opened this issue Jan 29, 2025 · 6 comments

Comments

@aojea
Copy link

aojea commented Jan 29, 2025

Thanks for this great project, really useful ... I'm happily using it for two kubernetes projects

https://github.com/kubernetes-sigs/kube-network-policies/
https://github.com/aojea/kindnet

The later project also vendors the forme.

I have an issue that I'm puzzled with trying to solve, I've implemented a dnscache using nfqueue , basically I send the packet to userspace and if it is cached it drops the packet and I spoof the answer, and if there is any error or not cached, the packet is accepted and it goes through.

The problem is that I started to see errors where the packets are dropped, aojea/kindnet#158 , no such file or directory that IIUIC is ENOENT , but I would not expect to have data loss

The nftables rules are very simple, it just matches dns packets sent to some specific ips from some predetermined range

table inet kindnet-dnscache {
        set set-v4-nameservers {
                type ipv4_addr
                elements = { 1.1.1.1 }
        }

        set set-v6-nameservers {
                type ipv6_addr
                elements = { fd00::1 }
        }
        chain prerouting {
                type filter hook prerouting priority raw; policy accept;
                ip saddr 10.0.0.0/24 ip daddr @set-v4-nameservers udp dport 53 queue flags bypass to 103
                ip6 saddr 2001:db8::/112 ip6 daddr @set-v6-nameservers udp dport 53 queue flags bypass to 103
        }
        chain output {
                type filter hook output priority raw; policy accept;
                meta mark 0x0000006e udp sport 53 notrack
        }
}

Appreciate If you have any thoughts or hints to try to solve that problem

@florianl
Copy link
Owner

Hey 👋
Glad to hear this package helps you.

From the top of my head, I can't name a reason for ENOENT at this point. Maybe the queue is overloaded and elements in the queue are dropped?
Would it be possible to track the packet IDs and looks for jumps in the packet IDs for such cases?

The problem is that I started to see errors where the packets are dropped, [..], no such file or directory that IIUIC is ENOENT [..]

You mean, this issue happens only if you set a verdict for a packet?

@aojea
Copy link
Author

aojea commented Jan 29, 2025

I'm logging stats and there are no drops on kernel or user space aojea/kindnet#181 (comment)
The problem is that the packets are dropped, if it errors I expected the packet to go through but I may be misunderstanding this ..

I wonder if the problem is that it takes too much to emit a verdict...

@florianl
Copy link
Owner

florianl commented Feb 1, 2025

Could you provide a minimal reproducible example?

@aojea
Copy link
Author

aojea commented Feb 1, 2025

I see them in the CI jobs I have , https://github.com/aojea/kindnet/actions/runs/13032434599 but that is a very complex environment , is a kubernetes cluster will multiple applications running ... I can try to get a reproducer or more info, do you have some suggestion on some instrumentation I can add to when it fails so we can have more information?

@florianl
Copy link
Owner

florianl commented Feb 1, 2025

Can you check and log the returned error for d.nfq.SetVerdict()? I'm wondering if this reveals more information.

@aojea
Copy link
Author

aojea commented Feb 2, 2025

Can you check and log the returned error for d.nfq.SetVerdict()? I'm wondering if this reveals more information.

no luck, there is no errors setting the verdict

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

2 participants