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

gvproxy on macOS fails to start without internet connection #24912

Open
srcshelton opened this issue Dec 29, 2024 · 0 comments
Open

gvproxy on macOS fails to start without internet connection #24912

srcshelton opened this issue Dec 29, 2024 · 0 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. remote Problem is in podman-remote

Comments

@srcshelton
Copy link
Contributor

srcshelton commented Dec 29, 2024

Issue Description

I realised during a flight that gvproxy on macOS requires a working internet connection in order for podman machine start to succeed.

Running podman --log-level trace machine start shows the failing command as:

$ /opt/homebrew/Cellar/podman/5.3.1/libexec/podman/gvproxy -debug -mtu 1500 -ssh-port 61529 -listen-vfkit unixgram:///var/folders/<xx>/<xxxx>/T/podman/podman-machine-default-gvproxy.sock -forward-dest /run/podman/podman.sock -forward-user root -forward-identity /Users/<user>/.local/share/containers/podman/machine/machine -forward-sock /var/folders/<xx>/<xxxx>/T/podman/podman-machine-default-api.sock -pid-file /var/folders/<xx>/<xxxx>/T/podman/gvproxy.pid -log-file /var/folders/<xx>/<xxxx>/T/podman/gvproxy.log
panic: runtime error: index out of range [0] with length 0

goroutine 33 [running]:
github.com/containers/gvisor-tap-vsock/pkg/services/dns.getDNSHostAndPort()
	/private/tmp/podman--gvproxy-20241122-5354-gcocwn/gvisor-tap-vsock-0.8.0/pkg/services/dns/dns_config_unix.go:15 +0x94
github.com/containers/gvisor-tap-vsock/pkg/services/dns.newDNSHandler({0x14000130000, 0x2, 0x2})
	/private/tmp/podman--gvproxy-20241122-5354-gcocwn/gvisor-tap-vsock-0.8.0/pkg/services/dns/dns.go:29 +0x2c
github.com/containers/gvisor-tap-vsock/pkg/services/dns.New({0x104712780, 0x1400015e2c0}, {0x10470cf38, 0x1400015e340}, {0x14000130000?, 0x0?, 0x0?})
	/private/tmp/podman--gvproxy-20241122-5354-gcocwn/gvisor-tap-vsock-0.8.0/pkg/services/dns/dns.go:166 +0x3c
github.com/containers/gvisor-tap-vsock/pkg/virtualnetwork.dnsServer(0x1400011a1a0, 0x14000101008)
	/private/tmp/podman--gvproxy-20241122-5354-gcocwn/gvisor-tap-vsock-0.8.0/pkg/virtualnetwork/services.go:80 +0x250
github.com/containers/gvisor-tap-vsock/pkg/virtualnetwork.addServices(0x1400011a1a0, 0x14000101008, 0x14000140000)
	/private/tmp/podman--gvproxy-20241122-5354-gcocwn/gvisor-tap-vsock-0.8.0/pkg/virtualnetwork/services.go:32 +0x268
github.com/containers/gvisor-tap-vsock/pkg/virtualnetwork.New(0x1400011a1a0)
	/private/tmp/podman--gvproxy-20241122-5354-gcocwn/gvisor-tap-vsock-0.8.0/pkg/virtualnetwork/virtualnetwork.go:71 +0x374
main.run({0x10470ea10, 0x14000052460}, 0x140000ae900, 0x0?, {0x0, 0x0, 0x0?})
	/private/tmp/podman--gvproxy-20241122-5354-gcocwn/gvisor-tap-vsock-0.8.0/cmd/gvproxy/main.go:314 +0x3c
main.main.func3()
	/private/tmp/podman--gvproxy-20241122-5354-gcocwn/gvisor-tap-vsock-0.8.0/cmd/gvproxy/main.go:265 +0x44
golang.org/x/sync/errgroup.(*Group).Go.func1()
	/private/tmp/podman--gvproxy-20241122-5354-gcocwn/gvisor-tap-vsock-0.8.0/vendor/golang.org/x/sync/errgroup/errgroup.go:78 +0x54
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 1
	/private/tmp/podman--gvproxy-20241122-5354-gcocwn/gvisor-tap-vsock-0.8.0/vendor/golang.org/x/sync/errgroup/errgroup.go:75 +0x98

