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

dnf fails with misleading "cpio: open failed - Not a directory" error message

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • rhel-9.4
    • rpm
    • None
    • Low
    • rhel-sst-cs-software-management
    • ssg_core_services
    • None
    • False
    • Hide

      None

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

      AC: When /lib is owned by non-root user and user tries to reinstall kernel-core package, user is informed about the error in a self-explanatory message.

      Old message:

      error: unpacking of archive failed on file /lib/modules: cpio: open failed - Not a directory
      error: kernel-core-4.18.0-553.16.1.el8_10.x86_64: install failed 

      New message:

      error: unpacking of archive failed on file /lib/modules: cpio: open failed - Unsafe symlink
      error: kernel-core-4.18.0-553.16.1.el8_10.x86_64: install failed 

      Test: to be written

      Show
      AC: When /lib is owned by non-root user and user tries to reinstall kernel-core package, user is informed about the error in a self-explanatory message. Old message: error: unpacking of archive failed on file /lib/modules: cpio: open failed - Not a directory error: kernel-core-4.18.0-553.16.1.el8_10.x86_64: install failed New message: error: unpacking of archive failed on file /lib/modules: cpio: open failed - Unsafe symlink error: kernel-core-4.18.0-553.16.1.el8_10.x86_64: install failed Test: to be written
    • None
    • None
    • Release Note Not Required
    • None

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

      A customer hit an issue with installing a kernel (which pushes files in /lib directory in particular), I was getting the following error message:

        Installing       : kernel-core-4.18.0-513.18.1.el8_9.x86_64                                                             1/2 
      error: failed to open dir lib of /lib/: Not a directory
      
      Error unpacking rpm package kernel-core-4.18.0-513.18.1.el8_9.x86_64
      [...]
      

      After much digging, it was found that /lib exited and was the appropriate symlink to /usr/lib but /lib was owned by some non-root user.

      The error message tends to indicate the errno of a previous C function was reused inadvertently.

      Please provide the package NVR for which bug is seen:

      rpm-libs-4.14.3-28.el8_9

      How reproducible:

      Always

      Steps to reproduce

      1. Change ownership of /lib symlink
        # useradd user
        # chown -h user /lib
      2. Install a kernel
        # yum install kernel-core-4.18.0-513.18.1.el8_9

      Expected results

      Some self-explanatory error message

      Actual results

      Cryptic misleading message

              mdomonko@redhat.com Michal Domonkos
              rhn-support-rmetrich Renaud Métrich
              packaging-team-maint packaging-team-maint
              Software Management QE Software Management QE
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: