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

CHAIN_ADD failed (No such file or directory): chain PREROUTING #62

Closed
xehonk opened this issue Jun 24, 2024 · 14 comments
Closed

CHAIN_ADD failed (No such file or directory): chain PREROUTING #62

xehonk opened this issue Jun 24, 2024 · 14 comments
Assignees

Comments

@xehonk
Copy link

xehonk commented Jun 24, 2024

In the new release (3.1.4) there is an error, which prevents the container from starting. Only happened on a windows host, not on a linux host.
iptables v1.8.10 (nf_tables): CHAIN_ADD failed (No such file or directory): chain PREROUTING

image (21)

@qoomon qoomon self-assigned this Jun 24, 2024
@qoomon
Copy link
Owner

qoomon commented Jun 24, 2024

Hmm, do you have any idea why this happens?(I don't have a windows machine)

@qoomon
Copy link
Owner

qoomon commented Jul 3, 2024

@xehonk do you use docker with wsl2 enabled? https://learn.microsoft.com/en-us/windows/wsl/tutorials/wsl-containers

@xehonk
Copy link
Author

xehonk commented Jul 3, 2024

@qoomon Sorry, I don't have access to the affected machine until next week. I'll find out then.

@xehonk
Copy link
Author

xehonk commented Jul 11, 2024

So, here's the update:
The machine has wsl2 enabled. docker-desktop and docker-desktop-data images are installed.

$ docker run --cap-add=NET_ADMIN --cap-add=NET_RAW qoomon/docker-host:3.1.5
Docker Host: 192.168.65.2 (host.docker.internal)
Forwarding ports: 1-65535
Warning: Extension tcp revision 0 not supported, missing kernel module?
Warning: Extension DNAT revision 0 not supported, missing kernel module?
iptables v1.8.10 (nf_tables):  CHAIN_ADD failed (No such file or directory): chain PREROUTING

$ docker run --cap-add=NET_ADMIN --cap-add=NET_RAW qoomon/docker-host:3.1.4
Docker Host: 192.168.65.2 (host.docker.internal)
Forwarding ports: 1-65535
Warning: Extension tcp revision 0 not supported, missing kernel module?
Warning: Extension DNAT revision 0 not supported, missing kernel module?
iptables v1.8.10 (nf_tables):  CHAIN_ADD failed (No such file or directory): chain PREROUTING

$ docker run --cap-add=NET_ADMIN --cap-add=NET_RAW qoomon/docker-host:3.1.3
Docker Host: 192.168.65.2 (host.docker.internal)
Forwarding ports: 1-65535

I also verified this on another computer running windows. Same result.

@qoomon
Copy link
Owner

qoomon commented Jul 12, 2024

probably it's due to iptables-nft change in alpine version 3.19.0 https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.19.0

@qoomon
Copy link
Owner

qoomon commented Jul 15, 2024

Maybe adding following lines to entrypoint.sh before iptable commands could help

modprobe ip_tables && echo $_ >> /etc/modules
modprobe iptable_nat && echo $_ >> /etc/modules
modprobe iptable_filter && echo $_ >> /etc/modules

@xehonk
Copy link
Author

xehonk commented Jul 15, 2024

I have not tried this on windows, but even on linux there's this error with your suggested change. I do not think the alpine base image includes these loadable modules.

modprobe: can't change directory to '/lib/modules': No such file or directory

@qoomon
Copy link
Owner

qoomon commented Jul 15, 2024

I'll will try to migrate to nftables maybe this will work

@qoomon
Copy link
Owner

qoomon commented Jul 15, 2024

@xehonk
Copy link
Author

xehonk commented Jul 15, 2024

Works on my linux machine, but same error on windows unfortunately:
image (22)

@qoomon
Copy link
Owner

qoomon commented Jul 15, 2024

hmm i have no clue what's the reason, or why the iptables legacy solution works

@qoomon
Copy link
Owner

qoomon commented Jul 16, 2024

@xehonk I switched to iptables-legacy. Feel free to try version 3.3.0

@xehonk
Copy link
Author

xehonk commented Jul 17, 2024

I can confirm that it works with 3.3 on windows and linux. here the run from the previously broken windows pc:

image (24)

@qoomon qoomon closed this as completed Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants