Bug 1912155

Summary: Fail to update filesystem inside systemd-nspawn container
Product: Red Hat Enterprise Linux 8 Reporter: Igor Kremin' <igor>
Component: filesystemAssignee: Martin Osvald 🛹 <mosvald>
Status: CLOSED ERRATA QA Contact: František Hrdina <fhrdina>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 8.3CC: akashche, carl, jorton, justinjereza, makhomed, psklenar, tonay
Target Milestone: rcKeywords: AutoVerified, EasyFix, Patch, Triaged
Target Release: 8.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: filesystem-3.8-5.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-09 19:51:53 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 Igor Kremin' 2021-01-03 22:01:16 UTC
Description of problem:
Fail to update filesystem inside systemd-nspawn container                                                                   

Version-Release number of selected component (if applicable):
3.8-3.el8.x86_64

How reproducible:
always

Steps to Reproduce:

1. Install RHEL 8.3 / CentOS 8.3

2. create systemd-nspawn container:

yum -y --nogpg --releasever=8 --installroot=/var/lib/machines/$name install systemd systemd-networkd passwd yum dnf-plugins-core vim-enhanced bash bash-completion cronie less psmisc openssh-server iputils iproute net-tools openssh-clients epel-release mc htop tar rsyslog libxslt-devel rootfiles

3. enter inside container

4. yum update

Actual results:
======================================================================================================================================================
 Package                               Architecture                      Version                              Repository                         Size
======================================================================================================================================================
Upgrading:
 filesystem                            x86_64                            3.8-3.el8                            baseos                            1.1 M

Transaction Summary
======================================================================================================================================================
Upgrade  1 Package

Total download size: 1.1 M
Downloading Packages:
filesystem-3.8-3.el8.x86_64.rpm                                                                                       8.9 MB/s | 1.1 MB     00:00
------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                 3.2 MB/s | 1.1 MB     00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Running scriptlet: filesystem-3.8-3.el8.x86_64                                                                                                  1/1
  Preparing        :                                                                                                                              1/1
  Upgrading        : filesystem-3.8-3.el8.x86_64                                                                                                  1/2
Error unpacking rpm package filesystem-3.8-3.el8.x86_64
  Verifying        : filesystem-3.8-3.el8.x86_64                                                                                                  1/2
  Verifying        : filesystem-3.8-2.el8.x86_64                                                                                                  2/2

Failed:
  filesystem-3.8-2.el8.x86_64                                               filesystem-3.8-3.el8.x86_64

Error: Transaction failed

----------------------------------------------------------------------------

Expected results:

updated filesystem package without errors.

Additional info:
  Upgrading        : filesystem-3.8-3.el8.x86_64
error: unpacking of archive failed on file /sys: cpio: chmod
error: filesystem-3.8-3.el8.x86_64: install failed
Error unpacking rpm package filesystem-3.8-3.el8.x86_64

/sys in container is readonly 
tmpfs on /sys type tmpfs (ro,nosuid,nodev,noexec,relatime,mode=755)

Comment 1 Pavel Zhukov 2021-01-04 09:47:00 UTC
Thank you for taking the time to report this issue to us. We appreciate the feedback and use reports such as this one to guide our efforts at improving our products. That being said, this bug tracking system is not a mechanism for requesting support, and we are not able to guarantee the timeliness or suitability of a resolution.

If this issue is critical or in any way time sensitive, please raise a ticket through the regular Red Hat support channels to ensure it receives the proper attention and prioritization to assure a timely resolution.

For information on how to contact the Red Hat production support team, please visit:
    https://access.redhat.com/support

Comment 2 Gena Makhomed 2021-01-10 23:07:33 UTC
I hit the same bug, but with different error message:

Error unpacking rpm package filesystem-3.8-3.el8.x86_64
  Running scriptlet: systemd-networkd-247.2-1.el8.x86_64
error: unpacking of archive failed on file /proc: cpio: chown

/proc is mounted in rw mode inside systemd-nspawn container:

proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)

# ls -la -d /proc
dr-xr-xr-x 471 nobody nobody 0 Jan  9 09:02 /proc

Hope this help to identify and fix the bug.

Comment 3 Gena Makhomed 2021-02-27 19:40:10 UTC
workaround, run inside systemd-nspawn container:

# echo '%_netsharedpath /sys:/proc' > /etc/rpm/macros.netshared

after this workaround filesystem package will be updated inside systemd-nspawn container without any problems:

# yum update filesystem

Comment 8 Pavel Zhukov 2021-06-21 06:16:17 UTC
*** Bug 1965093 has been marked as a duplicate of this bug. ***

Comment 21 errata-xmlrpc 2021-11-09 19:51:53 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 (filesystem bug fix and enhancement update), 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/RHBA-2021:4461

Comment 22 Michal Domonkos 2022-01-25 16:52:55 UTC
*** Bug 2027663 has been marked as a duplicate of this bug. ***