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

[mac]e2e:Podman machine cannot run if default $TMPDIR #22360

Closed
tnk4on opened this issue Apr 12, 2024 · 1 comment · Fixed by #22362
Closed

[mac]e2e:Podman machine cannot run if default $TMPDIR #22360

tnk4on opened this issue Apr 12, 2024 · 1 comment · Fixed by #22362
Labels
kind/bug Categorizes issue or PR as related to a bug. macos MacOS (OSX) related remote Problem is in podman-remote

Comments

@tnk4on
Copy link
Contributor

tnk4on commented Apr 12, 2024

Issue Description

The default $TMPDIR in macOS is set to a random value as follows.

/var/folders/1c/_h1nw8g90fqfvqt7y1swj5x40000gn/T/

When I run a localmachine test in this state, I get the following error.

% echo $TMPDIR
/var/folders/1c/_h1nw8g90fqfvqt7y1swj5x40000gn/T/
% export DEBUG=1
% make localmachine FOCUS="simple init with start"
...
  time="2024-04-12T23:01:02+09:00" level=info msg="Using unix socket /var/folders/1c/_h1nw8g90fqfvqt7y1swj5x40000gn/T/podman/8d0cf5f89c6b-gvproxy.sock"
  Error: dial unixgram /var/folders/1c/_h1nw8g90fqfvqt7y1swj5x40000gn/T/podman_test680956715/Library/Application Support/vfkit/net-18158-692222049.sock->/var/folders/1c/_h1nw8g90fqfvqt7y1swj5x40000gn/T/podman/8d0cf5f89c6b-gvproxy.sock: bind: invalid argument

$TMPDIR must be less than 21 characters.
NG:export TMPDIR=/tmp/0123456789/012345
OK:export TMPDIR=/tmp/0123456789/01234

Steps to reproduce the issue

Steps to reproduce the issue

  1. Preconfiguration
% git clone https://github.com/containers/podman.git
% cd podman
% make podman-remote
  1. NG case
% echo $TMPDIR
/var/folders/1c/_h1nw8g90fqfvqt7y1swj5x40000gn/T/
% make localmachine FOCUS="simple init with start"
...
Will run 1 of 51 specs
------------------------------
[BeforeSuite] 
/Users/shtanaka/tmp/podman/pkg/machine/e2e/machine_test.go:48
  > Enter [BeforeSuite] TOP-LEVEL - /Users/shtanaka/tmp/podman/pkg/machine/e2e/machine_test.go:48 @ 04/12/24 15:48:37.843
Looking up Podman Machine image at quay.io/podman/machine-os:5.1 to create VM
Extracting compressed file: podman-machine-daily.aarch64.applehv.raw: done  
  < Exit [BeforeSuite] TOP-LEVEL - /Users/shtanaka/tmp/podman/pkg/machine/e2e/machine_test.go:48 @ 04/12/24 15:48:47.366 (9.523s)
[BeforeSuite] PASSED [9.523 seconds]
------------------------------
...

  /Users/shtanaka/tmp/podman/bin/darwin/podman machine start 98180c6921ef
  Starting machine "98180c6921ef"
  time="2024-04-12T15:49:03+09:00" level=error msg="listen unix /var/folders/1c/_h1nw8g90fqfvqt7y1swj5x40000gn/T/podman_test1945429264/.podman/98180c6921ef-ignition.sock: bind: invalid argument"
  Error: vfkit exited unexpectedly with exit code 1
  [FAILED] Expected
      <int>: 125
  to match exit code:
      <int>: 0
  In [It] at: /Users/shtanaka/tmp/podman/pkg/machine/e2e/init_test.go:117 @ 04/12/24 15:49:04.522

  Full Stack Trace
    github.com/containers/podman/v5/pkg/machine/e2e_test.init.func3.5()
        /Users/shtanaka/tmp/podman/pkg/machine/e2e/init_test.go:117 +0x4ac
  < Exit [It] simple init with start - /Users/shtanaka/tmp/podman/pkg/machine/e2e/init_test.go:101 @ 04/12/24 15:49:04.522 (9.175s)
  > Enter [AfterEach] podman machine init - /Users/shtanaka/tmp/podman/pkg/machine/e2e/init_test.go:29 @ 04/12/24 15:49:04.522
  /Users/shtanaka/tmp/podman/bin/darwin/podman machine rm --force 98180c6921ef
  < Exit [AfterEach] podman machine init - /Users/shtanaka/tmp/podman/pkg/machine/e2e/init_test.go:29 @ 04/12/24 15:49:04.836 (314ms)
• [FAILED] [17.469 seconds]
...
  1. OK case
% export TMPDIR=/private/tmp
% make localmachine FOCUS="simple init with start" 
...
Will run 1 of 51 specs
------------------------------
[BeforeSuite] 
/Users/shtanaka/tmp/podman/pkg/machine/e2e/machine_test.go:48
  > Enter [BeforeSuite] TOP-LEVEL - /Users/shtanaka/tmp/podman/pkg/machine/e2e/machine_test.go:48 @ 04/12/24 16:19:33.171
Looking up Podman Machine image at quay.io/podman/machine-os:5.1 to create VM
Extracting compressed file: podman-machine-daily.aarch64.applehv.raw: done  
  < Exit [BeforeSuite] TOP-LEVEL - /Users/shtanaka/tmp/podman/pkg/machine/e2e/machine_test.go:48 @ 04/12/24 16:19:42.757 (9.587s)
[BeforeSuite] PASSED [9.587 seconds]
------------------------------
...
  /Users/shtanaka/tmp/podman/bin/darwin/podman machine start 4e742298ce23
  Starting machine "4e742298ce23"

  This machine is currently configured in rootless mode. If your containers
  require root permissions (e.g. ports < 1024), or if you run into compatibility
  issues with non-podman clients, you can switch using the following command:

        podman machine set --rootful 4e742298ce23

  time="2024-04-12T16:20:29+09:00" level=warning msg="API socket failed ping test"
  API forwarding listening on: /var/run/docker.sock
  Docker API clients default to this address. You do not need to set DOCKER_HOST.

  Machine "4e742298ce23" started successfully
...
  < Exit [It] simple init with start - /Users/shtanaka/tmp/podman/pkg/machine/e2e/init_test.go:101 @ 04/12/24 16:20:30.418 (40.404s)
  > Enter [AfterEach] podman machine init - /Users/shtanaka/tmp/podman/pkg/machine/e2e/init_test.go:29 @ 04/12/24 16:20:30.418
  /Users/shtanaka/tmp/podman/bin/darwin/podman machine rm --force 4e742298ce23
  < Exit [AfterEach] podman machine init - /Users/shtanaka/tmp/podman/pkg/machine/e2e/init_test.go:29 @ 04/12/24 16:20:31.954 (1.537s)
• [49.196 seconds]

Describe the results you received

Summarizing 1 Failure:
  [FAIL] podman machine init [It] simple init with start
  /Users/shtanaka/tmp/podman/pkg/machine/e2e/init_test.go:117

Ran 1 of 51 Specs in 26.994 seconds
FAIL! -- 0 Passed | 1 Failed | 0 Pending | 50 Skipped
--- FAIL: TestMachine (27.00s)
FAIL

Describe the results you expected

Ran 1 of 51 Specs in 58.784 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 50 Skipped
PASS

podman info output

% ./bin/darwin/podman info        
host:
  arch: arm64
  buildahVersion: 1.35.0
  cgroupControllers:
  - cpu
  - io
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.10-1.fc39.aarch64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.10, commit: '
  cpuUtilization:
    idlePercent: 99.88
    systemPercent: 0.06
    userPercent: 0.06
  cpus: 5
  databaseBackend: sqlite
  distribution:
    distribution: fedora
    variant: coreos
    version: "39"
  eventLogger: journald
  freeLocks: 2048
  hostname: localhost.localdomain
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 1000000
    uidmap:
    - container_id: 0
      host_id: 501
      size: 1
    - container_id: 1
      host_id: 100000
      size: 1000000
  kernel: 6.7.7-200.fc39.aarch64
  linkmode: dynamic
  logDriver: journald
  memFree: 1551302656
  memTotal: 2047864832
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns-1.10.0-1.20240312103946045036.main.18.g8377c0a.fc39.aarch64
      path: /usr/libexec/podman/aardvark-dns
      version: aardvark-dns 1.11.0-dev
    package: netavark-1.10.1-1.20240319111419242122.main.46.gcc3f35d.fc39.aarch64
    path: /usr/libexec/podman/netavark
    version: netavark 1.11.0-dev
  ociRuntime:
    name: crun
    package: crun-1.14.4-1.20240302220834691516.main.10.g64ee22c.fc39.aarch64
    path: /usr/bin/crun
    version: |-
      crun version UNKNOWN
      commit: feb70bc2ab11944a6443e4f5d2eb96a22f186b80
      rundir: /run/user/501/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^20240220.g1e6f92b-1.fc39.aarch64
    version: |
      pasta 0^20240220.g1e6f92b-1.fc39.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: /run/user/501/podman/podman.sock
  rootlessNetworkCmd: ""
  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.2.2-1.fc39.aarch64
    version: |-
      slirp4netns version 1.2.2
      commit: 0ee2d87523e906518d34a6b423271e4826f71faf
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 4
      libseccomp: 2.5.3
  swapFree: 0
  swapTotal: 0
  uptime: 0h 21m 19.00s
  variant: v8
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - docker.io
store:
  configFile: /var/home/core/.config/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /var/home/core/.local/share/containers/storage
  graphRootAllocated: 106769133568
  graphRootUsed: 2960076800
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Supports shifting: "false"
    Supports volatile: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 0
  runRoot: /run/user/501/containers
  transientStore: false
  volumePath: /var/home/core/.local/share/containers/storage/volumes
version:
  APIVersion: 5.0.0-dev-8a643c243
  Built: 1710720000
  BuiltTime: Mon Mar 18 09:00:00 2024
  GitCommit: ""
  GoVersion: go1.21.8
  Os: linux
  OsArch: linux/arm64
  Version: 5.0.0-dev-8a643c243

Podman in a container

No

Privileged Or Rootless

None

Upstream Latest Release

Yes

Additional environment details

% ./bin/darwin/podman version 
Client:       Podman Engine
Version:      5.1.0-dev
API Version:  5.1.0-dev
Go Version:   go1.22.2
Git Commit:   e1ec17a569d828c367764abe1e5641f75cf8bc26-dirty
Built:        Fri Apr 12 21:09:54 2024
OS/Arch:      darwin/arm64

Server:       Podman Engine
Version:      5.0.0-dev-8a643c243
API Version:  5.0.0-dev-8a643c243
Go Version:   go1.21.8
Built:        Mon Mar 18 09:00:00 2024
OS/Arch:      linux/arm64
% sw_vers 
ProductName:            macOS
ProductVersion:         14.4.1
BuildVersion:           23E224

Additional information

Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting

@tnk4on tnk4on added the kind/bug Categorizes issue or PR as related to a bug. label Apr 12, 2024
@github-actions github-actions bot added macos MacOS (OSX) related remote Problem is in podman-remote labels Apr 12, 2024
@atombender
Copy link

The error is because /var/folders/1c/_h1nw8g90fqfvqt7y1swj5x40000gn/T/podman_test680956715/Library/Application Support/vfkit/net-18158-692222049.sock exceeds the maximum length of a Unix socket path, which is 100 characters. Try setting TMPDIR to /tmp.

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. macos MacOS (OSX) related remote Problem is in podman-remote
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants