Bug 1764269

Summary: broken podman command when run as root
Product: [Fedora] Fedora Reporter: gabx <arnaud.gaboury>
Component: podmanAssignee: Giuseppe Scrivano <gscrivan>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 29CC: bbaude, dwalsh, frantisek.kluknavsky, jnovy, lsm5, mheon, santiago
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-10-22 17:52:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description gabx 2019-10-22 15:14:54 UTC
Description of problem:
Running the podman commands as a regular user gives error.


Version-Release number of selected component (if applicable):
podman version 1.5.1
VERSION="29.20191013.0 (Atomic Host)"
ID=fedora


How reproducible:


Steps to Reproduce:
1.login as a regular user
2.run podman command with some arguments

Example with:
% podman info

Actual results:

Error: could not get runtime: error creating tmpdir /run/user/1001/libpod/tmp: mkdir /run/user/1001: permission denied


Expected results:

host:
  BuildahVersion: 1.10.1
  Conmon:
    package: podman-1.5.1-3.fc29.x86_64
    path: /usr/libexec/podman/conmon
    version: 'conmon version 2.0.0, commit: fa55639b725e7626b28dbd43de8e9546f7411226-dirty'
  Distribution:
    distribution: fedora
    version: "29"
...
---------------------------------------------

Another command with error:

% podman images 
Error: could not get runtime: error creating tmpdir /run/user/1001/libpod/tmp: mkdir /run/user/1001: permission denied

# podman images
REPOSITORY                          TAG      IMAGE ID       CREATED        SIZE
docker.io/linuxserver/mariadb       latest   ab6a31f8a171   2 days ago     348 MB
docker.io/library/redis             latest   01a52b3b5cd1   12 days ago    102 MB
...

-----------------------------------------
Additional info:

1- root does not have XDG_RUNTIME_DIR set in its environment, and /run/user/0 does not exist.
2- SELinux is enforced

Comment 1 Giuseppe Scrivano 2019-10-22 15:48:54 UTC
how did you login?

Can you show the result of ls -l /run/user/1001?

Is /run/user/1001 written in your ~/.config/containers/storage.conf file?

Comment 2 gabx 2019-10-22 17:52:41 UTC
I just founded the culprit after investigation of $HOME configuration file.
I copied my XDG_CONFIG_HOME from one user to another one. I was not aware of the  .config/containers/libpod.conf file. I found in it a wrong path for tmp_dir, with a wrong user ID.

So it is not a bug but a bad configuration. 

Closing.