-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
pod stats: unknown FS magic on "/run/user/4902/netns/netns-etc-etc" #17903
Comments
The only way I can see this happening is if |
The code picks a random name but never checked if this name was already in use. If the RNG creates generates the same name again we will end up with containers sharing the same netns which can be very bad. It is very unlikely to happen but this the only explanation I find for containers/podman#17903. Signed-off-by: Paul Holzinger <[email protected]>
The code picks a random name but never checked if this name was already in use. If the RNG creates generates the same name again we will end up with contianers sharing the same netns which can be very bad. It is very unlikely to happen but this the only explanation I find for containers/podman#17903. Signed-off-by: Paul Holzinger <[email protected]>
The code picks a random name but never checked if this name was already in use. If the RNG generates the same name again we will end up with containers sharing the same netns which can be very bad. It is very unlikely to happen but this the only explanation I find for containers/podman#17903. Signed-off-by: Paul Holzinger <[email protected]>
The code picks a random name but never checked if this name was already in use. If the RNG generates the same name again we will end up with containers sharing the same netns which can be very bad. It is very unlikely to happen but this the only explanation I find for containers/podman#17903. Signed-off-by: Paul Holzinger <[email protected]>
I think https://github.com/containers/common/pull/1381should prevent this but I cannot be sure what the cause here was. |
The code picks a random name but never checked if this name was already in use. If the RNG generates the same name again we will end up with containers sharing the same netns which can be very bad. It is very unlikely to happen but this the only explanation I find for containers/podman#17903. Signed-off-by: Paul Holzinger <[email protected]>
The code picks a random name but never checked if this name was already in use. If the RNG generates the same name again we will end up with containers sharing the same netns which can be very bad. It is very unlikely to happen but this the only explanation I find for containers/podman#17903. Signed-off-by: Paul Holzinger <[email protected]>
The code picks a random name but never checked if this name was already in use. If the RNG generates the same name again we will end up with containers sharing the same netns which can be very bad. It is very unlikely to happen but this the only explanation I find for containers/podman#17903. Signed-off-by: Paul Holzinger <[email protected]>
Could this be related, or should I file a new issue?
|
It is the same error so yes it should be the same problem, however if we see it more often then I no longer think my fix is enough. It still can be that we try to unmount the netns twice in podman and at least this is the first time you report this bug and both logs say sqlite so it can be very well a new sqlite bug. |
Big grain of salt: all of these are being found in #17831 which, yes, is hammering on sqlite, but the big big big deal in that PR is disabling the ginkgo triple-flake-retry. It is possible, even likely, that these are all bugs that have always been there but we never see because of the ginkgo triple-retry. |
Oooh, here's an interesting one, f37 rootless boltdb, showing two failures very close together in time, suggesting that it's a concurrency issue, that something needs to be locked to prevent these tests from running at the same time.
|
Here's an interesting new variation on the theme. In system tests (the usual FS-magic flake is in
From that point on, pretty much all the rest of the tests fail. The word "magic" does not appear anywhere in the test log, but I still think this is related. If it isn't, lmk and I'll file a separate issue. |
This is definitely caused by my change, |
Mhh, I am not really sure where it went wrong. podman/libpod/networking_linux.go Lines 335 to 379 in 5190ab1
Somehow It is not quite clear what is going on but I think something must be unmounting the netns bind mounts. |
These are system tests. That's not impossible (there are a few explicit background podman jobs), but it seems unlikely. |
Yes I agree very unlikely but I consider something unmounts the netns also in the category very unlikely. |
@edsantiago Could you confirm that this only happens rootless? I think I understand now what may trigger this. In order for the netns to be valid it must be a child of the podman user namespace. This namespace is kept alive by the I can reproduce this the following way:
and if I patch it to show the error from This is at least the only thing which can consistently trigger this, so the question then would be what killed @giuseppe Any idea? |
Nice detective work. Unfortunately I can't confirm anything because the log I linked above is the only instance I've found of that failure. But if we look at the sequence of tests:
...and we look at the source of the podman/test/system/500-networking.bats Lines 171 to 175 in 80a199a
...we see pod and pause-image cleanup, which is consistent with your findings (even if the timing doesn't appear to be). Is it worth poking into pod removal code to see if something is not being cleaned up properly? |
The pod pause image is different and should not be related to the The |
#18024 should at least let us recover so not all tests blow up when it happens. This should restore the previous behavior but it doesn't address the root cause. |
Ok lets go with that then for now. However we still need to figure out if the pause process really got killed in the CI env. I think one possibility is to patch the test to read |
I've been playing with variations of
Granted, for rootless I should've included Anyhow, this was a push from tonight, and it includes #18024, so I was surprised to see that message. Quitting for the day. |
Note that #18024 made no attempt at fixing this issue, all it fixed was the regression I introduced with the c/common change, so only the error from #17903 (comment) was fixed. |
Ok, First make sure you have no podman processes or containers running running, then kill the pause process to start from a clean system:
The bug here is that there is a shortcut in pkg/rootless/rootless_linux.c which is always run before any go code is run (including the option parsing). The c code just sees $XDG_RUNTIME_DIR/libpod/tmp/pause.pid and imminently joins this namespace from this process. So that is why you have to run the first time with The fix for this is of course to not do the shortcut when we see podman/pkg/rootless/rootless_linux.c Lines 378 to 384 in ac1d297
|
When using --tmpdir for the podman cli we use this as location for the pause.pid file. However the c shortcut code has no idea about this option and always assumes XDG_RUNTIME_DIR/libpod/tmp. This can cause us to join the wrong user namespace which leads to very weird issues as mounts are missing there. Fixes containers#17903 Signed-off-by: Paul Holzinger <[email protected]>
Slightly different symptom seen yesterday, f37 rootless:
That causes the test to fail. Then, in cleanup:
I'm assiging that flake to this issue. |
Still happening: |
Locks are dangerous of course, but isn't there some way that |
I only see two callers of system reset in the e2e test. I think we can convert them into system tests to fix this issue. |
Ok new plan, my goal is to update to ginkgo v2 (#18163) so we can use decorators to mark a single test as serial. |
Seen in CI, f37 rootless sqlite:
The text was updated successfully, but these errors were encountered: