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

Podman commit doesn't copy the exposed ports list correctly #2066

Closed
TristanCacqueray opened this Issue Jan 2, 2019 · 7 comments

Comments

Projects
None yet
3 participants
@TristanCacqueray
Copy link
Contributor

TristanCacqueray commented Jan 2, 2019

kind bug

Description

When using podman to commit a running-container, the ExposedPorts list contains extra corrupted entries.

Steps to reproduce the issue:

  1. c=$(buildah from centos)

  2. buildah config --port 8080 $c

  3. buildah commit $c my-centos

  4. podman run --publish-all -it --name rep my-centos

  5. podman commit rep rep-commit

  6. podman inspect rep-commit
    ...
    "ContainerConfig": {
    "ExposedPorts": {
    "8080": {},
    "ᾐ": {}
    }
    ...

Describe the results you received:

The port list contains an unknown entries. Then trying to run the image fails:

podman run --publish-all -it --name rep2 rep-commit
strconv.ParseUint: parsing "ᾐ": invalid syntax

Describe the results you expected:

The exposed port list should be properly copied.

Additional information you deem important (e.g. issue happens only occasionally):

The number of extra port added grows with the number of exposed port, here is an inspect output of a container with 3 ports saved:

        "ContainerConfig": {
            "ExposedPorts": {
                "29418": {},
                "443": {},
                "80": {},
                "P": {},
                "ƻ": {},
                "狪": {}
            },

Output of podman version:

Version:       0.12.1.1
Go Version:    go1.10.5
Git Commit:    "8a97c0f33b6bd8eabb04f0b8368b78022b53942f-dirty"
Built:         Fri Dec  7 20:01:00 2018
OS/Arch:       linux/amd64

Output of podman info:

host:
  BuildahVersion: 1.6-dev
  Conmon:
    package: podman-0.12.1.1-1.git66d3499.fc28.x86_64
    path: /usr/libexec/podman/conmon
    version: 'conmon version 1.12.0-dev, commit: 8a97c0f33b6bd8eabb04f0b8368b78022b53942f-dirty'
  Distribution:
    distribution: fedora
    version: "28"
  MemFree: 2725285888
  MemTotal: 8362885120
  OCIRuntime:
    package: runc-1.0.0-59.dev.gitccb5efd.fc28.x86_64
    path: /usr/bin/runc
    version: 'runc version spec: 1.0.1-dev'
  SwapFree: 0
  SwapTotal: 0
  arch: amd64
  cpus: 4
  hostname: openshift.rdocloud
  kernel: 4.17.14-202.fc28.x86_64
  os: linux
  rootless: false
  uptime: 313h 3m 33.74s (Approximately 13.04 days)
insecure registries:
  registries: []
registries:
  registries:
  - docker.io
  - registry.fedoraproject.org
  - quay.io
  - registry.access.redhat.com
  - registry.centos.org
store:
  ContainerStore:
    number: 9
  GraphDriverName: overlay
  GraphOptions: null
  GraphRoot: /var/lib/containers/storage
  GraphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
  ImageStore:
    number: 6
  RunRoot: /var/run/containers/storage

Additional environment details (AWS, VirtualBox, physical, etc.):
It's a fedora system running on openstack.

@rhatdan

This comment has been minimized.

Copy link
Member

rhatdan commented Jan 2, 2019

@mheon can you take a look at this?

@mheon

This comment has been minimized.

Copy link
Collaborator

mheon commented Jan 2, 2019

Sure. Looks like we're trying to interpret binary as unicode somewhere.

@mheon

This comment has been minimized.

Copy link
Collaborator

mheon commented Jan 2, 2019

Decimal 8080 in Unicode produces the ᾐ character, so we're somehow casting this into unicode.

@mheon

This comment has been minimized.

Copy link
Collaborator

mheon commented Jan 2, 2019

Also happens with buildah. Exciting.

@mheon mheon added the bug label Jan 2, 2019

@mheon

This comment has been minimized.

Copy link
Collaborator

mheon commented Jan 2, 2019

Looks like this is a bug in c/image

@mheon

This comment has been minimized.

Copy link
Collaborator

mheon commented Jan 2, 2019

Nevermind - we're actually displaying the right content. It looks like we are committing garbage ports.

mheon pushed a commit to mheon/libpod that referenced this issue Jan 2, 2019

Matthew Heon
Use sprintf to generate port numbers while committing
Casting integers to strings is definitely not correct, so let the
standard library handle matters.

Fixes containers#2066

Signed-off-by: Matthew Heon <mcs@temeraire.int.lldp.net>

mheon added a commit to mheon/libpod that referenced this issue Jan 2, 2019

Use sprintf to generate port numbers while committing
Casting integers to strings is definitely not correct, so let the
standard library handle matters.

Fixes containers#2066

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
@mheon

This comment has been minimized.

Copy link
Collaborator

mheon commented Jan 2, 2019

Fix in #2067

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment