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

Image quay.io/podman/upstream fails on "podman build" when run as root (inside the container) on a RHEL 8.5: msg: modprobe: FATAL: Module ip_tables not found #13294

Closed
Romain-Geissler-1A opened this issue Feb 19, 2022 · 3 comments · Fixed by containers/buildah#3836
Assignees
Labels
In Progress This issue is actively being worked by the assignee, please do not work on this at this time. kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@Romain-Geissler-1A
Copy link
Contributor

Romain-Geissler-1A commented Feb 19, 2022

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

We are in a company environment, so unfortunately we are stuck with RHEL 8, and don't have access to Fedora. In order to report upstream podman bugs, we want to try with podman upstream first to check if the bug is still present. It used to work, however now with podman 4.0.0 it seems to be broken when podman is run as root inside the container

Steps to reproduce the issue:

  1. From a RHEL 8.5 machine, where podman (the official one from RHEL) is installed, run this. It fails with a modprobe error:
rgeissler@NCEOBERHEL80009.rnd.amadeus.net[dev]:~$ podman run --privileged -i --rm quay.io/podman/upstream podman build -f - . <<END_OF_FILE
FROM fedora
RUN true
END_OF_FILE
STEP 1/2: FROM fedora
Resolved "fedora" as an alias (/etc/containers/registries.conf.d/000-shortnames.conf)
Trying to pull registry.fedoraproject.org/fedora:latest...
Getting image source signatures
Copying blob sha256:c6183d119aa8953fe2cb6351e8fb4aeeb770f86c1aef3d534f7e02f5e2861321
Copying blob sha256:c6183d119aa8953fe2cb6351e8fb4aeeb770f86c1aef3d534f7e02f5e2861321
Copying config sha256:e417cd49a84e1749071c516c4f0013ea62113cb5adc98a8504a63a04bfd43479
Writing manifest to image destination
Storing signatures
STEP 2/2: RUN true
error running container: did not get container start message from parent: EOF
Error: error building at STEP "RUN true": netavark: code: 3, msg: modprobe: FATAL: Module ip_tables not found in directory /lib/modules/4.18.0-348.12.2.el8_5.x86_64
iptables v1.8.7 (legacy): can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

Describe the results you received:

Any "podman build" run as root inside the quay.io/podman/upstream image involving a RUN Dockerfile directive will fail when run on a RHEL 8 host.

Describe the results you expected:

I would expect the image quay.io/podman/upstream to work out of the box on a RHEL 8 host. Most likely some new config wrt the network backend shall be added in https://github.com/containers/podman/blob/main/contrib/podmanimage/stable/containers.conf so that this works by default.

Note: it would be really cool if Red Hat provided some "upstream" stream for the "container-tools" module to always be able to install on RHEL machines some unstable but latest podman versions ;)

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Feb 19, 2022
@Romain-Geissler-1A Romain-Geissler-1A changed the title Image quay.io/podman/upstream fails on "podman build" when run as root (inside the container): msg: modprobe: FATAL: Module ip_tables not found Image quay.io/podman/upstream fails on "podman build" when run as root (inside the container) on a RHEL 8.5: msg: modprobe: FATAL: Module ip_tables not found Feb 19, 2022
@Luap99
Copy link
Member

Luap99 commented Feb 19, 2022

You have to load the kernel modules as root on the host. podman build now uses a private netns by default like podman run, so you either load the modules on the host or run with --network=host.

Looking at the containers.conf file in container the default netns value should already be set to host.
@rhatdan I thought you fixed this in buildah but it doesn't look like it uses the value from containers.conf.

@Luap99 Luap99 added the Buildah label Feb 19, 2022
@Romain-Geissler-1A
Copy link
Contributor Author

In our case our development machines are shared among all the developers of the company, who don't have any root rights. These machines are being administrated by a small group of "sysadmins", so technically I could ask them to change the global config, but somehow I would expect this scenario to work without changing the host config (as the non root scenario works).

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@Luap99 Luap99 self-assigned this Mar 22, 2022
@Luap99 Luap99 added In Progress This issue is actively being worked by the assignee, please do not work on this at this time. and removed stale-issue labels Mar 22, 2022
Luap99 added a commit to Luap99/buildah that referenced this issue Mar 22, 2022
Buildah ignores the container.conf settings. Commit 05d5d22 tried
to fix this but I cannot see how this would have worked, there were also
no test added related to containers.conf.

The code below were we read the default just overwrites everything we
already set so the config settings are ignored.

Also there are many weird places were settings are just overwritten for
no particular reason. The namespaces code path looks like mess to me.
Namespaces are added/changed/removed in many different places and there
is no explanation why. Maybe I am just not familar enough with this code
base but I cannot really understand this. Hopefully a maintainer can
take a closer look to see if my changes are indeed correct.

Fixes containers/podman#13294

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Luap99 added a commit to Luap99/buildah that referenced this issue Mar 24, 2022
Buildah ignores the container.conf settings. Commit 05d5d22 tried
to fix this but I cannot see how this would have worked, there were also
no test added related to containers.conf.

The code below were we read the default just overwrites everything we
already set so the config settings are ignored.

Also there are many weird places were settings are just overwritten for
no particular reason. The namespaces code path looks like mess to me.
Namespaces are added/changed/removed in many different places and there
is no explanation why. Maybe I am just not familar enough with this code
base but I cannot really understand this. Hopefully a maintainer can
take a closer look to see if my changes are indeed correct.

Fixes containers/podman#13294

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Luap99 added a commit to Luap99/buildah that referenced this issue Mar 30, 2022
Buildah ignores the container.conf settings. Commit 05d5d22 tried
to fix this but I cannot see how this would have worked, there were also
no test added related to containers.conf.

The code below were we read the default just overwrites everything we
already set so the config settings are ignored.

Also there are many weird places were settings are just overwritten for
no particular reason. The namespaces code path looks like mess to me.
Namespaces are added/changed/removed in many different places and there
is no explanation why. Maybe I am just not familar enough with this code
base but I cannot really understand this. Hopefully a maintainer can
take a closer look to see if my changes are indeed correct.

Fixes containers/podman#13294

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Luap99 added a commit to Luap99/buildah that referenced this issue Apr 4, 2022
Buildah ignores the container.conf settings. Commit 05d5d22 tried
to fix this but I cannot see how this would have worked, there were also
no test added related to containers.conf.

The code below were we read the default just overwrites everything we
already set so the config settings are ignored.

Also there are many weird places were settings are just overwritten for
no particular reason. The namespaces code path looks like mess to me.
Namespaces are added/changed/removed in many different places and there
is no explanation why. Maybe I am just not familar enough with this code
base but I cannot really understand this. Hopefully a maintainer can
take a closer look to see if my changes are indeed correct.

Fixes containers/podman#13294

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Luap99 added a commit to Luap99/buildah that referenced this issue Apr 4, 2022
Buildah ignores the container.conf settings. Commit 05d5d22 tried
to fix this but I cannot see how this would have worked, there were also
no test added related to containers.conf.

The code below were we read the default just overwrites everything we
already set so the config settings are ignored.

Also there are many weird places were settings are just overwritten for
no particular reason. The namespaces code path looks like mess to me.
Namespaces are added/changed/removed in many different places and there
is no explanation why. Maybe I am just not familar enough with this code
base but I cannot really understand this. Hopefully a maintainer can
take a closer look to see if my changes are indeed correct.

Fixes containers/podman#13294

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Luap99 added a commit to Luap99/buildah that referenced this issue Apr 5, 2022
Buildah ignores the container.conf settings. Commit 05d5d22 tried
to fix this but I cannot see how this would have worked, there were also
no test added related to containers.conf.

The code below were we read the default just overwrites everything we
already set so the config settings are ignored.

Also there are many weird places were settings are just overwritten for
no particular reason. The namespaces code path looks like mess to me.
Namespaces are added/changed/removed in many different places and there
is no explanation why. Maybe I am just not familar enough with this code
base but I cannot really understand this. Hopefully a maintainer can
take a closer look to see if my changes are indeed correct.

Fixes containers/podman#13294

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Luap99 added a commit to Luap99/buildah that referenced this issue Apr 6, 2022
Buildah ignores the container.conf settings. Commit 05d5d22 tried
to fix this but I cannot see how this would have worked, there were also
no test added related to containers.conf.

The code below were we read the default just overwrites everything we
already set so the config settings are ignored.

Also there are many weird places were settings are just overwritten for
no particular reason. The namespaces code path looks like mess to me.
Namespaces are added/changed/removed in many different places and there
is no explanation why. Maybe I am just not familar enough with this code
base but I cannot really understand this. Hopefully a maintainer can
take a closer look to see if my changes are indeed correct.

Fixes containers/podman#13294

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Luap99 added a commit to Luap99/buildah that referenced this issue Apr 6, 2022
Buildah ignores the container.conf settings. Commit 05d5d22 tried
to fix this but I cannot see how this would have worked, there were also
no test added related to containers.conf.

The code below were we read the default just overwrites everything we
already set so the config settings are ignored.

Also there are many weird places were settings are just overwritten for
no particular reason. The namespaces code path looks like mess to me.
Namespaces are added/changed/removed in many different places and there
is no explanation why. Maybe I am just not familar enough with this code
base but I cannot really understand this. Hopefully a maintainer can
take a closer look to see if my changes are indeed correct.

Fixes containers/podman#13294

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Luap99 added a commit to Luap99/buildah that referenced this issue Apr 8, 2022
Buildah ignores the container.conf settings. Commit 05d5d22 tried
to fix this but I cannot see how this would have worked, there were also
no test added related to containers.conf.

The code below were we read the default just overwrites everything we
already set so the config settings are ignored.

Also there are many weird places were settings are just overwritten for
no particular reason. The namespaces code path looks like mess to me.
Namespaces are added/changed/removed in many different places and there
is no explanation why. Maybe I am just not familar enough with this code
base but I cannot really understand this. Hopefully a maintainer can
take a closer look to see if my changes are indeed correct.

Fixes containers/podman#13294

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
In Progress This issue is actively being worked by the assignee, please do not work on this at this time. kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants