Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-17842

leapp fails in reboot phase when /dev/shm is a persistent file system

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • rhel-8.10.z
    • leapp-repository
    • None
    • Moderate
    • rhel-sst-upgrades
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • None
    • None
    • None
    • None

      What were you trying to do that didn't work?

      For some reason some customers create /dev/shm as a persistent file system in /etc/fstab:

      /dev/mapper/rhel-dev_shm /dev/shm                xfs     defaults,nodev,noexec,nosuid        0 0
      

      Side note: on a normal boot, the file system won't be used at all because it's kind of configuration error, I'm trying to find where customers got this information.

      When having such file system definition with a bunch of others, e.g. to comply to STIG (/var, /var/log, and the such), leapp fails in reboot phase:

      [   11.644140] upgrade[684]: Traceback (most recent call last):
      [   11.644686] upgrade[684]:   File "/usr/bin/leapp", line 9, in <module>
      [   11.645209] upgrade[684]:     load_entry_point('leapp==0.16.0', 'console_scripts', 'leapp')()
      [   11.645838] upgrade[684]:   File "/usr/lib/python2.7/site-packages/leapp/cli/__init__.py", line 45, in main
      [   11.646552] upgrade[684]:     cli.command.execute('leapp version {}'.format(VERSION))
      [   11.647136] upgrade[684]:   File "/usr/lib/python2.7/site-packages/leapp/utils/clicmd.py", line 111, in execute
      [   11.657640] upgrade[684]:     args.func(args)
      [   11.658070] upgrade[684]:   File "/usr/lib/python2.7/site-packages/leapp/utils/clicmd.py", line 133, in called
      [   11.658815] upgrade[684]:     self.target(args)
      [   11.659190] upgrade[684]:   File "/usr/lib/python2.7/site-packages/leapp/cli/commands/upgrade/breadcrumbs.py", line 161, in wrapper
      [   11.660060] upgrade[684]:     return f(*args, breadcrumbs=breadcrumbs, **kwargs)
      [   11.660611] upgrade[684]:   File "/usr/lib/python2.7/site-packages/leapp/cli/commands/upgrade/__init__.py", line 89, in upgrade
      [   11.661479] upgrade[684]:     repositories = util.load_repositories()
      [   11.661961] upgrade[684]:   File "/usr/lib/python2.7/site-packages/leapp/cli/commands/upgrade/util.py", line 90, in load_repositories
      [   11.662866] upgrade[684]:     manager.load()
      [   11.663206] upgrade[684]:   File "/usr/lib/python2.7/site-packages/leapp/repository/manager.py", line 120, in load
      [   11.663972] upgrade[684]:     repo.load(resolve=False, stage=_LoadStage.ACTORS, skip_actors_discovery=skip_actors_discovery)
      [   11.664791] upgrade[684]:   File "/usr/lib/python2.7/site-packages/leapp/repository/__init__.py", line 153, in load
      [   11.665552] upgrade[684]:     actor.discover()
      [   11.665902] upgrade[684]:   File "/usr/lib/python2.7/site-packages/leapp/repository/actor_definition.py", line 207, in discover
      [   11.666743] upgrade[684]:     q = Queue(1)
      [   11.667061] upgrade[684]:   File "/usr/lib64/python2.7/multiprocessing/__init__.py", line 218, in Queue
      [   11.667757] upgrade[684]:     return Queue(maxsize)
      [   11.668149] upgrade[684]:   File "/usr/lib64/python2.7/multiprocessing/queues.py", line 63, in __init__
      [   11.668833] upgrade[684]:     self._rlock = Lock()
      [   11.669209] upgrade[684]:   File "/usr/lib64/python2.7/multiprocessing/synchronize.py", line 147, in __init__
      [   11.669921] upgrade[684]:     SemLock.__init__(self, SEMAPHORE, 1, 1)
      [   11.670400] upgrade[684]:   File "/usr/lib64/python2.7/multiprocessing/synchronize.py", line 75, in __init__
      [   11.671124] upgrade[684]:     sl = self._semlock = _multiprocessing.SemLock(kind, value, maxvalue)
      [   11.671788] upgrade[684]: OSError: [Errno 30] Read-only file system
      

      This "Read-only file system" is clearly /dev/shm, commenting it out makes the upgrade complete successfully.

      It seems having more file systems is required, I couldn't reproduce with a basic system with just slash, boot and swap.

      Please write an inhibitor for this issue.
      Ideally also provide details on exact root cause: debug boot logs didn't show an attempt to mount broken /dev/shm nor set it read-only somehow.

      Please provide the package NVR for which bug is seen:

      leapp-0.16.0-1.el7_9.noarch

      How reproducible:

      Always

      Steps to reproduce

      1. Install a system that would be "STIG compliant" + with a /dev/shm (20GB disk is good enough)
        bootloader --location=mbr --boot-drive=vda
        # Partition clearing information
        clearpart --none --initlabel
        # Disk partitioning information
        part pv.157 --fstype="lvmpv" --ondisk=vda --size=19455
        part /boot --fstype="xfs" --ondisk=vda --size=1024
        volgroup rhel --pesize=4096 pv.157
        logvol /var/log  --fstype="xfs" --size=512 --name=var_log --vgname=rhel
        logvol /var/tmp  --fstype="xfs" --size=512 --name=var_tmp --vgname=rhel --fsoptions="nodev,nosuid,noexec"
        logvol /  --fstype="xfs" --size=4096 --name=root --vgname=rhel
        logvol /dev/shm  --fstype="xfs" --size=512 --name=dev_shm --vgname=rhel --fsoptions="nodev,nosuid,noexec"
        logvol /home  --fstype="xfs" --size=512 --name=home --vgname=rhel --fsoptions="nodev"
        logvol /tmp  --fstype="xfs" --size=512 --name=tmp --vgname=rhel --fsoptions="nodev,nosuid,noexec"
        logvol swap  --fstype="swap" --size=2047 --name=swap --vgname=rhel
        logvol /var/log/audit  --fstype="xfs" --size=512 --name=var_log_audit --vgname=rhel --fsoptions="nodev,nosuid,noexec"
        logvol /var  --fstype="xfs" --size=10236 --name=var --vgname=rhel --fsoptions="nodev"
        
      2. Upgrade

      Expected results

      Inhibitor

      Actual results

      Upgrade crashes in reboot phase

              leapp-notifications leapp-notifications
              rhn-support-rmetrich Renaud Métrich
              leapp-notifications leapp-notifications
              RHEL Upgrades QE Team RHEL Upgrades QE Team
              Miriam Portman Miriam Portman
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated: