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

[v3.1-dev] [rootless] binaries in same path make podman throw a warning #9389

Closed
tobwen opened this issue Feb 15, 2021 · 10 comments · Fixed by containers/common#498 or containers/common#538
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@tobwen
Copy link
Contributor

tobwen commented Feb 15, 2021

/kind bug

Description
When podman and crun are in path, podman throws a warning. Although this warning is wrong since the runtime has been defined in containers.conf

Steps to reproduce the issue:

  1. $ PATH="$PATH:/home/tobwen/podman/usr/local/bin" /home/tobwen/podman/usr/local/bin/podman info
  2. $ /home/tobwen/podman/usr/local/bin/podman info

Describe the results you received:
Only first step throws a warning:

WARN[0000] Found default OCIruntime /home/tobwen/podman/usr/local/bin/crun path which is missing from [engine.runtimes] in containers.conf
WARN[0000] Found default OCIruntime /home/tobwen/podman/usr/local/bin/crun path which is missing from [engine.runtimes] in containers.conf

Describe the results you expected:
I expect both commands to output

7c0af7b0d1be2938f62c4ddc22d93b29e890320a159fb3b411cf938c35808b2f

Additional information you deem important (e.g. issue happens only occasionally):
Files in /home/tobwen/podman/usr/local/bin/:

  • buildah
  • catatonit
  • conmon
  • crun
  • fuse-overlayfs
  • podman
  • podman-remote
  • slirp4netns

/home/tobwen/.config/containers/containers.conf

[containers]
default_capabilities = [
    "CHOWN",
    "DAC_OVERRIDE",
    "FOWNER",
    "FSETID",
    "KILL",
    "NET_BIND_SERVICE",
    "SETFCAP",
    "SETGID",
    "SETPCAP",
    "SETUID",
    "SYS_CHROOT"
]

default_sysctls = [
    "net.ipv4.ping_group_range=0 0",
]

env = [
    "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
    "TERM=xterm",
]

init_path = "/home/tobwen/podman/usr/local/bin/catatonit"

[network]
# nothing here

[engine]
cgroup_manager = "cgroupfs"

conmon_env_vars = [
    "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
]

conmon_path = [
    "/home/tobwen/podman/usr/local/bin/conmon"
]

image_default_transport = "docker://"

network_cmd_path="/home/tobwen/podman/usr/local/bin/slirp4netns"

runtime = "crun"
runtime_supports_json = [ "crun" ]
runtime_supports_nocgroups = [ "crun" ]

[engine.runtimes]
crun = [ "/home/tobwen/podman/usr/local/bin/crun" ]
runc = []

[engine.volume_plugins]
# nothing here

Output of podman version:

Version:      3.1.0-dev
API Version:  3.0.0
Go Version:   go1.14
Git Commit:   3ba0afdd0f03195827f46b50757928ead44b1567
Built:        Sat Feb 13 19:38:35 2021
OS/Arch:      linux/amd64

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.19.4
  cgroupManager: cgroupfs
  cgroupVersion: v1
  conmon:
    package: Unknown
    path: /home/tobwen/podman/usr/local/bin/conmon
    version: 'conmon version 2.0.27-dev, commit: c3f31c0671f6c84f5e02ec710385e1e8f2936066'
  cpus: 12
  distribution:
    distribution: debian
    version: "10"
  eventLogger: journald
  hostname: dev
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1001
      size: 1
    - container_id: 1
      host_id: 165536
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1001
      size: 1
    - container_id: 1
      host_id: 165536
      size: 65536
  kernel: 5.5.0-0.bpo.2-amd64
  linkmode: dynamic
  memFree: 38050312192
  memTotal: 135098531840
  ociRuntime:
    name: /home/tobwen/podman/usr/local/bin/crun
    package: Unknown
    path: /home/tobwen/podman/usr/local/bin/crun
    version: |-
      crun version 0.17.31-bdc5
      commit: eb39fb52d693c84b1ed1c80c50f2a88cf36579cb
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
  os: linux
  remoteSocket:
    path: /run/user/1001/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
    selinuxEnabled: false
  slirp4netns:
    executable: /home/tobwen/bin/slirp4netns
    package: Unknown
    version: |-
      slirp4netns version 1.1.4+dev
      commit: 676792204708ce10c7553000dcf293a79db6277a
libslirp: 4.3.1
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.4.4
  swapFree: 22982606848
  swapTotal: 25767702528
  uptime: 2565h 25m 58.12s (Approximately 106.88 days)
registries:
  search:
  - docker.io
  - quay.io
store:
  configFile: /home/tobwen/.config/containers/storage.conf
  containerStore:
    number: 28
    paused: 0
    running: 0
    stopped: 28
  graphDriverName: overlay
  graphOptions:
    overlay.mount_program:
      Executable: /home/tobwen/podman/usr/local/bin/fuse-overlayfs
      Package: Unknown
      Version: |-
        fusermount3 version: 3.9.0
        fuse-overlayfs: version 1.0.0
        FUSE library version 3.9.0
        using FUSE kernel interface version 7.31
  graphRoot: /home/tobwen/.local/share/containers/storage
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 0
  runRoot: /run/user/1001/containers
  volumePath: /home/tobwen/.local/share/containers/storage/volumes
version:
  APIVersion: 3.0.0
  Built: 1613245115
  BuiltTime: Sat Feb 13 19:38:35 2021
  GitCommit: 3ba0afdd0f03195827f46b50757928ead44b1567
  GoVersion: go1.14
  OsArch: linux/amd64
  Version: 3.1.0-dev

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

n/a - manual build

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?

Yes

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

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Feb 15, 2021
@rhatdan
Copy link
Member

rhatdan commented Feb 16, 2021

I tried this exact test and could not get the error you are seeing to happen.

I even did
PATH="/home/dwalsh/podman/usr/local/bin" ./bin/podman info
And it worked fine. (Once I copied all of the executables into that path.

I have no idea what is causing your issue. The code looks correct as well.

@tobwen
Copy link
Contributor Author

tobwen commented Feb 18, 2021

PATH="/home/dwalsh/podman/usr/local/bin" ./bin/podman info

Try this:

PATH="$PATH:/home/dwalsh/podman/usr/local/bin" /home/dwalsh/podman/usr/local/bin/podman info 

This gives me (with my paths):

time="2021-02-18T01:16:23Z" level=warning msg="Found default OCIruntime /home/tobwen/podman/usr/local/bin/crun path which is missing from [engine.runtimes] >
time="2021-02-18T01:16:23Z" level=warning msg="Found default OCIruntime /home/tobwen/podman/usr/local/bin/crun path which is missing from [engine.runtimes] >
time="2021-02-18T01:16:23Z" level=warning msg="Found default OCIruntime /home/tobwen/podman/usr/local/bin/crun path which is missing from [engine.runtimes] >
time="2021-02-18T01:16:23Z" level=warning msg="Found default OCIruntime /home/tobwen/podman/usr/local/bin/crun path which is missing from [engine.runtimes] >
time="2021-02-18T01:16:23Z" level=warning msg="Found default OCIruntime /home/tobwen/podman/usr/local/bin/crun path which is missing from [engine.runtimes] >
time="2021-02-18T01:16:23Z" level=warning msg="Found default OCIruntime /home/tobwen/podman/usr/local/bin/crun path which is missing from [engine.runtimes] >

But podman keeps on running. The warnings really appear multiple times.

@eriksjolund
Copy link
Contributor

eriksjolund commented Feb 21, 2021

I'm just guessing here:
Could it be that:
@rhatdan has another crun binary installed in one of the default locations but
@tobwen does not have any crun installed in one of the default locations?

With Podman v3.0.1, I'm seeing a similar warning.

WARN[0000] Found default OCIruntime /home/erik.sjolund/bin/crun path which is missing from [engine.runtimes] in containers.conf

Note, my system has a crun installed at /home/erik.sjolund/bin/crun but not in any of the default locations

  • /usr/bin/crun
  • /usr/sbin/crun
  • /usr/local/bin/crun
  • /usr/local/sbin/crun
  • /sbin/crun
  • /bin/crun
  • /run/current-system/sw/bin/crun
[esjolund@laptop podman]$ git tag --points-at HEAD
v3.0.1
[esjolund@laptop podman]$ grep -r "path which is missing from" .
./vendor/github.com/containers/common/pkg/config/config.go:			logrus.Warningf("Found default OCIruntime %s path which is missing from [engine.runtimes] in containers.conf", path)
[esjolund@laptop podman]$ 

Assuming the warning comes from

logrus.Warningf("Found default OCIruntime %s path which is missing from [engine.runtimes] in containers.conf", path)

That is within the function

func (c *EngineConfig) findRuntime() string {

Looking for usage of the function findRuntime

[esjolund@laptop podman]$ git tag --points-at HEAD
v3.0.1
[esjolund@laptop podman]$ grep -r findRuntime
vendor/github.com/containers/common/pkg/config/default.go:	c.OCIRuntime = c.findRuntime()
vendor/github.com/containers/common/pkg/config/config.go:func (c *EngineConfig) findRuntime() string {
[esjolund@laptop podman]$ 

The only use of that function seems to be

Just before using it, the c.OCIRuntimes is set to a hash of predefined values.

c.OCIRuntimes = map[string][]string{

In other words, the warning

WARN[0000] Found default OCIruntime /home/erik.sjolund/bin/crun path which is missing from [engine.runtimes] in containers.conf

does not make sense because ~/.config/containers/containers.conf is not involved here. (The checked paths just before the warning are hard coded paths from the source code and not from the configuration file containers.conf)-

@rhatdan
Copy link
Member

rhatdan commented Feb 22, 2021

Interested in opening a PR to fix?

@tobwen
Copy link
Contributor Author

tobwen commented Feb 22, 2021

Interested in opening a PR to fix?

Don't we need a fix to open a PR? :-)

@eriksjolund
Copy link
Contributor

I'm planning to learn how to write Golang but I haven't gotten to it yet.

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Mar 25, 2021

@tobwen is this still an issue?

@tobwen
Copy link
Contributor Author

tobwen commented Mar 25, 2021

Let me recompile it in some hours. I'll report then.

@eriksjolund
Copy link
Contributor

I made a demo of the issue in a GitHub Actions workflow

https://github.com/eriksjolund/reproduce-podman-issue-9389-in-github-actions-workflow/blob/master/.github/workflows/reproduce-podman-issue-9389.yml

There the bug is still reproducible

https://github.com/eriksjolund/reproduce-podman-issue-9389-in-github-actions-workflow/runs/2195622081?check_suite_focus=true

I'm not exactly sure what part of the setup is needed. (It might be possible to simplify the demo)

eriksjolund added a commit to eriksjolund/podman that referenced this issue Apr 17, 2021
Rephrase the log message and change the log level from
"warning" to "trace".

Fixes containers#9389

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
eriksjolund added a commit to eriksjolund/common that referenced this issue Apr 17, 2021
Rephrase the log message and change the log level from
"warning" to "trace".

Fixes: containers/podman#9389

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
eriksjolund added a commit to eriksjolund/common that referenced this issue Apr 17, 2021
Rephrase the log message and change the log level from
"warning" to "debug".

Fixes: containers/podman#9389

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
eriksjolund added a commit to eriksjolund/common that referenced this issue Apr 19, 2021
Rephrase the log message and change the log level from
"warning" to "debug".

Fixes: containers/podman#9389

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
eriksjolund added a commit to eriksjolund/build-podman that referenced this issue May 3, 2021
* Add fix_podman_issue_9389.bash
  The Podman issue 9389 has already been fixed
  in the Podman master branch
  (See containers/podman#9389)
  Remove this workaround later

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
4 participants