-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[rootless] 'podman pod' port publish intermittently fails on Ubuntu 18.04, works on Fedora 31 (with test case) #4559
Comments
@AkihiroSuda Any ideas? |
Is this specific to pods? |
Thank you for taking a look! Despite many fruitless hours of experimenting, I hadn't considered trying rewriting to not make use of inter-pod networking, whoops. As soon as possible, I'll edit the test script to not create a pod and see what happens. In hindsight, I should have also tested the Ubuntu 19.10 server image (with and/or without pod) just in case it's fixed there. Edit: the Podman PPA does not have packages for Eoan/19.10. (With my current understanding of Podman, that should involve removing the pod, changing specified hosts in the containers, then adding the needed |
@AkihiroSuda This does not appear to be specific to pods. I have modified the test script to provide a mode using ungrouped containers ( I did this testing on Ubuntu 18.04 LTS x64 in VirtualBox, skipping testing the other two situations (Fedora and Hetzner Cloud VPS) as it didn't seem like it'd differ. I can test those as well if it would be helpful. Pod-less test commandsStart# Create directories/etc, as per the original issue steps
# This includes...
mkdir --parents "$HOME/podman_test_mnt/seafilebox-data" "$HOME/podman_test_mnt/seafilebox-mysql/db"
#
# MySQL
podman --log-level "debug" create --name="seafilebox-mysql" --publish="3306:3306" --env="MYSQL_ROOT_PASSWORD=mysql-root-test-pass" --env="MYSQL_LOG_CONSOLE=true" --mount type=bind,source=$HOME/podman_test_mnt/seafilebox-mysql/db,destination=/var/lib/mysql docker.io/mariadb:10.1
podman --log-level "debug" start "seafilebox-mysql"
#
# Memcached
podman --log-level "debug" create --name="seafilebox-memcached" --publish="11211:11211" docker.io/memcached:alpine memcached -m 256
podman --log-level "debug" start "seafilebox-memcached"
#
# Get IP address
# See https://www.redhat.com/sysadmin/container-networking-podman
# And https://hacklog.in/understand-podman-networking/
# And https://stackoverflow.com/questions/13322485/how-to-get-the-primary-ip-address-of-the-local-machine-on-linux-and-os-x
SYSTEM_IP="$(hostname --all-ip-addresses)"
#
# Seafile
podman --log-level "debug" create --name="seafilebox-seafile" --publish="8066:80" --env="DB_HOST=$SYSTEM_IP" --env="DB_ROOT_PASSWD=mysql-root-test-pass" --env="TIME_ZONE=Etc/UTC" --env="[email protected]" --env="SEAFILE_ADMIN_PASSWORD=seafile-test-pass" --env="SEAFILE_SERVER_LETSENCRYPT=false" --env="SEAFILE_SERVER_HOSTNAME=example.invalid" --mount type=bind,source=$HOME/podman_test_mnt/seafilebox-data,destination=/shared docker.io/seafileltd/seafile-mc:latest
podman --log-level "debug" start "seafilebox-seafile" Checknetstat --listen --numeric | grep ":8066" Stop# Stop
podman --log-level "debug" stop "seafilebox-seafile"
podman --log-level "debug" stop "seafilebox-memcached"
podman --log-level "debug" stop "seafilebox-mysql"
# Remove
podman --log-level "debug" rm "seafilebox-seafile"
podman --log-level "debug" rm "seafilebox-memcached"
podman --log-level "debug" rm "seafilebox-mysql"
podman --log-level "debug" pod rm "seafilebox" Updated
|
@giuseppe @AkihiroSuda Any ideas here? Does it look like we're looking at a Slirp issue, or something in Podman itself? |
This issue had no activity for 30 days. In the absence of activity or the "do-not-close" label, the issue will be automatically closed within 7 days. |
I've been waiting to retest until the upcoming RootlessKit port forwarder pull request is merged, hence leaving this comment to avoid having this issue closed. If desired, I can retest before the RootlessKit PR is merged. |
Thanks, testing is highly appreciated |
RootlessKit port forwarder has a lot of advantages over the slirp4netns port forwarder: * Very high throughput. Benchmark result on Travis: socat: 5.2 Gbps, slirp4netns: 8.3 Gbps, RootlessKit: 27.3 Gbps (https://travis-ci.org/rootless-containers/rootlesskit/builds/597056377) * Connections from the host are treated as 127.0.0.1 rather than 10.0.2.2 in the namespace. No UDP issue (containers#4586) * No tcp_rmem issue (containers#4537) * Probably works with IPv6. Even if not, it is trivial to support IPv6. (containers#4311) * Easily extensible for future support of SCTP * Easily extensible for future support of `lxc-user-nic` SUID network RootlessKit port forwarder has been already adopted as the default port forwarder by Rootless Docker/Moby, and no issue has been reported AFAIK. As the port forwarder is imported as a Go package, no `rootlesskit` binary is required for Podman. Fix containers#4586 May-fix containers#4559 Fix containers#4537 May-fix containers#4311 See https://github.com/rootless-containers/rootlesskit/blob/v0.7.0/pkg/port/builtin/builtin.go Signed-off-by: Akihiro Suda <[email protected]>
I've updated the original issue comment's test script With the new rootless networking backend, this works 10 out of 10 times before rebooting, and 8 out of 10 times after rebooting.
For now, I'd consider this specific issue resolved and I'll file a new issue after I investigate further. I suspect there's something to do with the reboot and properly cleaning things up. Thank you to everyone who contributed to investigation, and thank you @AkihiroSuda for the effort in switching Podman's rootless networking backend. 🙂 Apologies for the long delay; I've had several things to manage over the holidays and new year. |
In short
1.6.2
works reliably, no failure in 10 consecutive tries1.6.2
works intermittently (usually)1.6.2
works intermittently (rarely)Details
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
When creating a pod with a published port (e.g.
--publish="8066:80"
) and adding several containers, Podman does not always start listening on the specified port despite allowing the containers to run with no errors fromslirp4netns
.To add to the complexity, Fedora 31 x64 server seems to work reliably. Ubuntu 18.04 LTS x64 fails intermittently (about 70% chance of success in a VirtualBox VM, under 10% chance on a Hetzner Cloud VPS). There may be some difference in system configuration, but to the best of my efforts, the testing environments are set with minimal changes to a fresh, default install.
Steps to reproduce the issue:
For simpler testing, please see the semi-automatic test script provided near the end of this issue,
podman-rootless-port-test-seafilebox.sh
. Install updates, then run the script.podman
,slirp4netns
, andcontainernetworking-plugins
If the above fails (should work with defaults), fix with something like
First time setup: Wait for the file
$HOME/podman_test_mnt/seafilebox-data/seafile/conf/seahub_settings.py
to be created (signaling initial Seafile setup has completed):8066
Describe the results you received:
Using the following two commands to check:
After repeating the test ten times as shown above, this results in the following success rates:
Describe the results you expected:
100% success at binding to port
8066
and responding to requests for all systems.Additional information you deem important:
As noted above, this happens intermittantly and varies between a VirtualBox VM setup and a Hetzner Cloud VPS. However, regardless of rate, it eventually fails on Ubuntu 18.04.
Changes made:
authorized_keys
setsudo add-apt-repository --yes "ppa:projectatomic/ppa" sudo apt update sudo apt install --yes podman slirp4netns uidmap containernetworking-plugins
authorized_keys
setOutput of
podman version
:Fedora 31
podman version
Ubuntu 18.04 VirtualBox & Hetzner VPS
podman version
Output of
podman info --debug
:Fedora 31 VirtualBox
podman info --debug
Ubuntu 18.04 VirtualBox
Note: upgrading Ubuntu to the latest Hardware Enablement Stack (HWE) to get kernel 5.0.0.36.94 did not seem to fix the issue.podman info --debug
Ubuntu 18.04 Hetzner VPS
podman info --debug
Package info (e.g. output of
rpm -q podman
orapt list podman
):Fedora 31, VirtualBox
Ubuntu 18.04, VirtualBox & Hetzner VPS
Additional environment details (AWS, VirtualBox, physical, etc.):
VirtualBox version 6.0.14 r133895 (Qt5.6.1) running on Ubuntu 16.04 LTS x64.
Additional testing done with a Hetzner Cloud VPS (where issue was first found).
Semi-automatic test suite
Setup
podman-rootless-port-test-seafilebox.sh
results
filelog-2019-11-23--01-44-results.log
Updated 2019-11-24 06:34:39+00:00 - add pod-less mode!
Run like this
Script source:
podman-rootless-port-test-seafilebox.sh
Results
Fedora 31, VirtualBox
log-2019-11-23--03-52-results.log
Command line output, including podman
--log-level debug
System details before,
sysctl
dump and package listSystem details after,
sysctl
dump and package listUbuntu 18.04, VirtualBox
log-2019-11-23--03-14-results.log
Command line output, including podman
--log-level debug
System details before,
sysctl
dump and package listSystem details after,
sysctl
dump and package listUbuntu 18.04, Hetzner Cloud VPS
log-2019-11-23--03-47-results.log
Note: this had worked in the past, but it is quite rare.
Command line output, including podman
--log-level debug
System details before,
sysctl
dump and package listSystem details after,
sysctl
dump and package listThe text was updated successfully, but these errors were encountered: