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

Failing to stop container with interface names changed #708

Closed
troglobit opened this issue Oct 14, 2024 · 0 comments · Fixed by #712
Closed

Failing to stop container with interface names changed #708

troglobit opened this issue Oct 14, 2024 · 0 comments · Fixed by #712
Assignees
Labels
bug Something isn't working
Milestone

Comments

@troglobit
Copy link
Contributor

troglobit commented Oct 14, 2024

One user story for containers with multiple interfaces is to name the interfaces according to what they are connected to, be it br0 or the lan side for a network (for firewall containers).

Image

However, renaming the interfaces from inside the container seems to confuse the CNI host-device plugin when stopping the container, to the point of it not being able to restore the interface at all. Only a reboot helps.

Oct 12 15:02:40 example-05-24-49 klishd[7248]: user "admin" starting interactive sysrepo session.
Oct 12 15:02:43 example-05-24-49 finit[1]: Stopping k8s-logger:system[6153], sending SIGTERM ...
Oct 12 15:02:43 example-05-24-49 k8s-logger: got signal 15
Oct 12 15:02:43 example-05-24-49 system[0]: shutting down.
Oct 12 15:02:43 example-05-24-49 finit[1]: Calling 'container -n system stop' ...
Oct 12 15:02:43 example-05-24-49 finit[1]: Stopped k8s-logger:system[6153]
Oct 12 15:02:43 example-05-24-49 kernel: veth0a: renamed from eth0
Oct 12 15:02:44 example-05-24-49 kernel: br0: port 14(veth0b) entered disabled state
Oct 12 15:02:44 example-05-24-49 kernel: eth0: renamed from veth0a
Oct 12 15:02:44 example-05-24-49 kernel: br0: port 14(veth0b) entered blocking state
Oct 12 15:02:44 example-05-24-49 kernel: br0: port 14(veth0b) entered forwarding state
Oct 12 15:02:44 example-05-24-49 kernel: br1: port 4(veth1b) entered disabled state
Oct 12 15:02:44 example-05-24-49 kernel: veth1a: renamed from eth1
Oct 12 15:02:44 example-05-24-49 kernel: eth1: renamed from veth1a
Oct 12 15:02:44 example-05-24-49 container:system[7334]: ERROR: Unable to clean up network for container 3b341d6: "tearing down network namespace configuration for container 3b341d6: 2 errors occurred:\n\t* plugin type=\"host-device\" failed (delete): cni plugin host-device failed: failed to move \"veth0a\" to host netns: file exists\n\t* plugin type=\"host-device\" failed (delete): cni plugin host-device failed: failed to move \"veth1a\
Oct 12 15:02:44 example-05-24-49 container:system[7334]: " to host netns: file exists\n\n"
Oct 12 15:02:44 example-05-24-49 container:system[7334]: system
Oct 12 15:02:44 example-05-24-49 finit[1]: Stopped container:system[6334]
Oct 12 15:02:44 example-05-24-49 kernel: br1: port 4(veth1b) entered blocking state
Oct 12 15:02:44 example-05-24-49 kernel: br1: port 4(veth1b) entered forwarding state
Oct 12 15:02:44 example-05-24-49 kernel: br1: port 4(veth1b) entered disabled state
Oct 12 15:02:44 example-05-24-49 kernel: br0: port 14(veth0b) entered disabled state
Oct 12 15:02:44 example-05-24-49 kernel: veth1b (unregistering): left allmulticast mode
Oct 12 15:02:44 example-05-24-49 kernel: veth1b (unregistering): left promiscuous mode
Oct 12 15:02:44 example-05-24-49 kernel: br1: port 4(veth1b) entered disabled state
Oct 12 15:02:44 example-05-24-49 kernel: veth0b (unregistering): left allmulticast mode
Oct 12 15:02:44 example-05-24-49 kernel: veth0b (unregistering): left promiscuous mode
Oct 12 15:02:44 example-05-24-49 kernel: br0: port 14(veth0b) entered disabled state
Oct 12 15:02:54 example-05-24-49 finit[1]: Starting k8s-logger:system[7574]
Oct 12 15:02:54 example-05-24-49 system[0]: creating pidfile /run/k8s-logger-system.pid
Oct 12 15:02:54 example-05-24-49 system[0]: opening fifo /run/containers/system.fifo
Oct 12 15:02:54 example-05-24-49 system[0]: entering poll loop ...
Oct 12 15:02:54 example-05-24-49 finit[1]: Calling 'container -n system start' ...
Oct 12 15:02:54 example-05-24-49 container:system[7585]: ^[[33mWARN^[[0m[0000] 1 error occurred:
Oct 12 15:02:54 example-05-24-49 container:system[7585]: 	* plugin type="host-device" failed (delete): cni plugin host-device failed: failed to find "eth0": Link not found
Oct 12 15:02:54 example-05-24-49 container:system[7585]:
Oct 12 15:02:54 example-05-24-49 container:system[7585]: Error: unable to start container "3b341d6": plugin type="host-device" failed (add): cni plugin host-device failed: failed to find host device: Link not found
Oct 12 15:02:56 example-05-24-49 finit[1]: Service container:system[0] died, restarting in 2000 msec (1/10)
@troglobit troglobit added the bug Something isn't working label Oct 14, 2024
@troglobit troglobit added this to the Infix v24.10 milestone Oct 14, 2024
@troglobit troglobit self-assigned this Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant