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 1757845 - You have to remove that container to be able to reuse that name.: that name is already in use (due to exec user process caused "no such file or directory")
Summary: You have to remove that container to be able to reuse that name.: that name i...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: podman
Version: 8.1
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: 8.2
Assignee: Nalin Dahyabhai
QA Contact: atomic-bugs@redhat.com
URL:
Whiteboard:
: 1766337 (view as bug list)
Depends On:
Blocks: 1727325 1734579 1787524
TreeView+ depends on / blocked
 
Reported: 2019-10-02 14:38 UTC by Michele Baldessari
Modified: 2020-12-20 06:17 UTC (History)
22 users (show)

Fixed In Version: podman-1.6.4-2.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1787524 (view as bug list)
Environment:
Last Closed: 2020-04-28 15:47:44 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2020:1650 0 None None None 2020-04-28 15:50:13 UTC

Comment 33 Daniel Walsh 2019-10-23 20:20:45 UTC
Strange

man 2 umount
,,,
       EINVAL target is not a mount point.

       EINVAL umount2()  was  called with MNT_EXPIRE and either MNT_DETACH or
              MNT_FORCE.

       EINVAL (since Linux 2.6.34)
              umount2() was called with an invalid flag value in flags.

man 3 unlink
...
       EBUSY  The file pathname cannot be unlinked because it is  being  used
              by  the  system  or another process; for example, it is a mount
              point or the NFS client software created  it  to  represent  an
              active but otherwise nameless inode ("NFS silly renamed").




This looks like something in stroage is complaining about merged not being mounted and later  an attempt is made to remove the file
and it says that it can't because something is mounte don it.

Comment 34 Alan Bishop 2019-11-05 14:27:00 UTC
*** Bug 1766337 has been marked as a duplicate of this bug. ***

Comment 52 Giuseppe Scrivano 2019-12-19 14:00:56 UTC
I don't think my proposed fix is enough.  I see other potential races with the home directory.

I think we still need to make sure there is no cleanup happening between a home directory mount and the overlay mount created on top of it.  My guess is that we hit the issue when something similar happens:


       Process A                                            Process B                                                            Process C
-----> mount home directory? Yes, it is not there
-----> mount overlay
-----> run container
-----> umount overlay
--------------------------------------------------> mount home directory? No, it is already mounted
-----> umount home directory? Yes, there are no mounts
--------------------------------------------------> mount overlay (directly on the host, no home directory present)
---------------------------------------------------------------------------------------------------------> mount home directory? Yes, it is not there (shadow mount overlay B)
--------------------------------------------------> run container
--------------------------------------------------> umount overlay

Now depending at what time process B is, the mount home directory from process C can cause different sort of issues.  If it is already inside of runc between prepareRoot() and "unix.Mount("", "/", "", uintptr(flag), "")" then it will cause the issue observed above with "exec user process caused "no such file or directory")".  When process B terminates it is unable to cleanup the overlay mount as it is not accessible.

Potential fixes:

- In store.Mount() we already have a lock on rlstore: is it enough to make sure the home directory exists before the mount or are there other cases where the overlay can be created?
- drop the home directory completely.  The performance benefit we have is probably outweighed by the locking.
- never drop the home directory mount.  We leak a mount when there are no containers running, but both performance benefit and no extra locking

Comment 53 Daniel Walsh 2019-12-19 15:41:28 UTC
I think the safest thing would be to just leak.  Then if someone wants to remove it they could manually umount it.

Comment 54 Giuseppe Scrivano 2019-12-19 18:18:26 UTC
while working on it, I saw we are already using the lock as part of the mount operation so we just need to keep it a bit longer.  Given that, I've opted for the first option instead and opened a PR.  Marked as WIP as it needs more testing:

https://github.com/containers/storage/pull/497

Comment 55 Michele Baldessari 2019-12-20 07:46:08 UTC
Thanks a bunch, Giuseppe. I'll take this PR for a long spin and report back (FWIW I left the first patch at c#51 running for 36 straight hours on three vms and it worked without issues. I'll do the same for this one and update here either over the weekend or on Monday)

Comment 56 Giuseppe Scrivano 2019-12-20 07:56:52 UTC
thanks, so the PR I've opened also includes the fix you were testing and in addition to that, we hold the lock also during the mount itself.

I am still looking at it today, I'll let you know when it is ready for testing.

Comment 73 errata-xmlrpc 2020-04-28 15:47:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:1650


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