Skip to content
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

Cannot create networks using docker-compose when using podman machine on macOS #11413

Closed
willcohen opened this issue Sep 2, 2021 · 13 comments · Fixed by containers/podman-machine-cni#3
Assignees
Labels
In Progress This issue is actively being worked by the assignee, please do not work on this at this time. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@willcohen
Copy link

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

When creating networks via docker compose, functionality which worked via virtualbox no longer works with podman machine.

Steps to reproduce the issue:

  1. Create a docker-compose.yml:
services:
  testservice:
    image: docker.io/alpine:latest
    volumes:
      - "testvol:/testvol"
    networks:
      - "testservice-net"

networks:
  testservice-net:

volumes:
  testvol:
  1. Run docker-compose up

Describe the results you received:

Creating testnet_testservice_1 ... error

ERROR: for testnet_testservice_1  error preparing container 7f29fd8fa219a202ee08af5609f8cd9638d40f65cc0fdae3f9e25caa4f4c85f4 for attach: error configuring network namespace for container 7f29fd8fa219a202ee08af5609f8cd9638d40f65cc0fdae3f9e25caa4f4c85f4: error adding pod testnet_testservice_1_testnet_testservice_1 to CNI network "testnet_testservice-net": unexpected end of JSON input

ERROR: for testservice  error preparing container 7f29fd8fa219a202ee08af5609f8cd9638d40f65cc0fdae3f9e25caa4f4c85f4 for attach: error configuring network namespace for container 7f29fd8fa219a202ee08af5609f8cd9638d40f65cc0fdae3f9e25caa4f4c85f4: error adding pod testnet_testservice_1_testnet_testservice_1 to CNI network "testnet_testservice-net": unexpected end of JSON input
ERROR: Encountered errors while bringing up the project.

Describe the results you expected:

A working service with a network.

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

Output of podman version:

Client:
Version:      3.3.1
API Version:  3.3.1
Go Version:   go1.17
Built:        Mon Aug 30 15:15:26 2021
OS/Arch:      darwin/amd64

Server:
Version:      3.3.0
API Version:  3.3.0
Go Version:   go1.16.6
Built:        Fri Aug 20 15:36:14 2021
OS/Arch:      linux/amd64

Output of podman info --debug:

Client:
Version:      3.3.1
API Version:  3.3.1
Go Version:   go1.17
Built:        Mon Aug 30 15:15:26 2021
OS/Arch:      darwin/amd64

Server:
Version:      3.3.0
API Version:  3.3.0
Go Version:   go1.16.6
Built:        Fri Aug 20 15:36:14 2021
OS/Arch:      linux/amd64
(base) ➜  testnet podman info --debug
host:
  arch: amd64
  buildahVersion: 1.22.3
  cgroupControllers: []
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.0.29-2.fc34.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.29, commit: '
  cpus: 1
  distribution:
    distribution: fedora
    version: "34"
  eventLogger: journald
  hostname: localhost
  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
  kernel: 5.13.12-200.fc34.x86_64
  linkmode: dynamic
  memFree: 593076224
  memTotal: 2061852672
  ociRuntime:
    name: crun
    package: crun-0.21-1.fc34.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 0.21
      commit: c4c3cdf2ce408ed44a9e027c618473e6485c635b
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    exists: true
    path: /run/user/1000/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.1.9-1.fc34.x86_64
    version: |-
      slirp4netns version 1.1.8+dev
      commit: 6dc0186e020232ae1a6fcc1f7afbc3ea02fd3876
      libslirp: 4.4.0
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.0
  swapFree: 0
  swapTotal: 0
  uptime: 37m 49.16s
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - docker.io
  - quay.io
store:
  configFile: /var/home/core/.config/containers/storage.conf
  containerStore:
    number: 6
    paused: 0
    running: 1
    stopped: 5
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /var/home/core/.local/share/containers/storage
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 16
  runRoot: /run/user/1000/containers
  volumePath: /var/home/core/.local/share/containers/storage/volumes
version:
  APIVersion: 3.3.0
  Built: 1629488174
  BuiltTime: Fri Aug 20 19:36:14 2021
  GitCommit: ""
  GoVersion: go1.16.6
  OsArch: linux/amd64
  Version: 3.3.0

Package info (e.g. output of rpm -q podman or apt list podman):

Installed via homebrew

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)

Yes

Additional environment details (AWS, VirtualBox, physical, etc.):

Local MacBook Pro

@willcohen willcohen changed the title Cannot create networks when using podman machine on macOS Cannot create networks using docker-compose when using podman machine on macOS Sep 2, 2021
@mheon
Copy link
Member

mheon commented Sep 2, 2021

@ashley-cui @baude PTAL

@willcohen
Copy link
Author

For what it's worth, I got docker-compose working here using largely the approach suggested by #11397 (comment).

@linhmtran168
Copy link

linhmtran168 commented Sep 3, 2021

Same problem here in MacOS.
Even when I logged in Podman VM, created a custome network in rootfull mode, and run podman run with the created custom network, the same problem happened.

[core@localhost networks]$ sudo podman network create podmantest
/etc/cni/net.d/podmantest.conflist
[core@localhost networks]$ sudo podman run --log-level debug --network podmantest --rm -it alpine ls
INFO[0000] podman filtering at log level debug
DEBU[0000] Called run.PersistentPreRunE(podman run --log-level debug --network podmantest --rm -it alpine ls)
DEBU[0000] Merged system config "/usr/share/containers/containers.conf"
DEBU[0000] Merged system config "/etc/containers/containers.conf"
DEBU[0000] Using conmon: "/usr/bin/conmon"
DEBU[0000] Initializing boltdb state at /var/lib/containers/storage/libpod/bolt_state.db
DEBU[0000] Using graph driver overlay
DEBU[0000] Using graph root /var/lib/containers/storage
DEBU[0000] Using run root /run/containers/storage
DEBU[0000] Using static dir /var/lib/containers/storage/libpod
DEBU[0000] Using tmp dir /run/libpod
DEBU[0000] Using volume path /var/lib/containers/storage/volumes
DEBU[0000] Set libpod namespace to ""
DEBU[0000] [graphdriver] trying provided driver "overlay"
DEBU[0000] cached value indicated that overlay is supported
DEBU[0000] cached value indicated that metacopy is being used
DEBU[0000] NewControl(/var/lib/containers/storage/overlay): nextProjectID = 559859058
DEBU[0000] cached value indicated that native-diff is not being used
INFO[0000] Not using native diff for overlay, this may cause degraded performance for building images: kernel has CONFIG_OVERLAY_FS_REDIRECT_DIR enabled
DEBU[0000] backingFs=xfs, projectQuotaSupported=true, useNativeDiff=false, usingMetacopy=true
DEBU[0000] Initializing event backend journald
DEBU[0000] configured OCI runtime kata initialization failed: no valid executable found for OCI runtime kata: invalid argument
DEBU[0000] configured OCI runtime runsc initialization failed: no valid executable found for OCI runtime runsc: invalid argument
DEBU[0000] Using OCI runtime "/usr/bin/crun"
INFO[0000] Found CNI network podman (type=bridge) at /etc/cni/net.d/87-podman.conflist
INFO[0000] Found CNI network podmantest (type=bridge) at /etc/cni/net.d/podmantest.conflist
INFO[0000] Found CNI network podmantest2 (type=bridge) at /etc/cni/net.d/podmantest2.conflist
DEBU[0000] Default CNI network name podman is unchangeable
INFO[0000] Setting parallel job count to 7
DEBU[0000] Pulling image alpine (policy: missing)
DEBU[0000] Looking up image "alpine" in local containers storage
DEBU[0000] Trying "alpine" ...
DEBU[0000] Loading registries configuration "/etc/containers/registries.conf"
DEBU[0000] Loading registries configuration "/etc/containers/registries.conf.d/000-shortnames.conf"
DEBU[0000] Trying "docker.io/library/alpine:latest" ...
DEBU[0000] parsed reference into "[overlay@/var/lib/containers/storage+/run/containers/storage:overlay.mountopt=nodev,metacopy=on]@14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab"
DEBU[0000] Found image "alpine" as "docker.io/library/alpine:latest" in local containers storage
DEBU[0000] Found image "alpine" as "docker.io/library/alpine:latest" in local containers storage ([overlay@/var/lib/containers/storage+/run/containers/storage:overlay.mountopt=nodev,metacopy=on]@14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab)
DEBU[0000] Looking up image "docker.io/library/alpine:latest" in local containers storage
DEBU[0000] Trying "docker.io/library/alpine:latest" ...
DEBU[0000] parsed reference into "[overlay@/var/lib/containers/storage+/run/containers/storage:overlay.mountopt=nodev,metacopy=on]@14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab"
DEBU[0000] Found image "docker.io/library/alpine:latest" as "docker.io/library/alpine:latest" in local containers storage
DEBU[0000] Found image "docker.io/library/alpine:latest" as "docker.io/library/alpine:latest" in local containers storage ([overlay@/var/lib/containers/storage+/run/containers/storage:overlay.mountopt=nodev,metacopy=on]@14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab)
DEBU[0000] Looking up image "alpine" in local containers storage
DEBU[0000] Trying "alpine" ...
DEBU[0000] Trying "docker.io/library/alpine:latest" ...
DEBU[0000] parsed reference into "[overlay@/var/lib/containers/storage+/run/containers/storage:overlay.mountopt=nodev,metacopy=on]@14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab"
DEBU[0000] Found image "alpine" as "docker.io/library/alpine:latest" in local containers storage
DEBU[0000] Found image "alpine" as "docker.io/library/alpine:latest" in local containers storage ([overlay@/var/lib/containers/storage+/run/containers/storage:overlay.mountopt=nodev,metacopy=on]@14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab)
DEBU[0000] Inspecting image 14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab
DEBU[0000] exporting opaque data as blob "sha256:14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab"
DEBU[0000] exporting opaque data as blob "sha256:14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab"
DEBU[0000] exporting opaque data as blob "sha256:14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab"
DEBU[0000] exporting opaque data as blob "sha256:14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab"
DEBU[0000] Looking up image "alpine" in local containers storage
DEBU[0000] Trying "alpine" ...
DEBU[0000] Trying "docker.io/library/alpine:latest" ...
DEBU[0000] parsed reference into "[overlay@/var/lib/containers/storage+/run/containers/storage:overlay.mountopt=nodev,metacopy=on]@14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab"
DEBU[0000] Found image "alpine" as "docker.io/library/alpine:latest" in local containers storage
DEBU[0000] Found image "alpine" as "docker.io/library/alpine:latest" in local containers storage ([overlay@/var/lib/containers/storage+/run/containers/storage:overlay.mountopt=nodev,metacopy=on]@14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab)
DEBU[0000] Inspecting image 14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab
DEBU[0000] exporting opaque data as blob "sha256:14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab"
DEBU[0000] exporting opaque data as blob "sha256:14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab"
DEBU[0000] exporting opaque data as blob "sha256:14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab"
DEBU[0000] exporting opaque data as blob "sha256:14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab"
DEBU[0000] Inspecting image 14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab
DEBU[0000] using systemd mode: false
DEBU[0000] No hostname set; container's hostname will default to runtime default
DEBU[0000] Loading seccomp profile from "/usr/share/containers/seccomp.json"
DEBU[0000] Allocated lock 5 for container daf9ad3852de0e34caec57d7149002d5434da5004a2e2f58ea9f2bef893180d2
DEBU[0000] parsed reference into "[overlay@/var/lib/containers/storage+/run/containers/storage:overlay.mountopt=nodev,metacopy=on]@14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab"
DEBU[0000] exporting opaque data as blob "sha256:14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab"
DEBU[0000] SetQuota path=/var/lib/containers/storage/overlay/25353c45167419283f81acffac59db3a0a774898fa6ad6617dd95dec18d804c9, size=0, inodes=0, projectID=559859058
DEBU[0000] created container "daf9ad3852de0e34caec57d7149002d5434da5004a2e2f58ea9f2bef893180d2"
DEBU[0000] container "daf9ad3852de0e34caec57d7149002d5434da5004a2e2f58ea9f2bef893180d2" has work directory "/var/lib/containers/storage/overlay-containers/daf9ad3852de0e34caec57d7149002d5434da5004a2e2f58ea9f2bef893180d2/userdata"
DEBU[0000] container "daf9ad3852de0e34caec57d7149002d5434da5004a2e2f58ea9f2bef893180d2" has run directory "/run/containers/storage/overlay-containers/daf9ad3852de0e34caec57d7149002d5434da5004a2e2f58ea9f2bef893180d2/userdata"
DEBU[0000] Handling terminal attach
DEBU[0000] [graphdriver] trying provided driver "overlay"
DEBU[0000] cached value indicated that overlay is supported
DEBU[0000] cached value indicated that metacopy is being used
DEBU[0000] NewControl(/var/lib/containers/storage/overlay): nextProjectID = 559859059
DEBU[0000] backingFs=xfs, projectQuotaSupported=true, useNativeDiff=false, usingMetacopy=true
DEBU[0000] cached value indicated that volatile is being used
DEBU[0000] overlay: mount_data=nodev,metacopy=on,lowerdir=/var/lib/containers/storage/overlay/l/EWDX2NKFWRD2IGXFCZS5XMLXOR,upperdir=/var/lib/containers/storage/overlay/25353c45167419283f81acffac59db3a0a774898fa6ad6617dd95dec18d804c9/diff,workdir=/var/lib/containers/storage/overlay/25353c45167419283f81acffac59db3a0a774898fa6ad6617dd95dec18d804c9/work,volatile,context="system_u:object_r:container_file_t:s0:c734,c919"
DEBU[0000] mounted container "daf9ad3852de0e34caec57d7149002d5434da5004a2e2f58ea9f2bef893180d2" at "/var/lib/containers/storage/overlay/25353c45167419283f81acffac59db3a0a774898fa6ad6617dd95dec18d804c9/merged"
DEBU[0000] Created root filesystem for container daf9ad3852de0e34caec57d7149002d5434da5004a2e2f58ea9f2bef893180d2 at /var/lib/containers/storage/overlay/25353c45167419283f81acffac59db3a0a774898fa6ad6617dd95dec18d804c9/merged
DEBU[0000] Made network namespace at /run/netns/cni-50b04e6d-0e38-879a-d528-4e328e2de01d for container daf9ad3852de0e34caec57d7149002d5434da5004a2e2f58ea9f2bef893180d2
INFO[0000] Got pod network &{Name:suspicious_hodgkin Namespace:suspicious_hodgkin ID:daf9ad3852de0e34caec57d7149002d5434da5004a2e2f58ea9f2bef893180d2 NetNS:/run/netns/cni-50b04e6d-0e38-879a-d528-4e328e2de01d Networks:[{Name:podmantest Ifname:eth0}] RuntimeConfig:map[podmantest:{IP: MAC: PortMappings:[] Bandwidth:<nil> IpRanges:[]}] Aliases:map[]}
INFO[0000] Adding pod suspicious_hodgkin_suspicious_hodgkin to CNI network "podmantest" (type=bridge)
INFO[0000] Got pod network &{Name:suspicious_hodgkin Namespace:suspicious_hodgkin ID:daf9ad3852de0e34caec57d7149002d5434da5004a2e2f58ea9f2bef893180d2 NetNS:/run/netns/cni-50b04e6d-0e38-879a-d528-4e328e2de01d Networks:[{Name:podmantest Ifname:eth0}] RuntimeConfig:map[podmantest:{IP: MAC: PortMappings:[] Bandwidth:<nil> IpRanges:[]}] Aliases:map[]}
ERRO[0000] error loading cached network config: network "podmantest" not found in CNI cache
WARN[0000] falling back to loading from existing plugins on disk
INFO[0000] Deleting pod suspicious_hodgkin_suspicious_hodgkin from CNI network "podmantest" (type=bridge)
DEBU[0000] unmounted container "daf9ad3852de0e34caec57d7149002d5434da5004a2e2f58ea9f2bef893180d2"
DEBU[0000] Network is already cleaned up, skipping...
DEBU[0000] Cleaning up container daf9ad3852de0e34caec57d7149002d5434da5004a2e2f58ea9f2bef893180d2
DEBU[0000] Network is already cleaned up, skipping...
DEBU[0000] Container daf9ad3852de0e34caec57d7149002d5434da5004a2e2f58ea9f2bef893180d2 storage is already unmounted, skipping...
DEBU[0000] Removing container daf9ad3852de0e34caec57d7149002d5434da5004a2e2f58ea9f2bef893180d2
DEBU[0000] Removing all exec sessions for container daf9ad3852de0e34caec57d7149002d5434da5004a2e2f58ea9f2bef893180d2
DEBU[0000] Cleaning up container daf9ad3852de0e34caec57d7149002d5434da5004a2e2f58ea9f2bef893180d2
DEBU[0000] Network is already cleaned up, skipping...
DEBU[0000] Container daf9ad3852de0e34caec57d7149002d5434da5004a2e2f58ea9f2bef893180d2 storage is already unmounted, skipping...
DEBU[0000] Container daf9ad3852de0e34caec57d7149002d5434da5004a2e2f58ea9f2bef893180d2 storage is already unmounted, skipping...
DEBU[0000] ExitCode msg: "error configuring network namespace for container daf9ad3852de0e34caec57d7149002d5434da5004a2e2f58ea9f2bef893180d2: error adding pod suspicious_hodgkin_suspicious_hodgkin to cni network \"podmantest\": unexpected end of json input"
Error: error configuring network namespace for container daf9ad3852de0e34caec57d7149002d5434da5004a2e2f58ea9f2bef893180d2: error adding pod suspicious_hodgkin_suspicious_hodgkin to CNI network "podmantest": unexpected end of JSON input

@Luap99
Copy link
Member

Luap99 commented Sep 3, 2021

Can you paste the output of the file. It looks like it does not contain proper json.

@linhmtran168
Copy link

@Luap99 This is the content of created /etc/cni/net.d/podmantest.conflist file. I think it's a valid json.

{
   "cniVersion": "0.4.0",
   "name": "podmantest",
   "plugins": [
      {
         "type": "bridge",
         "bridge": "cni-podman1",
         "isGateway": true,
         "ipMasq": true,
         "hairpinMode": true,
         "ipam": {
            "type": "host-local",
            "routes": [
               {
                  "dst": "0.0.0.0/0"
               }
            ],
            "ranges": [
               [
                  {
                     "subnet": "10.89.0.0/24",
                     "gateway": "10.89.0.1"
                  }
               ]
            ]
         }
      },
      {
         "type": "portmap",
         "capabilities": {
            "portMappings": true
         }
      },
      {
         "type": "firewall",
         "backend": ""
      },
      {
         "type": "tuning"
      },
      {
         "type": "dnsname",
         "domainName": "dns.podman",
         "capabilities": {
            "aliases": true
         }
      },
      {
         "type": "podman-machine",
         "capabilities": {
            "portMappings": true
         }
      }
   ]
}

@Luap99
Copy link
Member

Luap99 commented Sep 3, 2021

Yeah the network file looks good. It looks like one of the cni plugins is failing. Can you run the process with strace -f this should show where it fails.

@linhmtran168
Copy link

@Luap99 Since the VM created by podman machine is running Fedora CoreOS, it doesn't include strace. I tried to use toolbox to install strace, but in the toolbox, podman command failed to run. I'm new to podman and CoreOS as well, so could you tell me how to use strace to debug podman inside CoreOS VM?

@Luap99
Copy link
Member

Luap99 commented Sep 3, 2021

Ah, I am not a coreos user so I don't know what the best way to install strace or such tools.
Maybe a easier option is to remove the podman-machine plugin part from the config file. I think plugin might cause troubles.

@linhmtran168
Copy link

@Luap99 Thank you. It's just as you said removing the podman-machine part make the podman run command succeeded. It even works with rootless network. But now the forward port mapping to MacOS host is not working anymore.

In the MacOS host, if I don't use custom network, forward port mapping is working fine.

$ podman run --rm -it --name nginx -p 8888:80 nginx

But with custom network, the port is not forwarded (it works fine inside the podman VM though)

podman run --network podmanmacos1 --rm -it --name nginx -p 8888:80 nginx

@Luap99
Copy link
Member

Luap99 commented Sep 3, 2021

Yes the podman-machine plugin sets up the port forwarding, so there is a bug with the plugin. I will see if I can find it.

@jpapejr
Copy link

jpapejr commented Sep 3, 2021

I’ve been seeing this “unexpected end of JSON input” error all day yesterday while playing with the latest podman for Mac (after the docker announcement) and I’ve seen it with some rather simple used cases to. I’ll do some testing and report back the images and use cases that fail. Part of the problem is that even with log-level=trace I don’t get any more detail on why the failure happens than the base CLI output.

@Luap99 Luap99 self-assigned this Sep 3, 2021
@jpapejr
Copy link

jpapejr commented Sep 3, 2021

Simple example

podman run -it nginx
Resolving "nginx" using unqualified-search registries (/etc/containers/registries.conf)
Trying to pull registry.fedoraproject.org/nginx:latest...
Trying to pull registry.access.redhat.com/nginx:latest...
Trying to pull docker.io/library/nginx:latest...
Getting image source signatures
Copying blob sha256:5ef80e6f29b5d942ad2be4a08fbefc222837246692294f1688a9fdc89904df0a
Copying blob sha256:ddb78cb2d04781d479f6781bf604d64440fcefdc985224ad4d957b4a52cbbe16
Copying blob sha256:f699b0db74e30a70ad7ab10fcb6209947934fdf511639c90f8d721418e4bd6cb
Copying blob sha256:0f701a34c55e98febadb75cc43e8c3401895cf494f8a4762692814a2c1faa758
Copying blob sha256:3229dce7b89cc47d414b62b27d7464f86f2f1e34e68ba2763ebb92468b875e3e
Copying blob sha256:a330b6cecb98cd2425fd25fce36669073f593b3176b4ee14731e48c05d678cdd
Copying blob sha256:ddb78cb2d04781d479f6781bf604d64440fcefdc985224ad4d957b4a52cbbe16
Copying blob sha256:5ef80e6f29b5d942ad2be4a08fbefc222837246692294f1688a9fdc89904df0a
Copying blob sha256:f699b0db74e30a70ad7ab10fcb6209947934fdf511639c90f8d721418e4bd6cb
Copying blob sha256:a330b6cecb98cd2425fd25fce36669073f593b3176b4ee14731e48c05d678cdd
Copying blob sha256:3229dce7b89cc47d414b62b27d7464f86f2f1e34e68ba2763ebb92468b875e3e
Copying blob sha256:0f701a34c55e98febadb75cc43e8c3401895cf494f8a4762692814a2c1faa758
Copying config sha256:822b7ec2aaf2122b8f80f9c7f45ca62ea3379bf33af4e042b67aafbf6eac1941
Writing manifest to image destination
Storing signatures
Error: error preparing container 43151948ae5f0aa713543e6c4ad9edd3195c4f0071bcd1f91c055dac6434e027 for attach: error configuring network namespace for container 43151948ae5f0aa713543e6c4ad9edd3195c4f0071bcd1f91c055dac6434e027: error adding pod happy_hamilton_happy_hamilton to CNI network "podman": unexpected end of JSON input

However, just adding the -P to publish the ports results in a working container

podman run -it -P nginx
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2021/09/03 13:13:05 [notice] 1#1: using the "epoll" event method
2021/09/03 13:13:05 [notice] 1#1: nginx/1.21.1
2021/09/03 13:13:05 [notice] 1#1: built by gcc 8.3.0 (Debian 8.3.0-6)
2021/09/03 13:13:05 [notice] 1#1: OS: Linux 5.13.12-200.fc34.x86_64
2021/09/03 13:13:05 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 524288:524288
2021/09/03 13:13:05 [notice] 1#1: start worker processes
2021/09/03 13:13:05 [notice] 1#1: start worker process 26
2021/09/03 13:13:05 [notice] 1#1: start worker process 27

Happens in the same manner whether rootless or rootful connection.

@Luap99 Luap99 added the In Progress This issue is actively being worked by the assignee, please do not work on this at this time. label Sep 3, 2021
Luap99 added a commit to Luap99/podman-machine-cni that referenced this issue Sep 3, 2021
When no ports are set we still have to return the CNI result back.
Otherwise CNI will fail with `unexpected end of JSON input`.

Fixes containers/podman#11413

Signed-off-by: Paul Holzinger <[email protected]>
@Luap99
Copy link
Member

Luap99 commented Sep 3, 2021

TLDR, the bug is that you cannot use the machine plugin without ports.
PR containers/podman-machine-cni#3 to fix this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
In Progress This issue is actively being worked by the assignee, please do not work on this at this time. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants