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: 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:
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:
# 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:127.0.0.1 --add-host wvass-server_postgresql_1:127.0.0.1 --add-host worker:127.0.0.1 --add-host wvass-server_worker_1:127.0.0.1 --add-host web:127.0.0.1 --add-host wvass-server_web_1:127.0.0.1 --add-host cron:127.0.0.1 --add-host wvass-server_cron_1:127.0.0.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
I fixed the issue by moving the --add-host argument from the 'pod run' command to the 'podman pod create --share net' command.
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.
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.
Closing per prior comments