podman: Can't connect to exposed port (database)
/kind bug
Description
Can’t connect to exposed port (database)
Steps to reproduce the issue:
-
sudo podman run --name some-mysql -e MYSQL_ROOT_PASSWORD=root -d -p 3309:3306 docker://mysql:8
-
sudo podman ps -a
-> Port is exposed -
Connect to the database: <host_ip>:3309, user:root, pass:root
Describe the results you received:
java.net.ConnectException: Connection refused: connect
(I use IntelliJ to connect to the db)
Describe the results you expected: Successfull connection
Additional information you deem important (e.g. issue happens only occasionally):
Output of podman version
:
Version: 1.6.2
RemoteAPI Version: 1
Go Version: go1.10.4
OS/Arch: linux/amd64
Output of podman info --debug
:
debug:
compiler: gc
git commit: ""
go version: go1.10.4
podman version: 1.6.2
host:
BuildahVersion: 1.11.3
CgroupVersion: v1
Conmon:
package: 'conmon: /usr/bin/conmon'
path: /usr/bin/conmon
version: 'conmon version 2.0.2, commit: unknown'
Distribution:
distribution: ubuntu
version: "18.04"
IDMappings:
gidmap:
- container_id: 0
host_id: 1000
size: 1
- container_id: 1
host_id: 100000
size: 65536
uidmap:
- container_id: 0
host_id: 1000
size: 1
- container_id: 1
host_id: 100000
size: 65536
MemFree: 777121792
MemTotal: 4133961728
OCIRuntime:
name: runc
package: 'runc: /usr/sbin/runc'
path: /usr/sbin/runc
version: 'runc version spec: 1.0.1-dev'
SwapFree: 554102784
SwapTotal: 595521536
arch: amd64
cpus: 2
eventlogger: journald
hostname: vm1-VirtualBox
kernel: 5.0.0-32-generic
os: linux
rootless: true
slirp4netns:
Executable: /usr/bin/slirp4netns
Package: 'slirp4netns: /usr/bin/slirp4netns'
Version: |-
slirp4netns version 0.4.2
commit: unknown
uptime: 9h 4m 38.69s (Approximately 0.38 days)
registries:
blocked: null
insecure: null
search: null
store:
ConfigFile: /home/vm1/.config/containers/storage.conf
ContainerStore:
number: 0
GraphDriverName: vfs
GraphOptions: {}
GraphRoot: /home/vm1/.local/share/containers/storage
GraphStatus: {}
ImageStore:
number: 2
RunRoot: /run/user/1000
VolumePath: /home/vm1/.local/share/containers/storage/volumes
Package info (e.g. output of rpm -q podman
or apt list podman
):
Listing... Done
podman/bionic,now 1.6.2-1~ubuntu18.04~ppa1 amd64 [installed]
Additional environment details (AWS, VirtualBox, physical, etc.): VirtualBox
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 17 (10 by maintainers)
Ok, I have this one nailed down. It is mariadb specific and not the fault of podman or cni. In one terminal, run top. In another, run the command as provided … and in another terminal, run a podman container log -f. What you will observe is this:
In the container, by way of top, the mysqld binary is chewing up CPU presumably to get setup. The maria db logs are as follows:
Then, as observed, after a short time, the mysqld drops in cpu, and the log furthers:
Once the “ready” message appears, the port works. So to put this to bed, all of the container and network plumbing are in fact working. We are simply waiting for maria db to complete its initial setup and bind to the port.