My reading of this is that gvproxy won't start without DNS - it also appears to be a problem if WiFi is turned-off on a machine without an active ethernet (or other) network connection.

In this case, connecting to the airline's captive portal (which only redirects to a payment page, rather than providing a full internet service) was enough to allow the pre-existing podman machine to start correctly.

Steps to reproduce the issue

Steps to reproduce the issue

  1. Create a podman machine;
  2. Stop it;
  3. Disconnect network interfaces;
  4. Attempt to podman machine start.

Describe the results you received

panic: runtime error: index out of range [0] with length 0 from gvproxy.

Describe the results you expected

The podman machine VM should have started even without active networking (surely?)

podman info output

host:
  arch: arm64
  buildahVersion: 1.38.0
  cgroupControllers:
  - cpuset
  - cpu
  - io
  - memory
  - pids
  - rdma
  - misc
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.12-2.fc40.aarch64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.12, commit: '
  cpuUtilization:
    idlePercent: 97.27
    systemPercent: 1.66
    userPercent: 1.07
  cpus: 4
  databaseBackend: sqlite
  distribution:
    distribution: fedora
    variant: coreos
    version: "40"
  eventLogger: journald
  freeLocks: 2048
  hostname: localhost.localdomain
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 6.11.3-200.fc40.aarch64
  linkmode: dynamic
  logDriver: journald
  memFree: 7285112832
  memTotal: 7717347328
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns-1.12.2-2.fc40.aarch64
      path: /usr/libexec/podman/aardvark-dns
      version: aardvark-dns 1.12.2
    package: netavark-1.12.2-1.fc40.aarch64
    path: /usr/libexec/podman/netavark
    version: netavark 1.12.2
  ociRuntime:
    name: crun
    package: crun-1.17-1.fc40.aarch64
    path: /usr/bin/crun
    version: |-
      crun version 1.17
      commit: 000fa0d4eeed8938301f3bcf8206405315bc1017
      rundir: /run/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJL
  os: linux
  pasta:
    executable: /usr/bin/pasta
    package: passt-0^20240906.g6b38f07-1.fc40.aarch64
    version: |
      pasta 0^20240906.g6b38f07-1.fc40.aarch64-pasta
      Copyright Red Hat
      GNU General Public License, version 2 or later
        <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.
  remoteSocket:
    exists: true
    path: unix:///run/podman/podman.sock
  rootlessNetworkCmd: pasta
  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: false
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.2-2.fc40.aarch64
    version: |-
      slirp4netns version 1.2.2
      commit: 0ee2d87523e906518d34a6b423271e4826f71faf
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 4
      libseccomp: 2.5.5
  swapFree: 0
  swapTotal: 0
  uptime: 0h 1m 44.00s
  variant: v8
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - docker.io
store:
  configFile: /usr/share/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions:
    overlay.imagestore: /usr/lib/containers/storage
    overlay.mountopt: nodev,metacopy=on
  graphRoot: /var/lib/containers/storage
  graphRootAllocated: 39123398656
  graphRootUsed: 14462476288
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Supports shifting: "true"
    Supports volatile: "true"
    Using metacopy: "true"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 0
  runRoot: /run/containers/storage
  transientStore: false
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 5.3.1
  Built: 1732147200
  BuiltTime: Wed Nov 20 17:00:00 2024
  GitCommit: ""
  GoVersion: go1.22.7
  Os: linux
  OsArch: linux/arm64
  Version: 5.3.1

Podman in a container

No

Privileged Or Rootless

None

Upstream Latest Release

Yes

Additional environment details

macOS 15.2

Additional information

No response

@srcshelton srcshelton added the kind/bug Categorizes issue or PR as related to a bug. label Dec 29, 2024
@github-actions github-actions bot added the remote Problem is in podman-remote label Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. remote Problem is in podman-remote
Projects
None yet
Development

No branches or pull requests

1 participant