containers / containers/podman-compose
iptables error in AlmaLinux in WSL
- Dominant language
- Python
- Stars
- 6.2k
- Forks
- 622
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
I am migrating from Ubuntu with docker/docker-compse to RHEL8 with podman/podman-compose. I have that transition mostly done but I am looking at setting up a local development environment in WSL. AlmaLinux is now available in the Windows Store as a WSL distribution so I tried to get that going given its close ties to RHEL. I have the containers up and running in rootless mode on RHEL8. However, AlmaLinux in WSL is giving me errors.
```
podman start -a sas-applications_db_1
ERRO[0000] error loading cached network config: network "sas-applications_default" not found in CNI cache
WARN[0000] falling back to loading from existing plugins on disk
ERRO[0000] Error tearing down partially created network namespace for container b9a389215466534f642888d6a38b06ce7bfc46b9c7f6faaee2d7ca4428c4e9ae: error removing pod sas-applications_db_1_sas-applications_db_1 from CNI network "sas-applications_default": running [/usr/sbin/iptables -t nat -D POSTROUTING -s 10.89.0.20 -j CNI-33d45cf0b1cd61052505141b -m comment --comment name: "sas-applications_default" id: "b9a389215466534f642888d6a38b06ce7bfc46b9c7f6faaee2d7ca4428c4e9ae" --wait]: exit status 2: iptables v1.8.4 (nf_tables): Couldn't load match `comment':No such file or directory
Try `iptables -h' or 'iptables --help' for more information.
Error: unable to start container b9a389215466534f642888d6a38b06ce7bfc46b9c7f6faaee2d7ca4428c4e9ae: error configuring network namespace for container b9a389215466534f642888d6a38b06ce7bfc46b9c7f6faaee2d7ca4428c4e9ae: error adding pod sas-applications_db_1_sas-applications_db_1 to CNI network "sas-applications_default": failed to list chains: running [/usr/sbin/iptables -t nat -S --wait]: exit status 4: iptables v1.8.4 (nf_tables): CHAIN_ADD failed (No such file or directory): chain PREROUTING
exit code: 125
```
I have tried this with the latest development branch as of today and I see the same error.
After researching the errors, I believe this has something to do with iptables, iptables-legacy, and nftables.
**To Reproduce**
Steps to reproduce the behavior:
1. Install AlmaLinux in WSL
2. `dnf update` then `dnf upgrade`
3. Install podman using `dnf module install container-tools:rhel8`
4. Install podman-plugins using `dnf install podman-plugins`
5. Install pyenv, install Python 3.10.4
6. Install podman-compose with `pip install https://github.com/containers/podman-compose/archive/devel.tar.gz`
7. Add my username to /etc/subuid and /etc/subgid with a non-overlapping range to other entries
8. Run `podman-compose up`
This simple example produces the error:
```yml
version: "3.2"
services:
web:
image: docker.io/Python:3.10
db:
image: docker.io/postgres:12
```
```
ERRO[0000] error loading cached network config: network "minimal-example_default" not found in CNI cache
WARN[0000] falling back to loading from existing plugins on disk
ERRO[0000] Error tearing down partially created network namespace for container cf0ac28a96e0120783b1ff6998c2de39275455d2c28c87677bec2cbd90358a9e: error removing pod minimal-example_db_1_minimal-example_db_1 from CNI network "minimal-example_default": running [/usr/sbin/iptables -t nat -D POSTROUTING -s 10.89.1.2 -j CNI-020164559f259e98bbfb3e23 -m comment --comment name: "minimal-example_default" id: "cf0ac28a96e0120783b1ff6998c2de39275455d2c28c87677bec2cbd90358a9e" --wait]: exit status 2: iptables v1.8.4 (nf_tables): Couldn't load match `comment':No such file or directory
Try `iptables -h' or 'iptables --help' for more information.
Error: unable to start container cf0ac28a96e0120783b1ff6998c2de39275455d2c28c87677bec2cbd90358a9e: error configuring network namespace for container cf0ac28a96e0120783b1ff6998c2de39275455d2c28c87677bec2cbd90358a9e: error adding pod minimal-example_db_1_minimal-example_db_1 to CNI network "minimal-example_default": failed to list chains: running [/usr/sbin/iptables -t nat -S --wait]: exit status 4: iptables v1.8.4 (nf_tables): CHAIN_ADD failed (No such file or directory): chain PREROUTING
exit code: 125
```
**Expected behavior**
The expected behavior is to start the containers defined in the docker-compose.yml file.
**Actual behavior**
The error above is produced.
**Output**
```
$ podman-compose version
podman-compose version: 1.0.4
['podman', '--version', '']
using podman version: 3.4.2
podman-composer version 1.0.4
podman --version
podman version 3.4.2
exit code: 0
$ podman-compose up
See above
**Environment:**
- OS: AlmaLinux on WSL
- podman version: 3.4.2
- podman compose version: [(git hex)](https://github.com/containers/podman-compose/commit/fc3598faf2b07546ba406926bac237e50684bd0a)
**Additional context**
Contributor guide
Assessment
This issue has not been assessed yet.