RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1768355 - Podman cannot chdir: Permission denied in rootless mode
Summary: Podman cannot chdir: Permission denied in rootless mode
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: podman
Version: 7.7
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: rc
: ---
Assignee: Matthew Heon
QA Contact: Martin Jenner
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-11-04 07:48 UTC by Marek Vesely
Modified: 2019-11-12 12:45 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-12 12:45:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Marek Vesely 2019-11-04 07:48:05 UTC
Description of problem:
Podman is not able to execute in rootless mode. It is writing: cannot chdir: Permission denied.

Version-Release number of selected component (if applicable):
Version:            1.4.4
RemoteAPI Version:  1
Go Version:         go1.10.3
OS/Arch:            linux/amd64

How reporoducible:
always

Steps to Reproduce:
1. Install Podman, create special user and group and add lines to /etc/subuid and /etc/subgid:
teamcityagent:200000:65536
2. Configure sysctl: sysctl user.max_user_namespaces=28633
3. execute command: "podman unshare cat /proc/self/uid_map" under teamcityagent user.

Actual results:
$ podman unshare cat /proc/self/uid_map
cannot chdir: Permission denied
0 0 4294967295

Expected results:
$ podman unshare cat /proc/self/uid_map
0 1001 1
1 100000 65536
65537 165536 65536
or similar

Additional info:
I followed steps from WIKI: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux_atomic_host/7/html/managing_containers/finding_running_and_building_containers_with_podman_skopeo_and_buildah#set_up_for_rootless_containers . This is a VM in Vcenter running on CentOS 7.7.1908

Output from podman info --debug:
debug:
  compiler: gc
  git commit: ""
  go version: go1.10.3
  podman version: 1.4.4
host:
  BuildahVersion: 1.9.0
  Conmon:
    package: podman-1.4.4-4.el7.centos.x86_64
    path: /usr/libexec/podman/conmon
    version: 'conmon version 0.3.0, commit: unknown'
  Distribution:
    distribution: '"centos"'
    version: "7"
  MemFree: 1769316352
  MemTotal: 8200630272
  OCIRuntime:
    package: runc-1.0.0-65.rc8.el7.centos.x86_64
    path: /usr/bin/runc
    version: 'runc version spec: 1.0.1-dev'
  SwapFree: 0
  SwapTotal: 0
  arch: amd64
  cpus: 8
  hostname: teamcity-iot-01.triglav.local
  kernel: 3.10.0-1062.1.2.el7.x86_64
  os: linux
  rootless: false
  uptime: 576h 17m 55s (Approximately 24.00 days)
registries:
  blocked: null
  insecure: null
  search:
  - registry.access.redhat.com
  - docker.io
  - registry.fedoraproject.org
  - quay.io
  - registry.centos.org
store:
  ConfigFile: /etc/containers/storage.conf
  ContainerStore:
    number: 1
  GraphDriverName: overlay
  GraphOptions: null
  GraphRoot: /var/lib/containers/storage
  GraphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  ImageStore:
    number: 1
  RunRoot: /var/run/containers/storage
  VolumePath: /var/lib/containers/storage/volumes

Comment 2 Matthew Heon 2019-11-04 14:28:38 UTC
Can you try a `podman system migrate` and see if that resolves the error?

If that fails, try disabling SELinux with `setenforce 0` and then trying again to see if SELinux is denying the action.

Comment 3 Daniel Walsh 2019-11-04 16:48:44 UTC
Also what file system is your homedir?

Comment 4 Marek Vesely 2019-11-05 07:06:30 UTC
podman system migrate and disabling of SELinux didnt fixed this issue. There is still the same error.

homedir is XFS:
/dev/mapper/centos_teamcity--iot--home-home      xfs      1017M  495M  522M  49% /home

and mounted like this:
/dev/mapper/centos_teamcity--iot--home-home on /home type xfs (rw,relatime,seclabel,attr2,inode64,noquota)

Comment 5 Giuseppe Scrivano 2019-11-08 14:33:25 UTC
what is the working directory where you are running the command (please share the output of `pwd`)?

How did you create the user session? Have you used `su`?

Comment 6 Marek Vesely 2019-11-11 06:26:41 UTC
OMG, Yes you are correct. I was in home directory of different user, because i supposed that configuration of storage.conf is hardly configured to home dir of teamcityagent user.

Comment 7 Daniel Walsh 2019-11-11 15:20:19 UTC
So can I close this bugzilla?

Comment 8 Marek Vesely 2019-11-12 05:37:28 UTC
Yes you can, thank you!


Note You need to log in before you can comment on or make changes to this bug.