Bug 2115988 - Recent podman upgrade causes container to fail with error "invalid config provided: extra host entries must be specified on the pod: network cannot be configured when it is shared with a pod"
Summary: Recent podman upgrade causes container to fail with error "invalid config pro...
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: podman
Version: 8.6
Hardware: x86_64
OS: Linux
Target Milestone: rc
: ---
Assignee: Tom Sweeney
QA Contact: atomic-bugs@redhat.com
Depends On:
TreeView+ depends on / blocked
Reported: 2022-08-05 23:00 UTC by Brian Masney
Modified: 2022-08-08 20:49 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2022-08-08 20:48:02 UTC
Type: Bug
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-130425 0 None None None 2022-08-05 23:04:27 UTC

Description Brian Masney 2022-08-05 23:00:00 UTC
Description of problem:

I am running the application https://github.com/masneyb/cavedbmanager on RHEL 8.6 and it runs inside 4 different containers: a webserver, database, worker, and cron scheduler. Podman began to fail with the following error message after the most recent upgrade:

podman[3679]: Error: invalid config provided: extra host entries must be specified on the pod: network cannot be configured when it is shared with a pod

This worked prior to this package upgrade.

Version-Release number of selected component (if applicable):


Steps to Reproduce:

Note that the code on that github link doesn't contain the systemd units that I use on RHEL 8.6. There's two of them that are relevant for this bug. The first starts the internal networking for the pod:

Description=WVASS Networking

ExecStartPre=-podman pod rm wvass-server
ExecStart=podman pod create --name=wvass-server --share net -p 8443:443
ExecStop=podman pod rm wvass-server


The second systemd unit starts the postgresql database:

Description=WVASS PostgreSQL
Requires=network-online.target wvass-cavedbmanager-network.service
After=network-online.target wvass-cavedbmanager-network.service

# The ExecStart and ExecStop commands below were generated by running the docker-compose.yml file through podman-compose. I am pretty sure it was this project: https://github.com/containers/podman-compose. (I did this a few years ago.)

ExecStartPre=-podman rm wvass-server_postgresql_1
ExecStartPre=podman build --file Dockerfile.base --tag cavedbmanager_base:latest .
ExecStartPre=podman build -t wvass-server_postgresql -f /var/data/wvass/cavedbmanager/Dockerfile.db /var/data/wvass/cavedbmanager
ExecStart=podman run -d --name=wvass-server_postgresql_1 --pod=wvass-server -e LC_CTYPE=C.UTF-8 -e PGDATA=/var/lib/postgresql -e PGUSER=XXX -e PGPASSWORD=XXX --mount type=bind,source=/var/data/wvass/cavedb-postgresql-10,destination=/var/lib/postgresql,bind-propagation=Z --add-host postgresql: --add-host wvass-server_postgresql_1: --add-host worker: --add-host wvass-server_worker_1: --add-host web: --add-host wvass-server_web_1: --add-host cron: --add-host wvass-server_cron_1: --expose 5432 wvass-server_postgresql
ExecStop=podman stop wvass-server_postgresql_1
ExecStopPost=podman rm wvass-server_postgresql_1


Note that I see that someone else also encountered this same issue on RHEL 8.6 and reported it to the pi-hole forums: https://discourse.pi-hole.net/t/problem-after-update-rhel8-6-podman-to-version-4-1-1/56883

Comment 1 Brian Masney 2022-08-06 11:58:24 UTC
I fixed the issue by moving the --add-host argument from the 'pod run' command to the 'podman pod create --share net' command.

Comment 2 Matthew Heon 2022-08-08 13:23:23 UTC
This was a deliberate change in response to a bug opened upstream (breadcrumb: commit was https://github.com/containers/podman/commit/e4ab8a5bedb48615402231a5aa3a62ca4364c45f); I'm trying to locate the specific bug that this was in response to, but so far without success. The general idea is that the previous behavior did not work as expected (adding hosts to pre-existing containers that you joined the network namespace of had a number of bugs with it), so we have changed things to require hosts to be pre-specified in the pod's config when it is created.

Comment 3 Brian Masney 2022-08-08 14:07:19 UTC
This can be closed as far as I am concerned since the various search engines will add this error message and BZ to their indexes.

Comment 4 Tom Sweeney 2022-08-08 20:48:02 UTC
Closing per prior comments

Note You need to log in before you can comment on or make changes to this bug.